chore(deps): bump to ecmaVersion 2020 #195
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
The instructions in the original ESLint blog post Preparing your custom rules for ESLint v9.0.0 for converting the deprecated
context.getScope()
andcontext.getAncestors()
did not work for ESLint>=7 <=8.3.0
.I reported this in issue Docs: context migration suggestions fail on earlier v8 versions eslint/eslint.org#559.
The ESLint team responded with PR fix: Update custom rules v9 upgrade post eslint/eslint.org#560.
The new suggestions involve using the Nullish coalescing operator (??). The code falls back to previous API standards if the new API calls aren't available, so it can be used flexibly in old and new ESLint versions.
The new suggestions however fail linting in this repo with the following error message:
Background
The Nullish coalescing operator (??) was introduced in ECMAScript 2020, the 11th edition (reference ECMAScript 2025 > Introduction).
ECMAScript 2020 (ES11) was released in June 2020.
The lowest supported version of Node.js is Release
18.x
Node.js 18.0.0 was released 2 years after ECMAScript 2020.ecmaVersion
2018
from https://github.com/cypress-io/cypress/blob/develop/npm/eslint-plugin-dev/lib/index.js#L210Change
Bump the
ecmaVersion
from2018
to2020
eslint-plugin-cypress/.eslintrc.json
Lines 37 to 39 in 9222abb
Related