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

Require ESLint 8 #1724

Merged
merged 4 commits into from Feb 16, 2022
Merged

Require ESLint 8 #1724

merged 4 commits into from Feb 16, 2022

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Feb 9, 2022

  • Use es2021: true instead of es6: true.
  • Add tests to validate it actually works
  • Drop support for ESLint v7

Can't use es2022

Error {
    message: `--config:
        Environment key "es2022" is unknown
    `,
  }

Actually, I was going to remove env, I thought setting ecmaVersion auto enables those envs, I'll investigate.

@fisker
Copy link
Collaborator Author

fisker commented Feb 9, 2022

I was wrong about env, https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options

For ES6 syntax, use { "parserOptions": { "ecmaVersion": 6 } }; for new ES6 global variables, use { "env": { "es6": true } }. { "env": { "es6": true } } enables ES6 syntax automatically, but { "parserOptions": { "ecmaVersion": 6 } } does not enable ES6 globals automatically.

@fisker fisker marked this pull request as ready for review February 9, 2022 11:39
@sindresorhus sindresorhus changed the title Update env config Require ESLint 8 Feb 16, 2022
@sindresorhus sindresorhus merged commit 608a90c into sindresorhus:main Feb 16, 2022
@sindresorhus
Copy link
Owner

And since we're dropping ESLint 7:

// TODO: Remove this when we drop support for ESLint 7
const eslintVersion = require('eslint/package.json').version;

@fisker fisker mentioned this pull request Feb 17, 2022
@alfaproject
Copy link

I think you mean it requires eslint@8.9 because according to our CI the update to this version is not compatible with 8.8...

Can you tell me exactly why es2022 is needed? Seems like an unnecessary breaking change for no real reason

@fisker fisker deleted the es2021 branch February 24, 2022 11:53
@fisker
Copy link
Collaborator Author

fisker commented Feb 24, 2022

Sorry, this PR was created before ESLint release 8.9, add es2022 was added in that version.

no real reason

No reason, but we only want to support the latest version, if this cause problems, you can pin to v40.

@alfaproject
Copy link

No problems, we just updated to eslint 8.9 anyway but maybe worth to update the change log. More curiosity than anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants