|
16 | 16 | "plugin:@typescript-eslint/stylistic"
|
17 | 17 | ],
|
18 | 18 | "plugins": [
|
19 |
| - "@typescript-eslint", "no-null", "eslint-plugin-local", "simple-import-sort" |
| 19 | + "@typescript-eslint", |
| 20 | + "no-null", |
| 21 | + "eslint-plugin-local", |
| 22 | + "simple-import-sort" |
20 | 23 | ],
|
21 | 24 | "ignorePatterns": [
|
22 | 25 | "**/node_modules/**",
|
|
30 | 33 | "/coverage/**"
|
31 | 34 | ],
|
32 | 35 | "rules": {
|
33 |
| - "max-statements-per-line": ["error", { "max": 1 }], |
34 |
| - "simple-import-sort/imports": "error", |
35 |
| - "simple-import-sort/exports": "error", |
| 36 | + // eslint |
| 37 | + "dot-notation": "error", |
| 38 | + "eqeqeq": "error", |
| 39 | + "no-caller": "error", |
| 40 | + "no-constant-condition": ["error", { "checkLoops": false }], |
| 41 | + "no-eval": "error", |
| 42 | + "no-extra-bind": "error", |
| 43 | + "no-new-func": "error", |
| 44 | + "no-new-wrappers": "error", |
| 45 | + "no-return-await": "error", |
| 46 | + "no-restricted-globals": [ |
| 47 | + "error", |
| 48 | + { "name": "setTimeout" }, |
| 49 | + { "name": "clearTimeout" }, |
| 50 | + { "name": "setInterval" }, |
| 51 | + { "name": "clearInterval" }, |
| 52 | + { "name": "setImmediate" }, |
| 53 | + { "name": "clearImmediate" } |
| 54 | + ], |
| 55 | + "no-template-curly-in-string": "error", |
| 56 | + "no-throw-literal": "error", |
| 57 | + "no-undef-init": "error", |
| 58 | + "no-var": "error", |
| 59 | + "object-shorthand": "error", |
| 60 | + "prefer-const": "error", |
| 61 | + "prefer-object-spread": "error", |
| 62 | + "unicode-bom": ["error", "never"], |
36 | 63 |
|
| 64 | + // Enabled in eslint:recommended, but not applicable here |
| 65 | + "no-extra-boolean-cast": "off", |
| 66 | + "no-case-declarations": "off", |
| 67 | + "no-cond-assign": "off", |
| 68 | + "no-control-regex": "off", |
| 69 | + "no-inner-declarations": "off", |
| 70 | + |
| 71 | + // @typescript-eslint/eslint-plugin |
37 | 72 | "@typescript-eslint/naming-convention": [
|
38 | 73 | "error",
|
39 | 74 | { "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
|
|
47 | 82 | { "selector": "property", "format": null }
|
48 | 83 | ],
|
49 | 84 |
|
50 |
| - "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }], |
51 |
| - "@typescript-eslint/no-extra-semi": "error", |
52 |
| - "@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }], |
53 |
| - "@typescript-eslint/semi": "error", |
54 |
| - "@typescript-eslint/space-before-function-paren": ["error", { |
55 |
| - "asyncArrow": "always", |
56 |
| - "anonymous": "always", |
57 |
| - "named": "never" |
58 |
| - }], |
59 |
| - |
60 |
| - // Todo: For each of these, investigate whether we want to enable them ✨ |
61 |
| - "@typescript-eslint/ban-types": "off", |
62 |
| - "no-case-declarations": "off", |
63 |
| - "no-cond-assign": "off", |
64 |
| - "no-constant-condition": "off", |
65 |
| - "no-control-regex": "off", |
66 |
| - "no-debugger": "off", |
67 |
| - "no-extra-boolean-cast": "off", |
68 |
| - "no-inner-declarations": "off", |
69 |
| - "no-useless-escape": "off", |
70 |
| - "prefer-rest-params": "off", |
71 |
| - "prefer-spread": "off", |
72 |
| - "@typescript-eslint/no-empty-function": "off", |
73 |
| - "@typescript-eslint/no-empty-interface": "off", |
74 |
| - "@typescript-eslint/no-explicit-any": "off", |
75 |
| - "@typescript-eslint/no-unused-vars": "off", |
76 |
| - |
77 |
| - // Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820 |
78 |
| - "@typescript-eslint/prefer-optional-chain": "off", |
79 |
| - |
80 | 85 | // Rules enabled in typescript-eslint configs that are not applicable here
|
81 | 86 | "@typescript-eslint/ban-ts-comment": "off",
|
82 | 87 | "@typescript-eslint/class-literal-property-style": "off",
|
83 | 88 | "@typescript-eslint/consistent-indexed-object-style": "off",
|
84 | 89 | "@typescript-eslint/no-duplicate-enum-values": "off",
|
| 90 | + "@typescript-eslint/no-empty-function": "off", |
85 | 91 | "@typescript-eslint/no-namespace": "off",
|
86 | 92 | "@typescript-eslint/no-non-null-asserted-optional-chain": "off",
|
87 | 93 | "@typescript-eslint/no-var-requires": "off",
|
| 94 | + "@typescript-eslint/no-empty-interface": "off", |
| 95 | + "@typescript-eslint/no-explicit-any": "off", |
| 96 | + "@typescript-eslint/ban-types": [ |
| 97 | + "error", |
| 98 | + { |
| 99 | + "extendDefaults": true, |
| 100 | + "types": { |
| 101 | + // This is theoretically good, but ts-eslint appears to mistake our declaration of Symbol for the global Symbol type. |
| 102 | + // See: https://github.com/typescript-eslint/typescript-eslint/issues/7306 |
| 103 | + "Symbol": false, |
| 104 | + "{}": false // {} is a totally useful and valid type. |
| 105 | + } |
| 106 | + } |
| 107 | + ], |
| 108 | + |
| 109 | + // Todo: For each of these, investigate whether we want to enable them ✨ |
| 110 | + "@typescript-eslint/no-unused-vars": "off", |
| 111 | + |
| 112 | + // Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820 |
| 113 | + "@typescript-eslint/prefer-optional-chain": "off", |
88 | 114 |
|
89 | 115 | // scripts/eslint/rules
|
90 |
| - "local/object-literal-surrounding-space": "error", |
91 |
| - "local/no-type-assertion-whitespace": "error", |
92 |
| - "local/type-operator-spacing": "error", |
93 |
| - "local/only-arrow-functions": ["error", { |
94 |
| - "allowNamedFunctions": true , |
95 |
| - "allowDeclarations": true |
96 |
| - }], |
97 |
| - "local/no-double-space": "error", |
| 116 | + "local/only-arrow-functions": [ |
| 117 | + "error", |
| 118 | + { |
| 119 | + "allowNamedFunctions": true, |
| 120 | + "allowDeclarations": true |
| 121 | + } |
| 122 | + ], |
98 | 123 | "local/argument-trivia": "error",
|
99 | 124 | "local/no-in-operator": "error",
|
100 |
| - "local/simple-indent": "error", |
101 | 125 | "local/debug-assert": "error",
|
102 | 126 | "local/no-keywords": "error",
|
103 | 127 | "local/jsdoc-format": "error",
|
104 | 128 |
|
105 | 129 | // eslint-plugin-no-null
|
106 | 130 | "no-null/no-null": "error",
|
107 | 131 |
|
108 |
| - // eslint |
109 |
| - "curly": ["error", "multi-line"], |
110 |
| - "dot-notation": "error", |
111 |
| - "eqeqeq": "error", |
112 |
| - "linebreak-style": ["error", "windows"], |
113 |
| - "new-parens": "error", |
114 |
| - "no-caller": "error", |
115 |
| - "no-eval": "error", |
116 |
| - "no-extra-bind": "error", |
117 |
| - "no-new-func": "error", |
118 |
| - "no-new-wrappers": "error", |
119 |
| - "no-return-await": "error", |
120 |
| - "no-restricted-globals": ["error", |
121 |
| - { "name": "setTimeout" }, |
122 |
| - { "name": "clearTimeout" }, |
123 |
| - { "name": "setInterval" }, |
124 |
| - { "name": "clearInterval" }, |
125 |
| - { "name": "setImmediate" }, |
126 |
| - { "name": "clearImmediate" } |
127 |
| - ], |
128 |
| - "no-template-curly-in-string": "error", |
129 |
| - "no-throw-literal": "error", |
130 |
| - "no-trailing-spaces": "error", |
131 |
| - "no-undef-init": "error", |
132 |
| - "no-var": "error", |
133 |
| - "object-shorthand": "error", |
134 |
| - "prefer-const": "error", |
135 |
| - "prefer-object-spread": "error", |
136 |
| - "quote-props": ["error", "consistent-as-needed"], |
137 |
| - "space-in-parens": "error", |
138 |
| - "unicode-bom": ["error", "never"] |
| 132 | + // eslint-plugin-simple-import-sort |
| 133 | + "simple-import-sort/imports": "error", |
| 134 | + "simple-import-sort/exports": "error" |
139 | 135 | },
|
140 | 136 | "overrides": [
|
141 | 137 | // By default, the ESLint CLI only looks at .js files. But, it will also look at
|
142 | 138 | // any files which are referenced in an override config. Most users of typescript-eslint
|
143 |
| - // get this behavior by default by extending a recommended typescript-eslint config, which |
| 139 | + // get this behavior by default by extending a recommended typescript-eslint config, which |
144 | 140 | // just so happens to override some core ESLint rules. We don't extend from any config, so
|
145 | 141 | // explicitly reference TS files here so the CLI picks them up.
|
146 | 142 | //
|
|
153 | 149 | "files": ["*.mjs", "*.mts"],
|
154 | 150 | "rules": {
|
155 | 151 | // These globals don't exist outside of CJS files.
|
156 |
| - "no-restricted-globals": ["error", |
| 152 | + "no-restricted-globals": [ |
| 153 | + "error", |
157 | 154 | { "name": "__filename" },
|
158 | 155 | { "name": "__dirname" },
|
159 | 156 | { "name": "require" },
|
|
0 commit comments