diff options
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 | 44 | ||||
-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 | 38 | ||||
-rw-r--r-- | src/typescript.ts | 5 | ||||
-rw-r--r-- | src/vue-javascript.ts | 8 | ||||
-rw-r--r-- | src/vue-typescript.ts | 8 |
10 files changed, 129 insertions, 53 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 3014de5..0ec323c 100644 --- a/src/rules/javascript/default.json +++ b/src/rules/javascript/default.json @@ -2,7 +2,8 @@ "array-callback-return": [ "error", { - "allowImplicit": false + "allowImplicit": false, + "checkForEach": true } ], "arrow-parens": [ @@ -23,9 +24,6 @@ "allowSingleLine": false } ], - "callback-return": [ - "warn" - ], "camelcase": [ "error", { @@ -53,10 +51,7 @@ ], "comma-style": [ "error", - "last", - { - "exceptions": {} - } + "last" ], "curly": [ "error", @@ -80,9 +75,6 @@ "error", "consistent" ], - "handle-callback-err": [ - "error" - ], "id-length": [ "warn", { @@ -114,7 +106,7 @@ "VariableDeclarator": 1, "flatTernaryExpressions": true, "ignoreComments": false, - "ignoredNodes": [], + "offsetTernaryExpressions": true, "outerIIFEBody": 1 } ], @@ -330,9 +322,6 @@ "no-new-func": [ "error" ], - "no-new-require": [ - "error" - ], "no-new-wrappers": [ "error" ], @@ -345,12 +334,6 @@ "props": true } ], - "no-path-concat": [ - "error" - ], - "no-process-env": [ - "off" - ], "no-proto": [ "error" ], @@ -469,9 +452,22 @@ "object-curly-newline": [ "error", { - "consistent": true, - "minProperties": 5, - "multiline": true + "ExportDeclaration": { + "consistent": true, + "minProperties": 5, + "multiline": true + }, + "ImportDeclaration": "never", + "ObjectExpression": { + "consistent": true, + "minProperties": 5, + "multiline": true + }, + "ObjectPattern": { + "consistent": true, + "minProperties": 5, + "multiline": true + } } ], "object-curly-spacing": [ 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 2b45050..b4fcc7a 100644 --- a/src/rules/typescript/default.json +++ b/src/rules/typescript/default.json @@ -16,6 +16,7 @@ "@typescript-eslint/explicit-function-return-type": [ "error", { + "allowConciseArrowFunctionExpressionsStartingWithVoid": false, "allowExpressions": false, "allowHigherOrderFunctions": false, "allowTypedFunctionExpressions": false @@ -61,12 +62,9 @@ "outerIIFEBody": 1 } ], - "@typescript-eslint/interface-name-prefix": [ + "@typescript-eslint/method-signature-style": [ "error", - { - "allowUnderscorePrefix": false, - "prefixWithI": "always" - } + "property" ], "@typescript-eslint/no-base-to-string": [ "error" @@ -125,9 +123,7 @@ "@typescript-eslint/no-unnecessary-condition": [ "error", { - "allowConstantLoopConditions": false, - "checkArrayPredicates": true, - "ignoreRhs": true + "allowConstantLoopConditions": false } ], "@typescript-eslint/no-unnecessary-type-assertion": [ @@ -137,19 +133,11 @@ "error" ], "@typescript-eslint/no-unsafe-member-access": [ - "error" + "warn" ], "@typescript-eslint/no-unsafe-return": [ "error" ], - "@typescript-eslint/no-untyped-public-signature": [ - "warn", - { - "ignoredMethods": [ - "constructor" - ] - } - ], "@typescript-eslint/no-unused-vars": [ "error", { @@ -179,7 +167,7 @@ "error" ], "@typescript-eslint/prefer-readonly-parameter-types": [ - "error", + "warn", { "checkParameterProperties": true } @@ -213,9 +201,13 @@ "@typescript-eslint/strict-boolean-expressions": [ "error", { - "allowNullable": false, - "allowSafe": false, - "ignoreRhs": false + "allowAny": false, + "allowNullableBoolean": false, + "allowNullableNumber": false, + "allowNullableObject": false, + "allowNullableString": false, + "allowNumber": false, + "allowString": false } ], "@typescript-eslint/type-annotation-spacing": [ @@ -257,10 +249,10 @@ "arrayDestructuring": true, "arrowParameter": true, "memberVariableDeclaration": true, - "objectDestructuring": true, + "objectDestructuring": false, "parameter": true, "propertyDeclaration": true, - "variableDeclaration": true, + "variableDeclaration": false, "variableDeclarationIgnoreFunction": false } ], diff --git a/src/typescript.ts b/src/typescript.ts index 6295159..33fb125 100644 --- a/src/typescript.ts +++ b/src/typescript.ts @@ -3,7 +3,6 @@ import rDefault from "./rules/typescript/default.json"; module.exports = { "extends": [ "./javascript", - "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking", "plugin:import/typescript", @@ -15,5 +14,7 @@ module.exports = { "plugins": [ "@typescript-eslint", ], - "rules": { ...rDefault }, + "rules": { + ...rDefault, + }, }; diff --git a/src/vue-javascript.ts b/src/vue-javascript.ts index 39fba7d..5f08b65 100644 --- a/src/vue-javascript.ts +++ b/src/vue-javascript.ts @@ -14,7 +14,9 @@ module.exports = { files: [ "*.vue", ], - rules: { ...rOverrides }, + rules: { + ...rOverrides, + }, }, ], "parser": "vue-eslint-parser", @@ -24,5 +26,7 @@ module.exports = { ], }, "plugins": ["vue"], - "rules": { ...rDefault }, + "rules": { + ...rDefault, + }, }; diff --git a/src/vue-typescript.ts b/src/vue-typescript.ts index 11d4d61..3d96792 100644 --- a/src/vue-typescript.ts +++ b/src/vue-typescript.ts @@ -14,7 +14,9 @@ module.exports = { files: [ "*.vue", ], - rules: { ...rOverrides }, + rules: { + ...rOverrides, + }, }, ], "parser": "vue-eslint-parser", @@ -26,5 +28,7 @@ module.exports = { parser: "@typescript-eslint/parser", }, "plugins": ["vue"], - "rules": { ...rDefault }, + "rules": { + ...rDefault, + }, }; |