-
Notifications
You must be signed in to change notification settings - Fork 4.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
ESLint: Copy no-restricted-syntax rules from ESLint plugin to config file #15877
Conversation
Also, remove unused import of lodash.map
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.
Thanks for wrangling it. Let's merge when Travis is green.
@@ -1,7 +1,7 @@ | |||
/** | |||
* External dependencies | |||
*/ | |||
const { escapeRegExp, map } = require( 'lodash' ); | |||
const { escapeRegExp } = require( 'lodash' ); |
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.
That's surprising, it should error in master...
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.
$ ./node_modules/.bin/eslint .eslintrc.js
/Users/pascalb/Workspace/WordPress/gutenberg/.eslintrc.js
0:0 warning File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override
✖ 1 problem (0 errors, 1 warning)
That explains it :-)
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 was wondering the same, but reason is that the .eslintrc.js
file is, by default, ignored. So ESLint doesn't check it.
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.
Nice, good to know 😃
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 was wondering the same, but reason is that the
.eslintrc.js
file is, by default, ignored. So ESLint doesn't check it.
Can we change this? Not immediately obvious why we'd want it to be exempt.
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.
Description
As discussed in #15839, this PR copies the custom rules/options to the Gutenberg ESLint config.
How has this been tested?
Create a file
test.js
with this content:Then call:
Types of changes
Copy ESLint rules/options that are defined in the ESLint plugin, but overriden in the Gutenberg ESLint config.
Checklist: