|
| 1 | +{ |
| 2 | + "parser": "@typescript-eslint/parser", |
| 3 | + "plugins": ["@typescript-eslint", "react", "jest", "jsdoc", "import"], |
| 4 | + "extends": [ |
| 5 | + "eslint:recommended", |
| 6 | + "plugin:react/all", |
| 7 | + "plugin:react-hooks/recommended", |
| 8 | + "plugin:jest/recommended", |
| 9 | + "plugin:@typescript-eslint/eslint-recommended", |
| 10 | + "plugin:@typescript-eslint/recommended", |
| 11 | + "plugin:import/recommended", |
| 12 | + "prettier" |
| 13 | + ], |
| 14 | + "env": { |
| 15 | + "browser": true, |
| 16 | + "es6": true, |
| 17 | + "node": true, |
| 18 | + "jest/globals": true |
| 19 | + }, |
| 20 | + "globals": { |
| 21 | + "page": true, |
| 22 | + "browser": true, |
| 23 | + "context": true, |
| 24 | + "jestPuppeteer": true |
| 25 | + }, |
| 26 | + "parserOptions": { |
| 27 | + "ecmaVersion": 7, |
| 28 | + "ecmaFeatures": { |
| 29 | + "experimentalObjectRestSpread": true, |
| 30 | + "globalReturn": true, |
| 31 | + "jsx": true |
| 32 | + }, |
| 33 | + "sourceType": "module" |
| 34 | + }, |
| 35 | + "settings": { |
| 36 | + "react": {"version": "16.12.0"}, |
| 37 | + "import/resolver": { |
| 38 | + "node": { |
| 39 | + "extensions": [".js", ".jsx", ".ts", ".tsx"] |
| 40 | + } |
| 41 | + } |
| 42 | + }, |
| 43 | + "rules": { |
| 44 | + "@typescript-eslint/no-explicit-any": 0, |
| 45 | + "@typescript-eslint/no-var-requires": 0, |
| 46 | + "@typescript-eslint/no-unused-vars": [ |
| 47 | + 2, |
| 48 | + {"argsIgnorePattern": "^_.*", "varsIgnorePattern": "^_.*"} |
| 49 | + ], |
| 50 | + "max-len": [ |
| 51 | + 2, |
| 52 | + { |
| 53 | + "code": 80, |
| 54 | + "ignorePattern": "^(\\s+\\* )?(imports?|exports?|\\} from|(.+ as .+))\\W.*", |
| 55 | + "ignoreUrls": true |
| 56 | + } |
| 57 | + ], |
| 58 | + "no-var": 2, |
| 59 | + "no-console": 2, |
| 60 | + "object-curly-spacing": [2, "never"], |
| 61 | + "comma-dangle": [ |
| 62 | + 2, |
| 63 | + { |
| 64 | + "arrays": "always-multiline", |
| 65 | + "objects": "always-multiline", |
| 66 | + "imports": "always-multiline", |
| 67 | + "exports": "always-multiline", |
| 68 | + "functions": "always-multiline" |
| 69 | + } |
| 70 | + ], |
| 71 | + "indent": 0, |
| 72 | + "no-empty": [2, {"allowEmptyCatch": true}], |
| 73 | + "linebreak-style": [2, "unix"], |
| 74 | + "space-infix-ops": 2, |
| 75 | + "quotes": [2, "single", {"allowTemplateLiterals": true}], |
| 76 | + "semi": [2, "always"], |
| 77 | + "sort-keys": 0, |
| 78 | + "sort-imports": 2, |
| 79 | + "jest/expect-expect": [2, {"assertFunctionNames": ["expect*"]}], |
| 80 | + "no-multiple-empty-lines": [2, {"max": 1}], |
| 81 | + "react/function-component-definition": [ |
| 82 | + 2, |
| 83 | + { |
| 84 | + "namedComponents": "arrow-function", |
| 85 | + "unnamedComponents": "arrow-function" |
| 86 | + } |
| 87 | + ], |
| 88 | + "react/no-multi-comp": [2, {"ignoreStateless": true}], |
| 89 | + "react/no-find-dom-node": 0, |
| 90 | + "react/no-set-state": 0, |
| 91 | + "react/no-unsafe": 2, |
| 92 | + "jsx-quotes": [2, "prefer-double"], |
| 93 | + "react-hooks/exhaustive-deps": 2, |
| 94 | + "react-hooks/rules-of-hooks": 2, |
| 95 | + "react/destructuring-assignment": 0, |
| 96 | + "react/display-name": 0, |
| 97 | + "react/jsx-boolean-value": 0, |
| 98 | + "react/jsx-filename-extension": 0, |
| 99 | + "react/jsx-first-prop-new-line": [2, "multiline"], |
| 100 | + "react/jsx-handler-names": [ |
| 101 | + 2, |
| 102 | + {"eventHandlerPrefix": "_handle", "eventHandlerPropPrefix": "on"} |
| 103 | + ], |
| 104 | + "react/jsx-indent": 0, |
| 105 | + "react/jsx-indent-props": [2, 2], |
| 106 | + "react/jsx-max-depth": [2, {"max": 5}], |
| 107 | + "react/jsx-max-props-per-line": [2, {"maximum": 1, "when": "multiline"}], |
| 108 | + "react/jsx-newline": 0, |
| 109 | + "react/jsx-no-literals": 0, |
| 110 | + "react/jsx-one-expression-per-line": 0, |
| 111 | + "react/jsx-props-no-spreading": 0, |
| 112 | + "react/jsx-sort-props": 0, |
| 113 | + "react/require-default-props": 0, |
| 114 | + "react/sort-comp": 0, |
| 115 | + "react/forbid-component-props": 0, |
| 116 | + "react/button-has-type": 0 |
| 117 | + }, |
| 118 | + "overrides": [ |
| 119 | + { |
| 120 | + "files": ["src/@types/**/*.js"], |
| 121 | + "extends": ["plugin:jsdoc/recommended"], |
| 122 | + "settings": {"jsdoc": {"mode": "typescript", "contexts": ["any"]}}, |
| 123 | + "rules": { |
| 124 | + "jsdoc/check-tag-names": [ |
| 125 | + 2, |
| 126 | + {"definedTags": ["category", "packageDocumentation"]} |
| 127 | + ], |
| 128 | + "jsdoc/no-restricted-syntax": [ |
| 129 | + 2, |
| 130 | + { |
| 131 | + "contexts": [ |
| 132 | + { |
| 133 | + "comment": "JsdocBlock:not(:has(JsdocTag[tag=/category|packageDocumentation/]))", |
| 134 | + "message": "Every non-module block requires a @category tag" |
| 135 | + }, |
| 136 | + { |
| 137 | + "comment": "JsdocBlock:not(:has(JsdocTag[tag=since]))", |
| 138 | + "message": "Every block requires a @since tag" |
| 139 | + }, |
| 140 | + { |
| 141 | + "comment": "JsdocBlock:has(JsdocTag[tag=since] ~ JsdocTag[tag=since])", |
| 142 | + "message": "Every block must have only one @since tag" |
| 143 | + } |
| 144 | + ] |
| 145 | + } |
| 146 | + ], |
| 147 | + "jsdoc/require-jsdoc": [2], |
| 148 | + "jsdoc/require-description": [2], |
| 149 | + "jsdoc/require-description-complete-sentence": [2], |
| 150 | + "jsdoc/require-returns-description": [2], |
| 151 | + "jsdoc/no-blank-blocks": [2], |
| 152 | + "jsdoc/require-param-type": [0], |
| 153 | + "jsdoc/require-returns-type": [0], |
| 154 | + "jsdoc/check-param-names": [0] |
| 155 | + } |
| 156 | + } |
| 157 | + ] |
| 158 | +} |
0 commit comments