|
| 1 | +{ |
| 2 | + "root": true, |
| 3 | + "plugins": [ |
| 4 | + "babel", |
| 5 | + "jest-dom", |
| 6 | + "jest", |
| 7 | + "markdown", |
| 8 | + "prettier", |
| 9 | + "react-hooks", |
| 10 | + "sort-destructure-keys" |
| 11 | + ], |
| 12 | + "extends": [ |
| 13 | + "eslint:recommended", |
| 14 | + "plugin:react/recommended", |
| 15 | + "plugin:prettier/recommended", |
| 16 | + "plugin:jest/all", |
| 17 | + "plugin:jest-dom/recommended" |
| 18 | + ], |
| 19 | + "rules": { |
| 20 | + "array-callback-return": 2, |
| 21 | + "arrow-body-style": 2, |
| 22 | + "comma-dangle": 0, |
| 23 | + "babel/no-invalid-this": 2, |
| 24 | + "default-case": 2, |
| 25 | + "eqeqeq": [2, "smart"], |
| 26 | + "jest/expect-expect": 0, |
| 27 | + "jest/no-conditional-expect": 0, |
| 28 | + "jsx-quotes": ["error", "prefer-single"], |
| 29 | + "linebreak-style": [2, "unix"], |
| 30 | + "no-console": 0, |
| 31 | + "no-mixed-spaces-and-tabs": 1, |
| 32 | + "no-self-compare": 2, |
| 33 | + "no-underscore-dangle": [2, { "allowAfterThis": true }], |
| 34 | + "no-unused-vars": [1, { "ignoreRestSiblings": true }], |
| 35 | + "no-use-before-define": 0, // can throw incorrect errors due to mismatch of @typescript-eslint versions in react-scripts and local package.json |
| 36 | + "@typescript-eslint/no-use-before-define": 0, |
| 37 | + "no-useless-concat": 2, |
| 38 | + "no-var": 2, |
| 39 | + "object-shorthand": 1, |
| 40 | + "prefer-const": 1, |
| 41 | + "react/jsx-sort-props": [ |
| 42 | + "error", |
| 43 | + { |
| 44 | + "callbacksLast": false, |
| 45 | + "ignoreCase": true, |
| 46 | + "noSortAlphabetically": false, |
| 47 | + "reservedFirst": false, |
| 48 | + "shorthandFirst": false, |
| 49 | + "shorthandLast": false |
| 50 | + } |
| 51 | + ], |
| 52 | + "react/prop-types": 0, |
| 53 | + "require-await": 2, |
| 54 | + "semi": [1, "always"], |
| 55 | + "sort-destructure-keys/sort-destructure-keys": [ |
| 56 | + 2, |
| 57 | + { "caseSensitive": false } |
| 58 | + ], |
| 59 | + "sort-imports": [ |
| 60 | + "error", |
| 61 | + { |
| 62 | + "allowSeparatedGroups": true, |
| 63 | + "ignoreCase": true, |
| 64 | + "ignoreDeclarationSort": true, |
| 65 | + "ignoreMemberSort": false, |
| 66 | + "memberSyntaxSortOrder": ["none", "all", "multiple", "single"] |
| 67 | + } |
| 68 | + ], |
| 69 | + "sort-keys": [ |
| 70 | + "error", |
| 71 | + "asc", |
| 72 | + { "caseSensitive": false, "minKeys": 2, "natural": false } |
| 73 | + ], |
| 74 | + "valid-typeof": 2, |
| 75 | + "import/prefer-default-export": 0, |
| 76 | + "import/extensions": [0], |
| 77 | + "max-classes-per-file": 0, |
| 78 | + "camelcase": 0, |
| 79 | + "react-hooks/rules-of-hooks": 1, |
| 80 | + "react-hooks/exhaustive-deps": 0, |
| 81 | + "jest/prefer-inline-snapshots": 0, |
| 82 | + "jest/lowercase-name": 0, |
| 83 | + "jest/prefer-expect-assertions": 0, |
| 84 | + "jest/no-hooks": 0, |
| 85 | + "no-unused-expressions": "off", |
| 86 | + "babel/no-unused-expressions": "error", |
| 87 | + "jest/no-if": "off" |
| 88 | + }, |
| 89 | + "env": { |
| 90 | + "es6": true, |
| 91 | + "browser": true |
| 92 | + }, |
| 93 | + "parser": "babel-eslint", |
| 94 | + "parserOptions": { |
| 95 | + // "allowImportExportEverywhere": true, |
| 96 | + "sourceType": "module", |
| 97 | + "ecmaVersion": 2018, |
| 98 | + "ecmaFeatures": { |
| 99 | + "modules": true |
| 100 | + } |
| 101 | + }, |
| 102 | + "settings": { |
| 103 | + "react": { |
| 104 | + "pragma": "React", |
| 105 | + "version": "detect" |
| 106 | + }, |
| 107 | + "import/resolver": { |
| 108 | + "alias": { |
| 109 | + "map": [["mock-builders", "./src/mock-builders"]], |
| 110 | + "extensions": [".js", ".jsx", ".ts", ".tsx"] |
| 111 | + }, |
| 112 | + "eslint-import-resolver-babel-module": {}, |
| 113 | + "node": { |
| 114 | + "extensions": [".js", ".jsx", ".ts", ".tsx"], |
| 115 | + "paths": ["src"] |
| 116 | + } |
| 117 | + } |
| 118 | + }, |
| 119 | + "overrides": [ |
| 120 | + { |
| 121 | + "files": ["*.md"], |
| 122 | + "rules": { |
| 123 | + "react/jsx-no-undef": 0, |
| 124 | + "react/react-in-jsx-scope": 0, |
| 125 | + "semi": 0, |
| 126 | + "no-undef": 0 |
| 127 | + } |
| 128 | + }, |
| 129 | + { |
| 130 | + "env": { |
| 131 | + "es6": true, |
| 132 | + "browser": true |
| 133 | + }, |
| 134 | + "extends": [ |
| 135 | + "eslint:recommended", |
| 136 | + "plugin:@typescript-eslint/recommended", |
| 137 | + "plugin:jest/recommended", |
| 138 | + "plugin:prettier/recommended", |
| 139 | + "plugin:react/recommended", |
| 140 | + "prettier/@typescript-eslint" |
| 141 | + ], |
| 142 | + "files": ["**/*.ts", "**/*.tsx"], |
| 143 | + "parser": "@typescript-eslint/parser", |
| 144 | + "parserOptions": { |
| 145 | + "ecmaFeatures": { |
| 146 | + "modules": true, |
| 147 | + "jsx": true |
| 148 | + }, |
| 149 | + "ecmaVersion": 2018, |
| 150 | + "sourceType": "module" |
| 151 | + }, |
| 152 | + "plugins": [ |
| 153 | + "@typescript-eslint", |
| 154 | + "babel", |
| 155 | + "markdown", |
| 156 | + "prettier", |
| 157 | + "react", |
| 158 | + "typescript-sort-keys", |
| 159 | + "sort-destructure-keys" |
| 160 | + ], |
| 161 | + "rules": { |
| 162 | + "@typescript-eslint/explicit-module-boundary-types": 0, |
| 163 | + "@typescript-eslint/no-empty-interface": 0, |
| 164 | + "@typescript-eslint/ban-ts-comment": 0, |
| 165 | + "@typescript-eslint/no-unused-vars": 1, |
| 166 | + "@typescript-eslint/no-var-requires": 0, |
| 167 | + "react-hooks/exhaustive-deps": 0, |
| 168 | + "react-native/no-inline-styles": 0, |
| 169 | + "array-callback-return": 2, |
| 170 | + "arrow-body-style": 2, |
| 171 | + "comma-dangle": 0, |
| 172 | + "babel/no-invalid-this": 2, |
| 173 | + "default-case": 2, |
| 174 | + "eqeqeq": [2, "smart"], |
| 175 | + "linebreak-style": [2, "unix"], |
| 176 | + "jsx-quotes": ["error", "prefer-single"], |
| 177 | + "no-console": 0, |
| 178 | + "no-mixed-spaces-and-tabs": 1, |
| 179 | + "no-self-compare": 2, |
| 180 | + "no-shadow": 0, |
| 181 | + "no-underscore-dangle": [2, { "allowAfterThis": true }], |
| 182 | + "no-unused-vars": [1, { "ignoreRestSiblings": true }], |
| 183 | + "no-useless-concat": 2, |
| 184 | + "no-var": 2, |
| 185 | + "object-shorthand": 1, |
| 186 | + "prefer-const": 1, |
| 187 | + "react/jsx-sort-props": [ |
| 188 | + "error", |
| 189 | + { |
| 190 | + "callbacksLast": false, |
| 191 | + "ignoreCase": true, |
| 192 | + "noSortAlphabetically": false, |
| 193 | + "reservedFirst": false, |
| 194 | + "shorthandFirst": false, |
| 195 | + "shorthandLast": false |
| 196 | + } |
| 197 | + ], |
| 198 | + "react/prop-types": 0, |
| 199 | + "require-await": 2, |
| 200 | + "semi": [1, "always"], |
| 201 | + "sort-destructure-keys/sort-destructure-keys": [ |
| 202 | + 2, |
| 203 | + { "caseSensitive": false } |
| 204 | + ], |
| 205 | + "sort-imports": [ |
| 206 | + "error", |
| 207 | + { |
| 208 | + "allowSeparatedGroups": true, |
| 209 | + "ignoreCase": true, |
| 210 | + "ignoreDeclarationSort": true, |
| 211 | + "ignoreMemberSort": false, |
| 212 | + "memberSyntaxSortOrder": ["none", "all", "multiple", "single"] |
| 213 | + } |
| 214 | + ], |
| 215 | + "sort-keys": [ |
| 216 | + "error", |
| 217 | + "asc", |
| 218 | + { "caseSensitive": false, "minKeys": 2, "natural": false } |
| 219 | + ], |
| 220 | + "typescript-sort-keys/interface": [ |
| 221 | + "error", |
| 222 | + "asc", |
| 223 | + { "caseSensitive": false, "natural": true, "requiredFirst": true } |
| 224 | + ], |
| 225 | + "typescript-sort-keys/string-enum": [ |
| 226 | + "error", |
| 227 | + "asc", |
| 228 | + { "caseSensitive": false, "natural": true } |
| 229 | + ], |
| 230 | + "valid-typeof": 2 |
| 231 | + } |
| 232 | + } |
| 233 | + ] |
| 234 | +} |
0 commit comments