diff options
author | Valentin Popov <info@valentineus.link> | 2020-10-02 16:19:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-02 16:19:18 +0300 |
commit | ca3472cf54466250deafbb210d81054674b5a27d (patch) | |
tree | 975dc87692d80347b3604e3d649a65dbd51e50f6 /src | |
parent | a7aeded00994c56e4a6f24f53944b159be3a253d (diff) | |
parent | 8a1a4a502c1045e3f74bfe74addad130edb99f48 (diff) | |
download | eslint-config-ca3472cf54466250deafbb210d81054674b5a27d.tar.xz eslint-config-ca3472cf54466250deafbb210d81054674b5a27d.zip |
Merge pull request #7 from valentineus/release/2020-06-18
Release/2020 06 18
Diffstat (limited to 'src')
-rw-r--r-- | src/react-javascript.ts | 27 | ||||
-rw-r--r-- | src/react-typescript.ts | 27 | ||||
-rw-r--r-- | src/rules/javascript/default.json | 8 | ||||
-rw-r--r-- | src/rules/jsx-a11y/default.json | 1 | ||||
-rw-r--r-- | src/rules/react-hooks/default.json | 8 | ||||
-rw-r--r-- | src/rules/react/default.json | 16 | ||||
-rw-r--r-- | src/rules/typescript/default.json | 10 |
7 files changed, 88 insertions, 9 deletions
diff --git a/src/react-javascript.ts b/src/react-javascript.ts new file mode 100644 index 0000000..e3bea86 --- /dev/null +++ b/src/react-javascript.ts @@ -0,0 +1,27 @@ +import rJsxA11y from "./rules/jsx-a11y/default.json"; +import rReactHooks from "./rules/react-hooks/default.json"; +import rDefault from "./rules/react/default.json"; + +module.exports = { + "extends": [ + "./javascript", + "plugin:jsx-a11y/recommended", + "plugin:react-hooks/recommended", + "plugin:react/recommended", + ], + "parserOptions": { + ecmaFeatures: { + jsx: true, + }, + }, + "plugins": [ + "jsx-a11y", + "react", + "react-hooks", + ], + "rules": { + ...rDefault, + ...rJsxA11y, + ...rReactHooks, + }, +}; diff --git a/src/react-typescript.ts b/src/react-typescript.ts new file mode 100644 index 0000000..a63614e --- /dev/null +++ b/src/react-typescript.ts @@ -0,0 +1,27 @@ +import rJsxA11y from "./rules/jsx-a11y/default.json"; +import rReactHooks from "./rules/react-hooks/default.json"; +import rDefault from "./rules/react/default.json"; + +module.exports = { + "extends": [ + "./typescript", + "plugin:jsx-a11y/recommended", + "plugin:react-hooks/recommended", + "plugin:react/recommended", + ], + "parserOptions": { + ecmaFeatures: { + jsx: true, + }, + }, + "plugins": [ + "jsx-a11y", + "react", + "react-hooks", + ], + "rules": { + ...rDefault, + ...rJsxA11y, + ...rReactHooks, + }, +}; diff --git a/src/rules/javascript/default.json b/src/rules/javascript/default.json index 34e1d8f..0ec323c 100644 --- a/src/rules/javascript/default.json +++ b/src/rules/javascript/default.json @@ -454,18 +454,18 @@ { "ExportDeclaration": { "consistent": true, - "minProperties": 1, + "minProperties": 5, "multiline": true }, "ImportDeclaration": "never", "ObjectExpression": { "consistent": true, - "minProperties": 1, + "minProperties": 5, "multiline": true }, "ObjectPattern": { "consistent": true, - "minProperties": 1, + "minProperties": 5, "multiline": true } } @@ -638,4 +638,4 @@ "onlyEquality": false } ] -}
\ No newline at end of file +} diff --git a/src/rules/jsx-a11y/default.json b/src/rules/jsx-a11y/default.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/rules/jsx-a11y/default.json @@ -0,0 +1 @@ +{} diff --git a/src/rules/react-hooks/default.json b/src/rules/react-hooks/default.json new file mode 100644 index 0000000..4276d63 --- /dev/null +++ b/src/rules/react-hooks/default.json @@ -0,0 +1,8 @@ +{ + "react-hooks/exhaustive-deps": [ + "warn" + ], + "react-hooks/rules-of-hooks": [ + "error" + ] +}
\ No newline at end of file diff --git a/src/rules/react/default.json b/src/rules/react/default.json new file mode 100644 index 0000000..66a8727 --- /dev/null +++ b/src/rules/react/default.json @@ -0,0 +1,16 @@ +{ + "react/jsx-boolean-value": [ + "error", + "always" + ], + "react/jsx-fragments": [ + "error", + "element" + ], + "react/no-unused-prop-types": [ + "warn", + { + "skipShapeProps": false + } + ] +}
\ No newline at end of file diff --git a/src/rules/typescript/default.json b/src/rules/typescript/default.json index f65f761..b4fcc7a 100644 --- a/src/rules/typescript/default.json +++ b/src/rules/typescript/default.json @@ -133,7 +133,7 @@ "error" ], "@typescript-eslint/no-unsafe-member-access": [ - "error" + "warn" ], "@typescript-eslint/no-unsafe-return": [ "error" @@ -167,7 +167,7 @@ "error" ], "@typescript-eslint/prefer-readonly-parameter-types": [ - "error", + "warn", { "checkParameterProperties": true } @@ -249,10 +249,10 @@ "arrayDestructuring": true, "arrowParameter": true, "memberVariableDeclaration": true, - "objectDestructuring": true, + "objectDestructuring": false, "parameter": true, "propertyDeclaration": true, - "variableDeclaration": true, + "variableDeclaration": false, "variableDeclarationIgnoreFunction": false } ], @@ -289,4 +289,4 @@ "space-before-function-paren": [ "off" ] -}
\ No newline at end of file +} |