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

eslint: switch to flat configuration #5282

Closed
BacLuc opened this issue Jun 2, 2024 · 2 comments
Closed

eslint: switch to flat configuration #5282

BacLuc opened this issue Jun 2, 2024 · 2 comments

Comments

@BacLuc
Copy link
Contributor

BacLuc commented Jun 2, 2024

Eslint 9 uses a new configuration format by default (called "flat configuration"). So this PR would need some config changes before we can upgrade to eslint9.

For Nuxt, some further details are described here:
https://eslint.nuxt.com/guide/faq#package-disambiguation
https://eslint.nuxt.com/packages/module

And here is a eslint migration guide for the new config format:
https://eslint.org/docs/latest/use/configure/migration-guide

Originally posted by @usu in #5155 (comment)

Also, we shouldn't need to add @typescript-eslint/eslint-plugin to the dev dependencies anymore.

@BacLuc BacLuc added Meeting Discuss Am nächsten Core-Meeting besprechen type: Frontend type: Print labels Jun 2, 2024
@BacLuc
Copy link
Contributor Author

BacLuc commented Jun 2, 2024

Proposal to resolve this:

  1. switch to new format for all modules
    I would do this first, because i did not get the nuxt eslint helper modules to support both
  2. Update to eslint 9

@manuelmeister
Copy link
Member

Core Meeting Decision

  1. We individually switch the format for each module
  2. Update to eslint 9

@manuelmeister manuelmeister removed the Meeting Discuss Am nächsten Core-Meeting besprechen label Jun 4, 2024
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 2, 2024
With node_modules/.bin/eslint --print-config specs/login.cy.js > eslint-config-js.json
That we are sure that the config did not change during the migration.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 2, 2024
The config migrator needs the configuration to
be in a separate file.
https://eslint.org/blog/2024/05/eslint-configuration-migrator/

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 2, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Remove the options from the call to eslint which are not
supported anymore in the package.json.

The resulting schema of the command
node_modules/.bin/eslint --print-config specs/login.cy.js > eslint-config-js.json
is different.
But diffing only the rules seemed to look the same.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 12, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Add .mjs files to the prettier pattern that the eslint.config.mjs is also prettied.
Also lint .ts files with eslint (this seems not to be the default).
Remove the options from the call to eslint which are not
supported anymore in the package.json.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 12, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Remove the options from the call to eslint which are not
supported anymore in the package.json.
Also run mjs files through the prettier.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 12, 2024
Was only needed for the migration

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 13, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Also lint .ts files with eslint (this seems not to be the default).
Remove the options from the call to eslint which are not
supported anymore in the package.json.

Issue: ecamp#5282
@BacLuc BacLuc self-assigned this Aug 13, 2024
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 13, 2024
Using npx @eslint/migrate-config .eslintrc.json

Then add the additional packages needed
npm install -D -E globals @eslint/js @eslint/eslintrc @eslint/compat

Add paths from the .gitignore file to the ignored patterns.
Add data, dist and public/twemoji explicitly because that did not work with the
includeIgnoreFile.
Remove the options from the call to eslint which are not
supported anymore in the package.json.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 13, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Also lint .ts files with eslint (this seems not to be the default).
Remove the options from the call to eslint which are not
supported anymore in the package.json.
Ignore common, .nuxt and .output explicitly, because it did not work with
includeIgnoreFile.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 13, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Add .mjs files to the prettier pattern that the eslint.config.mjs is also prettied.
Also lint .ts files with eslint (this seems not to be the default).
Remove the options from the call to eslint which are not
supported anymore in the package.json.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 13, 2024
The . after the eslint command is important, else it lints nothing.
Explicitly exclude the generated files, ignoring it via the .gitignored files did not work.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 13, 2024
The . after the eslint command is important, else it lints nothing.
Ignore the data directory explicitly.
Add eslint-parser and set languageOptions.ecmaVersion to 2022,
else the import.meta above leads to a lint error.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 13, 2024
The . after the eslint command is important, else it lints nothing.
Ignore the data directory explicitly.
Add eslint-parser and set languageOptions.ecmaVersion to 2022,
else the import.meta above leads to a lint error.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 18, 2024
Using npx @eslint/migrate-config .eslintrc.json

Then add the additional packages needed
npm install -D -E globals @eslint/js @eslint/eslintrc @eslint/compat

Add paths from the .gitignore file to the ignored patterns.
Add data, dist and public/twemoji explicitly because that did not work with the
includeIgnoreFile.
Remove the options from the call to eslint which are not
supported anymore in the package.json.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 21, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Add .mjs files to the prettier pattern that the eslint.config.mjs is also prettied.
Also lint .ts files with eslint (this seems not to be the default).
Remove the options from the call to eslint which are not
supported anymore in the package.json.

Issue: ecamp#5282
BacLuc added a commit to BacLuc/ecamp3 that referenced this issue Aug 21, 2024
Using npx @eslint/migrate-config .eslintrc.json
Then add the additional packages needed
(@eslint/compat, globals, @eslint/eslintrc, @eslint/js)
Add paths from the .gitignore file to the ignored patterns.
Also lint .ts files with eslint (this seems not to be the default).
Remove the options from the call to eslint which are not
supported anymore in the package.json.
Ignore common, .nuxt and .output explicitly, because it did not work with
includeIgnoreFile.

Issue: ecamp#5282
@BacLuc BacLuc closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants