|
| 1 | +{ |
| 2 | + "extends": [ |
| 3 | + "airbnb-base", |
| 4 | + "plugin:@typescript-eslint/recommended", |
| 5 | + "plugin:prettier/recommended", |
| 6 | + "prettier" |
| 7 | + ], |
| 8 | + "plugins": [ |
| 9 | + "filenames", |
| 10 | + "functional" |
| 11 | + ], |
| 12 | + "parser": "@typescript-eslint/parser", |
| 13 | + "globals": { |
| 14 | + "document": false, |
| 15 | + "window": false, |
| 16 | + "Event": false, |
| 17 | + "CustomEvent": false, |
| 18 | + "FormData": false, |
| 19 | + "fetch": false, |
| 20 | + "DOMParser": false, |
| 21 | + "FileReader": false, |
| 22 | + "requestAnimationFrame": false, |
| 23 | + "Element": false |
| 24 | + }, |
| 25 | + "rules": { |
| 26 | + "curly": ["error", "all"], |
| 27 | + "@typescript-eslint/explicit-member-accessibility": ["error", |
| 28 | + { "accessibility": "no-public" } |
| 29 | + ], |
| 30 | + "no-new": 0, |
| 31 | + "no-unused-vars": "off", |
| 32 | + "@typescript-eslint/no-unused-vars": ["error", { |
| 33 | + "vars": "all", |
| 34 | + "args": "after-used", |
| 35 | + "ignoreRestSiblings": false |
| 36 | + }], |
| 37 | + "no-underscore-dangle": "off", |
| 38 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 39 | + "@typescript-eslint/no-non-null-assertion": 2, |
| 40 | + "no-restricted-syntax": [ |
| 41 | + "error", |
| 42 | + { |
| 43 | + "selector": "ForInStatement", |
| 44 | + "message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array." |
| 45 | + }, |
| 46 | + { |
| 47 | + "selector": "LabeledStatement", |
| 48 | + "message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand." |
| 49 | + }, |
| 50 | + { |
| 51 | + "selector": "WithStatement", |
| 52 | + "message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize." |
| 53 | + }, |
| 54 | + { |
| 55 | + "selector": "TSEnumDeclaration", |
| 56 | + "message": "Don't declare enums, use a discriminated union instead: https://github.com/typescript-eslint/typescript-eslint/issues/561#issue-448808322" |
| 57 | + } |
| 58 | + ], |
| 59 | + "filenames/match-exported": 2, |
| 60 | + "no-use-before-define": "off", |
| 61 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 62 | + "no-unused-expressions": "off", |
| 63 | + "@typescript-eslint/no-unused-expressions": ["error"], |
| 64 | + "@typescript-eslint/naming-convention": [ |
| 65 | + "error", |
| 66 | + { |
| 67 | + "selector": "variableLike", |
| 68 | + "format": ["camelCase", "PascalCase"] |
| 69 | + }, |
| 70 | + { |
| 71 | + "selector": "class", |
| 72 | + "format": ["PascalCase"] |
| 73 | + } |
| 74 | + ], |
| 75 | + "@typescript-eslint/consistent-type-assertions": [ |
| 76 | + "error", |
| 77 | + { "assertionStyle": "never" } |
| 78 | + ], |
| 79 | + "prettier/prettier": ["error", { |
| 80 | + "printWidth": 140, |
| 81 | + "endOfLine": "auto" |
| 82 | + }], |
| 83 | + "@typescript-eslint/no-explicit-any": "error", |
| 84 | + "import/extensions": [ |
| 85 | + "error", |
| 86 | + "ignorePackages", |
| 87 | + { |
| 88 | + "js": "never", |
| 89 | + "jsx": "never", |
| 90 | + "ts": "never", |
| 91 | + "tsx": "never" |
| 92 | + } |
| 93 | + ], |
| 94 | + "import/no-extraneous-dependencies": ["error", { |
| 95 | + "devDependencies": [ |
| 96 | + "**/__mocks__/**/*", |
| 97 | + "gulpfile.ts", |
| 98 | + "**/*.test.ts", |
| 99 | + "**/*.test.tsx", |
| 100 | + "webpack.config.js" |
| 101 | + ] |
| 102 | + } |
| 103 | + ], |
| 104 | + "class-methods-use-this": "off" |
| 105 | + }, |
| 106 | + "ignorePatterns": ["output", "dist", "node_modules"], |
| 107 | + "settings": { |
| 108 | + "import/resolver": { |
| 109 | + "node": { |
| 110 | + "extensions": [".js", ".jsx", ".ts", ".tsx"] |
| 111 | + }, |
| 112 | + "alias": { |
| 113 | + "map": [ |
| 114 | + ["~", "./src"] |
| 115 | + ], |
| 116 | + "extensions": [".ts", ".js", ".jsx", ".json", ".tsx"] |
| 117 | + } |
| 118 | + } |
| 119 | + }, |
| 120 | + "overrides": [ |
| 121 | + { |
| 122 | + "files": ["*.tsx", "*.ts"], |
| 123 | + "rules": { |
| 124 | + "react/prop-types": "off", |
| 125 | + "import/no-unresolved": [2, { |
| 126 | + "ignore": ["StoreTypes", "react-hook-form"] |
| 127 | + }], |
| 128 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 129 | + "no-redeclare": "off", |
| 130 | + "no-shadow": "off", |
| 131 | + "no-unused-expressions": "off", |
| 132 | + "@typescript-eslint/no-unused-expressions": ["error"] |
| 133 | + } |
| 134 | + }, |
| 135 | + { |
| 136 | + "files": ["**/*test.ts", "*.test.tsx", "*.test.jsx", "*.test.js", "**/__mocks__/**/*", "**/__tests__/**/*"], |
| 137 | + "rules": { |
| 138 | + "max-classes-per-file": "off", |
| 139 | + "filenames/match-exported": "off" |
| 140 | + }, |
| 141 | + "globals": { |
| 142 | + "expect": false, |
| 143 | + "test": false, |
| 144 | + "jest": false, |
| 145 | + "jsdom": false, |
| 146 | + "describe": false, |
| 147 | + "it": false, |
| 148 | + "beforeEach": false, |
| 149 | + "afterEach": false, |
| 150 | + "afterAll": false |
| 151 | + } |
| 152 | + }, |
| 153 | + { |
| 154 | + "files": ["*.js", "*.ts"], |
| 155 | + "rules": { |
| 156 | + "linebreak-style": 0 |
| 157 | + } |
| 158 | + }, |
| 159 | + { |
| 160 | + "files": ["*.js", "*.jsx"], |
| 161 | + "rules": { |
| 162 | + "@typescript-eslint/no-var-requires": "off" |
| 163 | + } |
| 164 | + } |
| 165 | + ] |
| 166 | +} |
0 commit comments