-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[eslint] switch to eslint.config.js
#3600
base: master
Are you sure you want to change the base?
Conversation
'**/protractor.conf.*.js', | ||
'**/karma.conf.js', | ||
'**/.eslintrc.js', | ||
'eslint.config.js', |
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 added eslint.config.js
to this list to fix 'globals' should be listed in the project's dependencies, not devDependencies
errors. The rest is just copy-pasted from airbnb.
@@ -1,3 +1,5 @@ | |||
'use strict'; |
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.
This file wasn't linted before because it's a dotfile.
@@ -57,12 +58,13 @@ | |||
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8", | |||
"eslint-config-airbnb-base": "^15.0.0", | |||
"eslint-doc-generator": "^1.4.3", | |||
"eslint-plugin-eslint-plugin": "^2.3.0 || ^3.5.3 || ^4.0.1 || ^5.0.5", | |||
"eslint-plugin-eslint-plugin": "^2.3.0 || ^3.5.3 || ^4.0.1 || ^5.1.0", |
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.
Flat config exports that eslint.config.js
uses were added in v5.1.0.
{ | ||
files: ['markdown.config.js'], | ||
rules: { | ||
'no-console': 0, | ||
}, | ||
}, |
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.
This is copy-pasted from .eslintrc
, but this file doesn't seem to exist so it probably can be removed.
I'm not sure if the failures on CI are related to these changes. |
I prefer .eslintrc as a format, and will stay with it until I’m absolutely forced not to. I’m happy to keep this PR open, though, to help eslint test. There are indeed existing failures on master (i asked about them in the discord a month ago or so). |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
eslintrc is no longer searched for |
380e32c
to
51d342b
Compare
Updates linting for this repo to use ESLint flat config (
eslint.config.js
).The goal is to test out flat config on popular ESLint plugins, please see eslint/eslint#13481 Phase 3: Compatibility testing.
I've verified that:
eslint .
lints the same 249 files as before + the neweslint.config.js
file +.eslint-doc-generatorrc.js
eslint .
are the same as before (0 errors and the exact same 50 warnings).eslint --print-config
) are the same as before except for structural differences between eslintrc and flat config formats, and one change I made for theimport/no-extraneous-dependencies
rule.