-
Notifications
You must be signed in to change notification settings - Fork 799
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
Adds base ESLint configuration to the wpcomsh plugin. #39275
Changes from 18 commits
57d6223
31fa9ec
b02db9e
f0ec82c
f26df6c
6a4051c
3be0aa3
0052b4f
ec4ad11
adb1369
b93804a
2175af7
6b41a6e
5a400f2
ac72869
9cabb23
c71e3db
29cc5fa
e4517dd
3912ef1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Not loaded by default eslint, but we use tools/js-tools/load-eslint-ignore.js in .eslintrc to pull it in. | ||
|
||
/tests/e2e | ||
/custom-colors/js/jquery.spin.js | ||
/custom-colors/js/spin.js | ||
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we get around to setting up a webpack build for the scripts here in some future PR, we could also look at whether there's an npm package we could use instead of copy-pasting these in. The |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,13 @@ | ||
const loadIgnorePatterns = require( 'jetpack-js-tools/load-eslint-ignore.js' ); | ||
|
||
module.exports = { | ||
root: true, | ||
extends: [ | ||
require.resolve( 'jetpack-js-tools/eslintrc/jest' ), | ||
require.resolve( 'jetpack-js-tools/eslintrc/prettier' ), | ||
], | ||
ignorePatterns: loadIgnorePatterns( __dirname ), | ||
overrides: [], | ||
env: { | ||
browser: true, | ||
jest: true, | ||
node: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
}, | ||
globals: {}, | ||
settings: {}, | ||
rules: { | ||
// Enforce use of the correct textdomain. | ||
'@wordpress/i18n-text-domain': [ | ||
'error', | ||
{ | ||
allowedTextDomain: 'wpcomsh', | ||
}, | ||
], | ||
|
||
'jest/no-disabled-tests': 'warn', | ||
'jest/no-focused-tests': 'error', | ||
'jest/no-identical-title': 'error', | ||
'jest/prefer-to-have-length': 'warn', | ||
'jest/valid-expect': 'error', | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: changed | ||
|
||
Introduced ESLint base config and fixed errors. |
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.
Eventually we probably should lint this, but OK with me if we do that as a followup.