-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add prettier * Add wordpress/prettier-config * Add prettier config * Update @wordpress/eslint-plugin extended config to recommended * Update code formatting with WPCS compatible prettier formatter * Remove rules which conflicts with prettier * Fix eslint errors after switching to prettier code formatter * Move eslint config to a extension based file * Update code formatting * Update package lock file * Update JS files formatting with prettier * Update deps order * Update comment body delimiter
- Loading branch information
1 parent
bf74d0d
commit 614e495
Showing
317 changed files
with
17,281 additions
and
12,065 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'plugin:@wordpress/eslint-plugin/recommended', | ||
'plugin:import/recommended', | ||
'plugin:eslint-comments/recommended', | ||
], | ||
env: { | ||
browser: true, | ||
}, | ||
rules: { | ||
'block-scoped-var': 'error', | ||
complexity: ['error', { max: 20 }], | ||
'consistent-return': 'error', | ||
'default-case': 'error', | ||
'guard-for-in': 'error', | ||
'no-await-in-loop': 'error', | ||
'no-extra-bind': 'error', | ||
'no-extra-label': 'error', | ||
'no-floating-decimal': 'error', | ||
'no-implicit-coercion': 'error', | ||
'no-implicit-globals': 'error', | ||
'no-implied-eval': 'error', | ||
'no-loop-func': 'error', | ||
'no-new': 'error', | ||
'no-new-func': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-restricted-properties': 'error', | ||
'no-return-assign': 'error', | ||
'no-return-await': 'error', | ||
'no-sequences': 'error', | ||
'no-shadow': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-throw-literal': 'error', | ||
'no-unmodified-loop-condition': 'error', | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
'no-useless-call': 'error', | ||
'no-useless-concat': 'error', | ||
'prefer-object-spread': 'error', | ||
'prefer-promise-reject-errors': 'error', | ||
'prefer-rest-params': 'error', | ||
'prefer-spread': 'error', | ||
radix: ['error', 'as-needed'], | ||
'require-await': 'error', | ||
'rest-spread-spacing': ['error', 'never'], | ||
'react/prop-types': 'error', | ||
'react-hooks/exhaustive-deps': [ | ||
'error', | ||
{ additionalHooks: 'useSelect' }, | ||
], | ||
'react/jsx-closing-tag-location': 'error', | ||
'react/jsx-fragments': 'error', | ||
'react/jsx-first-prop-new-line': 'error', | ||
'react/jsx-max-props-per-line': ['error', { when: 'multiline' }], | ||
'react/jsx-no-literals': 'error', | ||
'react/jsx-no-useless-fragment': 'error', | ||
'react/no-unused-prop-types': 'error', | ||
'react/self-closing-comp': 'error', | ||
'import/no-unresolved': [ | ||
'error', | ||
{ | ||
ignore: [ | ||
'jquery', | ||
'amp-block-editor-data', | ||
'amp-settings', | ||
'amp-themes', | ||
'amp-plugins', | ||
'amp-support', | ||
'amp-block-validation', | ||
'amp-site-scan-notice', | ||
], | ||
}, | ||
], | ||
'import/order': [ | ||
'error', | ||
{ | ||
groups: [ | ||
'builtin', | ||
['external', 'unknown'], | ||
'internal', | ||
'parent', | ||
'sibling', | ||
'index', | ||
], | ||
}, | ||
], | ||
'jsdoc/check-indentation': 'error', | ||
'@wordpress/dependency-group': 'error', | ||
'@wordpress/react-no-unsafe-timeout': 'error', | ||
}, | ||
overrides: [ | ||
{ | ||
files: [ | ||
'**/__tests__/**/*.js', | ||
'**/test/*.js', | ||
'**/?(*.)test.js', | ||
'tests/js/**/*.js', | ||
], | ||
extends: ['plugin:jest/all'], | ||
rules: { | ||
'jest/prefer-lowercase-title': [ | ||
'error', | ||
{ | ||
ignore: ['describe'], | ||
}, | ||
], | ||
'jest/max-expects': 'off', | ||
'jest/no-hooks': 'off', | ||
'jest/prefer-expect-assertions': 'off', | ||
'jest/prefer-inline-snapshots': 'off', | ||
'jest/prefer-snapshot-hint': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['tests/e2e/**/*.js'], | ||
extends: [ | ||
'plugin:@wordpress/eslint-plugin/test-e2e', | ||
'plugin:jest/all', | ||
], | ||
rules: { | ||
'jest/prefer-lowercase-title': [ | ||
'error', | ||
{ | ||
ignore: ['describe'], | ||
}, | ||
], | ||
'jest/max-expects': 'off', | ||
'jest/no-hooks': 'off', | ||
'jest/prefer-expect-assertions': 'off', | ||
'jest/prefer-inline-snapshots': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['assets/src/mobile-redirection.js'], | ||
globals: { | ||
AMP_MOBILE_REDIRECTION: false, | ||
location: false, | ||
navigator: false, | ||
sessionStorage: false, | ||
}, | ||
}, | ||
{ | ||
files: ['assets/src/customizer/amp-customize-controls.js'], | ||
globals: { | ||
HTMLAnchorElement: false, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
module.exports = { | ||
"package.json": [ | ||
"npm run lint:pkg-json" | ||
], | ||
"**/*.(css|scss)": [ | ||
"npm run lint:css" | ||
], | ||
"**/*.js": [ | ||
"npm run lint:js" | ||
], | ||
"**/!(amp.php).php": [ | ||
"npm run lint:php" | ||
], | ||
"amp.php": [ | ||
"vendor/bin/phpcs --runtime-set testVersion 5.2-" | ||
], | ||
"*.php": () => 'composer analyze' | ||
'package.json': ['npm run lint:pkg-json'], | ||
'**/*.(css|scss)': ['npm run lint:css'], | ||
'**/*.js': ['npm run lint:js'], | ||
'**/!(amp.php).php': ['npm run lint:php'], | ||
'amp.php': ['vendor/bin/phpcs --runtime-set testVersion 5.2-'], | ||
'*.php': () => 'composer analyze', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"@wordpress/prettier-config" |
Oops, something went wrong.