|
| 1 | +{ |
| 2 | + "ignorePatterns": ["node_modules/"], |
| 3 | + "env": { |
| 4 | + "es6": true |
| 5 | + }, |
| 6 | + "extends": ["typestrict"], |
| 7 | + "plugins": ["no-only-tests", "simple-import-sort", "import", "react", "unused-imports"], |
| 8 | + "parser": "@typescript-eslint/parser", |
| 9 | + "parserOptions": { |
| 10 | + "project": "./tsconfig.json", |
| 11 | + "sourceType": "module" |
| 12 | + }, |
| 13 | + "rules": { |
| 14 | + "unused-imports/no-unused-imports-ts": "error", |
| 15 | + "react/jsx-uses-react": "error", |
| 16 | + "react/jsx-uses-vars": "error", |
| 17 | + "import/no-default-export": "error", |
| 18 | + "simple-import-sort/sort": [ |
| 19 | + "error", |
| 20 | + { |
| 21 | + "groups": [ |
| 22 | + // Side effect imports. |
| 23 | + ["^\\u0000"], |
| 24 | + // Packages. |
| 25 | + // Things that start with a letter (or digit or underscore), or `@` followed by a letter. |
| 26 | + ["^@?\\w"], |
| 27 | + // Absolute imports and other imports such as Vue-style `@/foo`. |
| 28 | + // Anything that does not start with a dot. |
| 29 | + ["^[^.]"], |
| 30 | + // Relative imports. |
| 31 | + // Anything that starts with a dot. |
| 32 | + // anything that stars with /src (out custom path) |
| 33 | + ["(^\\.|src/)"] |
| 34 | + ] |
| 35 | + } |
| 36 | + ], |
| 37 | + "func-style": ["error", "declaration"], |
| 38 | + "@typescript-eslint/no-use-before-define": "off", |
| 39 | + "@typescript-eslint/no-useless-constructor": "error", |
| 40 | + "accessor-pairs": "error", |
| 41 | + "constructor-super": "error", |
| 42 | + "eqeqeq": [ |
| 43 | + "error", |
| 44 | + "always", |
| 45 | + { |
| 46 | + "null": "ignore" |
| 47 | + } |
| 48 | + ], |
| 49 | + "handle-callback-err": ["error", "^(err|error)$"], |
| 50 | + "new-parens": "error", |
| 51 | + "no-array-constructor": "error", |
| 52 | + "no-async-promise-executor": "error", |
| 53 | + "no-caller": "error", |
| 54 | + "no-class-assign": "error", |
| 55 | + "no-compare-neg-zero": "error", |
| 56 | + "no-cond-assign": "error", |
| 57 | + "no-const-assign": "error", |
| 58 | + "no-constant-condition": [ |
| 59 | + "error", |
| 60 | + { |
| 61 | + "checkLoops": false |
| 62 | + } |
| 63 | + ], |
| 64 | + "no-control-regex": "error", |
| 65 | + "no-debugger": "error", |
| 66 | + "no-delete-var": "error", |
| 67 | + "no-dupe-args": "error", |
| 68 | + "no-dupe-keys": "error", |
| 69 | + "no-duplicate-case": "error", |
| 70 | + "no-empty-character-class": "error", |
| 71 | + "no-empty-pattern": "error", |
| 72 | + "no-eval": "error", |
| 73 | + "no-ex-assign": "error", |
| 74 | + "no-extend-native": "error", |
| 75 | + "no-extra-bind": "error", |
| 76 | + "no-extra-boolean-cast": "error", |
| 77 | + "no-fallthrough": "error", |
| 78 | + "no-floating-decimal": "error", |
| 79 | + "no-func-assign": "error", |
| 80 | + "no-global-assign": "error", |
| 81 | + "no-implied-eval": "error", |
| 82 | + "no-inner-declarations": ["error", "functions"], |
| 83 | + "no-invalid-regexp": "error", |
| 84 | + "no-iterator": "error", |
| 85 | + "no-label-var": "error", |
| 86 | + "no-labels": [ |
| 87 | + "error", |
| 88 | + { |
| 89 | + "allowLoop": false, |
| 90 | + "allowSwitch": false |
| 91 | + } |
| 92 | + ], |
| 93 | + "no-lone-blocks": "error", |
| 94 | + "no-misleading-character-class": "error", |
| 95 | + "no-multi-str": "error", |
| 96 | + "no-multiple-empty-lines": [ |
| 97 | + "error", |
| 98 | + { |
| 99 | + "max": 1, |
| 100 | + "maxEOF": 0 |
| 101 | + } |
| 102 | + ], |
| 103 | + "no-negated-in-lhs": "error", |
| 104 | + "no-new": "error", |
| 105 | + "no-new-func": "error", |
| 106 | + "no-new-object": "error", |
| 107 | + "no-new-require": "error", |
| 108 | + "no-new-symbol": "error", |
| 109 | + "no-new-wrappers": "error", |
| 110 | + "no-obj-calls": "error", |
| 111 | + "no-octal": "error", |
| 112 | + "no-octal-escape": "error", |
| 113 | + "no-path-concat": "error", |
| 114 | + "no-proto": "error", |
| 115 | + "no-redeclare": [ |
| 116 | + "error", |
| 117 | + { |
| 118 | + "builtinGlobals": false |
| 119 | + } |
| 120 | + ], |
| 121 | + "no-invalid-this": "off", |
| 122 | + "no-use-before-define": "off", |
| 123 | + "no-regex-spaces": "error", |
| 124 | + "no-return-assign": ["error", "except-parens"], |
| 125 | + "no-self-assign": "error", |
| 126 | + "no-self-compare": "error", |
| 127 | + "no-sequences": "error", |
| 128 | + "no-shadow-restricted-names": "error", |
| 129 | + "no-sparse-arrays": "error", |
| 130 | + "no-tabs": "error", |
| 131 | + "no-this-before-super": "error", |
| 132 | + "no-throw-literal": "error", |
| 133 | + "no-unexpected-multiline": "error", |
| 134 | + "no-unmodified-loop-condition": "error", |
| 135 | + "no-unneeded-ternary": [ |
| 136 | + "error", |
| 137 | + { |
| 138 | + "defaultAssignment": false |
| 139 | + } |
| 140 | + ], |
| 141 | + "no-unreachable": "error", |
| 142 | + "no-unsafe-finally": "error", |
| 143 | + "no-unsafe-negation": "error", |
| 144 | + "no-restricted-imports": ["error"], |
| 145 | + "no-useless-call": "error", |
| 146 | + "no-useless-catch": "error", |
| 147 | + "no-useless-computed-key": "error", |
| 148 | + "no-useless-escape": "error", |
| 149 | + "no-useless-rename": "error", |
| 150 | + "no-useless-return": "error", |
| 151 | + "no-with": "error", |
| 152 | + "object-curly-spacing": ["error", "always"], |
| 153 | + "object-property-newline": [ |
| 154 | + "error", |
| 155 | + { |
| 156 | + "allowMultiplePropertiesPerLine": true |
| 157 | + } |
| 158 | + ], |
| 159 | + "one-var": [ |
| 160 | + "error", |
| 161 | + { |
| 162 | + "initialized": "never" |
| 163 | + } |
| 164 | + ], |
| 165 | + "prefer-const": [ |
| 166 | + "error", |
| 167 | + { |
| 168 | + "destructuring": "all" |
| 169 | + } |
| 170 | + ], |
| 171 | + "prefer-promise-reject-errors": "error", |
| 172 | + "symbol-description": "error", |
| 173 | + "unicode-bom": ["error", "never"], |
| 174 | + "use-isnan": "error", |
| 175 | + "valid-typeof": [ |
| 176 | + "error", |
| 177 | + { |
| 178 | + "requireStringLiterals": true |
| 179 | + } |
| 180 | + ], |
| 181 | + "wrap-iife": [ |
| 182 | + "error", |
| 183 | + "any", |
| 184 | + { |
| 185 | + "functionPrototypeMethods": true |
| 186 | + } |
| 187 | + ], |
| 188 | + "yoda": ["error", "never"], |
| 189 | + "no-only-tests/no-only-tests": "error" |
| 190 | + }, |
| 191 | + "overrides": [ |
| 192 | + { |
| 193 | + "files": ["pages/**/*.{ts,tsx}"], |
| 194 | + "rules": { |
| 195 | + "import/no-default-export": "off" |
| 196 | + } |
| 197 | + }, |
| 198 | + { |
| 199 | + "files": ["**/*.tsx"], |
| 200 | + "rules": { |
| 201 | + "func-style": "off" |
| 202 | + } |
| 203 | + } |
| 204 | + ] |
| 205 | +} |
0 commit comments