-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
chore: update eslint from version 7 to version 8 #29355
Conversation
cc @MikeMcC399 |
1 flaky test on run #55197 ↗︎
Details:
cypress/e2e/project-setup.cy.ts • 1 flaky test • launchpad-e2e
Review all test suite changes for PR #29355 ↗︎ |
6f4a4a3
to
70c05cb
Compare
Thanks for the cc: !
|
npm/eslint-plugin-dev/README.md
Outdated
For Eslint 8+, use version 6.x.x | ||
|
||
For Eslint 7 and below, use version 5.x.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the compatibility advice!
I doubt if you have ESLint 9 compatibility set up, which requires flat files, and I don't know that getting involved with ESLint 6 and below is still worthwhile, so that would reduce to:
⚠️ Currently does not support ESLint version 9
For Eslint 8, use version 6.x.x
For Eslint 7, use version 5.x.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also think that is true too. I will update the readme!
a30fd64
to
d6b086a
Compare
@AtofStryker FYI
|
80b87a4
to
2a9c95f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AtofStryker The intention of the original json linter was to lint our package.json files to ensure they are formatted correctly and that all packages are listed alphabetically. I see that this behavior is lost with these changes.
2a9c95f
to
118bae2
Compare
ah I see! I only checked for syntax corrections when doing the move over. I think we can still use Going to see if there are issues in CI then will update the description and request a re review |
118bae2
to
ec036c4
Compare
], | ||
rules: { | ||
'no-duplicate-imports': 'off', | ||
'import/no-duplicates': 'off', | ||
'@typescript-eslint/no-duplicate-imports': [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean duplicate imports are now allowed? I added a duplicate import to a file and yarn lint
passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird the rule was renamed. I'll double check and make sure I implemented it correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I see what happened. so the rule was deprecated for import/no-duplicates
which we have set to off
but we really should have it turned on. However, the rule comes from import/no-duplicates
which was referenced in @cypress/eslint-plugin-dev
but not installed or configured (likely resolved from the root of the monorepo). I added the dependency to the package and configured the plugin correctly, so the linting rules for duplicate imports should now work correctly. done in e6e262f
…dev minimum to eslint 7. Remove support for coffeescript and reconfigured required peer deps
…n linting on all json files (previously was not running)
ec036c4
to
e6e262f
Compare
* chore: (for eslint-plugin-dev only is breaking) update eslint-plugin dev minimum to eslint 7. Remove support for coffeescript and reconfigured required peer deps * correctly configure eslint-plugin-json-format for the monorepo and run linting on all json files (previously was not running) * properly support no duplicate imports
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
This PR gets the monorepo on
eslint
v8 from v7. Because we leverage@cypress/eslint-plugin-dev
quite heavily, we also needed to update@cypress/eslint-plugin-dev
to support eslint version 8 and up, which is a breaking change to@cypress/eslint-plugin-dev
.Also, sinceeslint-plugin-json-format
is no longer maintained and uses the oldbabel-eslint
parser, I have migrated us toeslint-plugin-jsonc
which is actively maintained.eslint-plugin-json-format
doesn't actually have a dependency onbabel-eslint
, it was just a red herring of an error when trying to lint one of the system tests that is using an outdated version (intentionally) ofvue-eslint-parser
. I have correctly configuredeslint-plugin-json-format
in the repo and linted allpackage.json
files in sub packages, which was not working correctly before.Currently, with our release process, it is very difficult to release a standalone npm package as breaking while there are other changes inside the monorepo, which will also be flagged as breaking.
My recommendation is we merge this in as a
chore
, which will NOT trigger a release of@cypress/eslint-plugin-dev
, and have a follow up PR that isbreaking
and only includes changes in the@cypress/eslint-plugin-dev
directory, mainly the changelog and referencing the correct merged commit so we can easily release@cypress/eslint-plugin-dev
6.x.x
Steps to test
run
yarn lint
in the repo, as well as the tests inside@cypress/eslint-plugin-dev
to make sure everything works correctlySteps to review
There are quite a few changes in this PR, so I have squashed them down to two major things
eslint-plugin-dev
which can be seen in the first commit. This is the bulk of important changes 309ee08the removal ofCorrectly configureeslint-plugin-json-format
from the repo and the plugin and usingeslint-plugin-jsonc
, which changes a lot of the references in the repo. This looks like much, but most of the changes are the same. I have elected to lint thetsconfig
and removed lock files from the eslint ignore sinceeslint-plugin-json-format
does not try to lint those files by default. 2a9c95feslint-plugin-json-format
for use in the repo with eslint 8 and lint files that were not previously being linted correctly by the plugin 118bae2How has the user experience changed?
mono repo users will now be on eslint v8 and opens the door to support Eslint v8 inside
eslint-plugin-cypress
if we still use@cypress/eslint-plugin-dev
insideeslint-plugin-cypress
. @MikeMcC399 is working on a PR to remove@cypress/eslint-plugin-dev
(see cypress-io/eslint-plugin-cypress#177) fromeslint-plugin-cypress
, which is the correct direction. In the future, we might not need this plugin any longer as most the rules look to be supported OOTB fromeslint-plugin-mocha
(a decision to be made later).PR Tasks
cypress-documentation
?type definitions
?