-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed apps from the workspaces; couldn't find another way to make it work :( - Moved all the ESlint packages to the root, including typescript ones - The schema-blocks ESlint configuration has to stay inside that package due to non-overridable config - Schema-blocks `useCallback` didn't work nicely, so ignore those ESlint errors inline - Override ESlint config to prevent too many changes: `no-prototype-builtins` and `comma-dangle` (disabled for functions) - Added `.eslintrc` and `.yaml` to the 2 spaces indent rule in `.editorconfig` - Fixed all ESlint errors still remaining - Adjusted the max Eslint warnings to the current amount of warnings
- Loading branch information
1 parent
e9d192c
commit 2b2c5ab
Showing
103 changed files
with
533 additions
and
4,854 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
This file was deleted.
Oops, something went wrong.
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,39 +1,176 @@ | ||
extends: yoast | ||
|
||
parser: babel-eslint | ||
parserOptions: | ||
ecmaVersion: 2018 | ||
sourceType: module | ||
|
||
settings: | ||
react: | ||
version: "16.8" | ||
|
||
rules: | ||
# Custom rules: only for temporary exceptions that should be removed over time | ||
camelcase: 1 | ||
complexity: [1, 6] | ||
brace-style: 1 | ||
max-statements: 1 | ||
no-shadow: 1 | ||
require-jsdoc: 1 | ||
react/jsx-no-bind: 1 | ||
react/jsx-no-target-blank: 1 | ||
react/no-access-state-in-setstate: 1 | ||
react/no-deprecated: 1 | ||
react/no-unused-prop-types: 1 | ||
react/prop-types: 1 | ||
react/require-default-props: 1 | ||
no-restricted-imports: | ||
no-prototype-builtins: 0 | ||
comma-dangle: | ||
- error | ||
- name: react | ||
message: Please use @wordpress/element instead. No need to import just for JSX. | ||
- name: react-dom | ||
message: Please use @wordpress/element instead. | ||
|
||
# Disabled rules | ||
# In the editor, we're using the pragma `wp.element.createElement` | ||
react/react-in-jsx-scope: 0 | ||
- arrays: always-multiline | ||
objects: always-multiline | ||
imports: always-multiline | ||
exports: always-multiline | ||
functions: never | ||
|
||
overrides: | ||
- files: | ||
- "js/tests/**/*.js" | ||
- "packages/*/tests/**/*.js" | ||
- "packages/*/spec/**/*.js" | ||
# Temporary exclusion: | ||
- "packages/components/a11y/tests/**/*.js" | ||
env: | ||
jest: true | ||
rules: | ||
no-restricted-imports: "off" | ||
- files: | ||
- "packages/js/**/*.js" | ||
rules: | ||
# Custom rules: only for temporary exceptions that should be removed over time | ||
camelcase: 1 | ||
complexity: [ 1, 6 ] | ||
brace-style: 1 | ||
max-statements: 1 | ||
no-shadow: 1 | ||
require-jsdoc: 1 | ||
react/jsx-no-bind: 1 | ||
react/jsx-no-target-blank: 1 | ||
react/no-access-state-in-setstate: 1 | ||
react/no-deprecated: 1 | ||
react/no-unused-prop-types: 1 | ||
react/prop-types: 1 | ||
react/require-default-props: 1 | ||
no-restricted-imports: | ||
- error | ||
- name: react | ||
message: Please use @wordpress/element instead. No need to import just for JSX. | ||
- name: react-dom | ||
message: Please use @wordpress/element instead. | ||
|
||
settings: | ||
react: | ||
version: "16.3" | ||
# Disabled rules | ||
# In the editor, we're using the pragma `wp.element.createElement` | ||
react/react-in-jsx-scope: 0 | ||
- files: | ||
- "packages/js/tests/**/*.js" | ||
rules: | ||
no-restricted-imports: 0 | ||
- files: | ||
- "packages/schema-blocks/src/**" | ||
env: | ||
jest: true | ||
rules: | ||
new-cap: 0 | ||
complexity: | ||
- 2 | ||
- 10 | ||
"@typescript-eslint/no-parameter-properties": | ||
- 2 | ||
- allows: | ||
- protected readonly | ||
- private readonly | ||
"@typescript-eslint/explicit-function-return-type": 0 | ||
"@typescript-eslint/no-use-before-define": | ||
- error | ||
- functions: false | ||
no-constant-condition: | ||
- error | ||
- checkLoops: false | ||
max-statements: | ||
- 2 | ||
- 33 | ||
no-unused-vars: 'off' | ||
"@typescript-eslint/no-unused-vars": | ||
- error | ||
- varsIgnorePattern: "^createElement$" | ||
no-dupe-class-members: 'off' | ||
indent: 'off' | ||
"@typescript-eslint/indent": | ||
- 2 | ||
- tab | ||
- SwitchCase: 1 | ||
space-before-function-paren: | ||
- error | ||
- anonymous: never | ||
named: never | ||
asyncArrow: always | ||
valid-jsdoc: | ||
- error | ||
- requireReturn: false | ||
requireReturnType: false | ||
requireParamType: false | ||
react/react-in-jsx-scope: 0 | ||
- files: | ||
- "packages/components/**/*.js" | ||
rules: | ||
react/jsx-no-bind: 1 | ||
react/require-default-props: 1 | ||
react/default-props-match-prop-types: 1 | ||
react/no-unused-prop-types: 1 | ||
require-jsdoc: 1 | ||
- files: | ||
- "packages/configuration-wizard/**/*.js" | ||
rules: | ||
react/no-unused-prop-types: 1 | ||
react/jsx-no-bind: 1 | ||
react/no-access-state-in-setstate: 1 | ||
require-jsdoc: 1 | ||
- files: | ||
- "packages/replacement-variable-editor/**/*.js" | ||
rules: | ||
react/jsx-no-bind: 1 | ||
react/require-default-props: 1 | ||
- files: | ||
- "packages/search-metadata-previews/**/*.js" | ||
rules: | ||
react/jsx-no-bind: 1 | ||
react/no-unused-state: 1 | ||
react/no-access-state-in-setstate: 1 | ||
react/require-default-props: 1 | ||
react/default-props-match-prop-types: 1 | ||
- files: | ||
- "packages/yoastseo/**/*.js" | ||
rules: | ||
complexity: 1 | ||
# Longer grace period for Yoast config. | ||
no-shadow: [ 1, { "builtinGlobals": false, "hoist": "all", "allow": [ ] } ] | ||
require-jsdoc: [ 1, { "require": { "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, "FunctionExpression": true } } ] | ||
no-useless-escape: 1 | ||
- files: | ||
- "packages/analysis-report/**/*.js" | ||
rules: | ||
complexity: [ 1, 6 ] | ||
// A wrapping label is not necessary when there already is an htmlFor attribute. | ||
jsx-a11y/label-has-for: [ "error", { required: "id" } ] | ||
require-jsdoc: 1 | ||
react/button-has-type: 1 | ||
react/default-props-match-prop-types: 1 | ||
react/no-unused-prop-types: 1 | ||
react/no-access-state-in-setstate: 1 | ||
react/no-unused-state: 1 | ||
react/jsx-no-bind: 1 | ||
react/jsx-no-target-blank: 1 | ||
react/require-default-props: 1 | ||
react/forbid-foreign-prop-types: 1 | ||
- files: | ||
- "packages/yoast-components/**/*.js" | ||
rules: | ||
complexity: [ 1, 6 ] | ||
// A wrapping label is not necessary when there already is an htmlFor attribute. | ||
jsx-a11y/label-has-for: [ "error", { required: "id" } ] | ||
require-jsdoc: 1 | ||
react/button-has-type: 1 | ||
react/default-props-match-prop-types: 1 | ||
react/no-unused-prop-types: 1 | ||
react/no-access-state-in-setstate: 1 | ||
react/no-unused-state: 1 | ||
react/jsx-no-bind: 1 | ||
react/jsx-no-target-blank: 1 | ||
react/require-default-props: 1 | ||
react/forbid-foreign-prop-types: 1 | ||
env: | ||
jest: true |
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
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
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
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
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
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
Oops, something went wrong.