Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Timebox] POC: use Nx Workspace Lint rules feature #3162

Closed
thaisguigon opened this issue Dec 27, 2023 · 0 comments · Fixed by #3163
Closed

[Timebox] POC: use Nx Workspace Lint rules feature #3162

thaisguigon opened this issue Dec 27, 2023 · 0 comments · Fixed by #3163
Assignees

Comments

@thaisguigon
Copy link
Contributor

thaisguigon commented Dec 27, 2023

Scope & Context

Our custom Eslint rules are written in Typescript and must be built before Eslint and VSCode can use them.
Currently, the rules are built as a tgz file (eslint-plugin-twenty.tgz) to ensure they work from project installation.

This issue aims to leverage Nx's "workspace lint rules" feature (see https://nx.dev/nx-api/eslint/generators/workspace-rule) and how we can use it in our project, so we can avoid building a tgz file and still dynamically load eslint rules written in TS.

Technical inputs

  • Use Nx's generator to recreate the existing custom rules from eslint-plugin-twenty and load them in twenty-front's eslint config.
  • Configure an extendable eslint config at the root of the workspace, to set common base rules for all packages.
  • Use Nx's eslint plugin to set recommended configs.
  • Take inspiration from how Nx configures eslint for monorepos (see https://github.com/nrwl/nx-examples/tree/master).
  • Check that linting tools/eslint-rules and packages/twenty-front packages works.
@thaisguigon thaisguigon self-assigned this Dec 27, 2023
@thaisguigon thaisguigon moved this from 🆕 New to 🏗 In progress in Product development ✅ Dec 27, 2023
thaisguigon added a commit that referenced this issue Dec 27, 2023
thaisguigon added a commit that referenced this issue Dec 27, 2023
@thaisguigon thaisguigon moved this from 🏗 In progress to 👀 In review in Product development ✅ Dec 27, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Product development ✅ Jan 3, 2024
charlesBochet added a commit that referenced this issue Jan 3, 2024
* chore: use Nx workspace lint rules

Closes #3162

* Fix lint

* Fix lint on BE

* Fix tests

---------

Co-authored-by: Charles Bochet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant