test(deps): migrate from standard to eslint linter #168
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.
Situation
[email protected] released on Jul 21, 2019 is configured in this repo. The latest version is [email protected], released one year ago in Sep 2024, and which uses outdated dependencies, such as
[email protected]
with end-of-life on Oct 5, 2024.[email protected] released on Apr 5, 2018 is configured in this repo. The latest version is [email protected], released 5 years ago in Apr 2020, and which uses outdated dependencies, such as
[email protected]
with end-of-life on Nov 8, 2020, and multiple unfixable vulnerabilities:Assessment
The above two dependencies need to be considered together, since they are interdependent. They also each depend on different versions of ESlint.
Change
Remove standard and prettier-standard, and replace with supported npm packages:
For scripts:
lint
fromstandard
toeslint
prelint
andpretty
Apply
npx eslint --fix
, after setting rules as below, to autofix linting.Rules
Apply a rule strategy based on each linter's recommended configuration:
In case of linting errors, add rules aligned to linting choices in https://github.com/cypress-io/cypress
mocha/max-top-level-suites
off
packages/eslint-config
mocha/no-mocha-arrows
off
packages/eslint-config
mocha/no-setup-in-describe
off
packages/eslint-config
@stylistic/arrow-parens
['error', 'always']
npm/eslint-plugin-dev
@stylistic/comma-dangle
['error', 'always-multiline']
packages/eslint-config
@stylistic/space-before-function-paren
['error', 'always']
packages/eslint-config
Verify
git clean -xfd npm ci npm run lint npm test
Reference
with fallback to: