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

Drop or change hard-coded ecmaVersion #215

Open
brettz9 opened this issue Jul 23, 2024 · 4 comments
Open

Drop or change hard-coded ecmaVersion #215

brettz9 opened this issue Jul 23, 2024 · 4 comments

Comments

@brettz9
Copy link
Contributor

brettz9 commented Jul 23, 2024

I ran into some issues with the Cypress plugin hard-coding ES2019 to my files, not letting me use BigInt literals, for example.

I don't see any reason why Cypress has to have a particular ecmaVersion setting. The new default with ESLint is to use ecmaVersion: 'next'. If the purpose is to be more careful than the default, ensuring projects will err if they try to use too advanced of a feature for their browsers, one can use https://github.com/keithamus/eslint-plugin-escompat which, while it sets ecmaVersion to a recent version (now ES2023), detects the project's browser targets and provides linting errors if too recent of ES features are used.

@MikeMcC399
Copy link
Collaborator

@brettz9

Are you suggesting to drop ecmaVersion: 2019 setting for both legacy and flat configs?

parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
},

const commonLanguageOptions = {
ecmaVersion: 2019,
sourceType: 'module'
}

You say you had some issues. Were you able to override the settings in your local ESlint config?

I would definitely be in favor of dropping some backwards-compatible settings and configurations at an appropriate time moving forward.

v3.0.0 was a breaking change due to dropping support for ESLint v3, v4, v5 & v6. Apart from that, backwards-compatibility has been maintained. Currently there are still far more downloads of the v2.x plugin compared to the v3.x plugin, so uptake is slow-moving!

@brettz9
Copy link
Contributor Author

brettz9 commented Jul 24, 2024

@brettz9

Are you suggesting to drop ecmaVersion: 2019 setting for both legacy and flat configs?

Yes.

parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
},

const commonLanguageOptions = {
ecmaVersion: 2019,
sourceType: 'module'
}

You say you had some issues. Were you able to override the settings in your local ESlint config?

Yes.

I would definitely be in favor of dropping some backwards-compatible settings and configurations at an appropriate time moving forward.

v3.0.0 was a breaking change due to dropping support for ESLint v3, v4, v5 & v6. Apart from that, backwards-compatibility has been maintained. Currently there are still far more downloads of the v2.x plugin compared to the v3.x plugin, so uptake is slow-moving!

Yeah, removing it would probably not be backward-compatible, because for some it could be a higher ecmaVersion than their default. But setting it higher, e.g., to 2025 may work, but that would depend on their ESLint version supporting that as a value (and would require your periodically updating).

@MikeMcC399
Copy link
Collaborator

I would prefer to drop support for legacy configs completely and to move to the default ecmaVersion at some convenient stage so that the plugin is fully aligned with ESLint itself.

@MikeMcC399
Copy link
Collaborator

I'm going to suggest removing the commonLanguageOptions in the flat config of the next major release of the plugin. ESLint v8 reaches end-of-life on Oct 5, 2024 and that could be a trigger to provide a new release very soon.

I prefer not touching the legacy config though to avoid breaking existing setups, since there is no default for legacy. Users who need a higher version will probably already have an override in their configuration. Users who don't, might get surprised if this is updated. You could however argue either way - to keep or to update.

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