@paratco/eslint-config 0.3.3 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,13 +5,43 @@ Paratco ESLint configs
5
5
  - Typescript
6
6
  - React (optional)
7
7
 
8
- Usage (Flat config):
8
+ ### Installation
9
9
 
10
+ NPM:
11
+ ```bash
12
+ npm install --save-dev @paratco/eslint-config eslint prettier typescript-eslint
13
+ ```
14
+
15
+ Yarn:
16
+ ```bash
17
+ yarn add -D @paratco/eslint-config eslint prettier typescript-eslint
18
+ ```
19
+
20
+ ### Usage (Flat config):
21
+
22
+ Node.JS:
23
+ ```javascript
24
+ import paratcoEslintConfig from "@paratco/eslint-config";
25
+
26
+ export default [
27
+ ...paratcoEslintConfig.node,
28
+ ];
29
+ ```
30
+
31
+ React:
10
32
  ```javascript
11
33
  import paratcoEslintConfig from "@paratco/eslint-config";
12
34
 
13
35
  export default [
14
- ...paratcoEslintConfig.base,
15
36
  ...paratcoEslintConfig.react,
16
37
  ];
17
38
  ```
39
+
40
+ Base (JS + TS rules):
41
+ ```javascript
42
+ import paratcoEslintConfig from "@paratco/eslint-config";
43
+
44
+ export default [
45
+ ...paratcoEslintConfig.base,
46
+ ];
47
+ ```
package/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import baseConfig from "./src/configs/base.js";
2
2
  import reactConfig from "./src/configs/react.js";
3
+ import nodeConfig from "./src/configs/node.js";
3
4
 
4
5
  export default {
5
6
  base: baseConfig,
6
- react: reactConfig
7
+ react: reactConfig,
8
+ node: nodeConfig
7
9
  };
package/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "name": "@paratco/eslint-config",
3
- "version": "0.3.3",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "author": "Paratco",
7
7
  "license": "ISC",
8
8
  "description": "Paratco ESLint Config",
9
+ "repository": "git@github.com/Paratco/javascript.git",
9
10
  "keywords": [
10
11
  "eslint",
11
12
  "eslint-config",
12
13
  "react",
14
+ "node",
15
+ "node.js",
13
16
  "lint"
14
17
  ],
15
18
  "scripts": {
@@ -17,47 +20,18 @@
17
20
  "format": "prettier --write src/"
18
21
  },
19
22
  "peerDependencies": {
20
- "@eslint/compat": "^1.0.3",
21
- "@eslint/js": "^9.4.0",
22
- "@types/eslint__js": "^8.42.3",
23
23
  "eslint": "^9.4.0",
24
- "eslint-config-prettier": "^9.1.0",
25
- "eslint-plugin-react": "^7.34.2",
26
- "eslint-plugin-react-hooks": "^4.6.2",
27
- "eslint-plugin-react-refresh": "^0.4.7",
28
- "globals": "^15.4.0",
29
24
  "prettier": "^3.3.2",
30
25
  "typescript-eslint": "^7.13.0"
31
26
  },
32
- "peerDependenciesMeta": {
33
- "@eslint/compat": {
34
- "optional": true
35
- },
36
- "eslint-plugin-react": {
37
- "optional": true
38
- },
39
- "eslint-plugin-react-hooks": {
40
- "optional": true
41
- },
42
- "eslint-plugin-react-refresh": {
43
- "optional": true
44
- },
45
- "globals": {
46
- "optional": true
47
- }
48
- },
49
- "devDependencies": {
27
+ "dependencies": {
50
28
  "@eslint/compat": "^1.0.3",
51
29
  "@eslint/js": "^9.4.0",
52
30
  "@types/eslint__js": "^8.42.3",
53
- "eslint": "^9.4.0",
54
31
  "eslint-config-prettier": "^9.1.0",
55
32
  "eslint-plugin-react": "^7.34.2",
56
33
  "eslint-plugin-react-hooks": "^4.6.2",
57
34
  "eslint-plugin-react-refresh": "^0.4.7",
58
- "globals": "^15.4.0",
59
- "prettier": "^3.3.2",
60
- "typescript": "^5.4.5",
61
- "typescript-eslint": "^7.13.0"
35
+ "globals": "^15.4.0"
62
36
  }
63
37
  }
@@ -0,0 +1,22 @@
1
+ # `@paratco/prettier-config`
2
+
3
+ Paratco Prettier configs
4
+
5
+ ### Installation
6
+
7
+ NPM:
8
+ ```bash
9
+ npm install --save-dev @paratco/prettier-config prettier
10
+ ```
11
+
12
+ Yarn:
13
+ ```bash
14
+ yarn add -D @paratco/prettier-config prettier
15
+ ```
16
+
17
+ ### Usage:
18
+
19
+ In your `.prettierrc.json` file:
20
+ ```json
21
+ "@paratco/prettier-config"
22
+ ```
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "printWidth": 120,
4
+ "tabWidth": 2,
5
+ "useTabs": false,
6
+ "semi": true,
7
+ "singleQuote": false,
8
+ "quoteProps": "as-needed",
9
+ "jsxSingleQuote": false,
10
+ "trailingComma": "none",
11
+ "bracketSpacing": true,
12
+ "bracketSameLine": false,
13
+ "arrowParens": "always",
14
+ "requirePragma": false,
15
+ "insertPragma": false,
16
+ "proseWrap": "preserve",
17
+ "htmlWhitespaceSensitivity": "css",
18
+ "vueIndentScriptAndStyle": false,
19
+ "endOfLine": "lf",
20
+ "embeddedLanguageFormatting": "auto",
21
+ "singleAttributePerLine": false
22
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@paratco/prettier-config",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "main": "index.json",
6
+ "author": "Paratco",
7
+ "license": "ISC",
8
+ "description": "Paratco Prettier Config",
9
+ "repository": "git@github.com/Paratco/javascript.git",
10
+ "keywords": [
11
+ "prettier",
12
+ "prettier-config"
13
+ ],
14
+ "scripts": {
15
+ "test": "echo \"Error: no test specified\" && exit 1"
16
+ },
17
+ "peerDependencies": {
18
+ "prettier": "^3.3.2"
19
+ }
20
+ }
@@ -16,9 +16,7 @@ export default [
16
16
  // TypeScript Rules
17
17
  {
18
18
  files: ["**/*.{ts,tsx}"],
19
- rules: {
20
- ...typescriptRules
21
- }
19
+ rules: typescriptRules
22
20
  },
23
21
 
24
22
  eslintConfigPrettier
@@ -0,0 +1,9 @@
1
+ import globals from "globals";
2
+ import baseConfig from "./base.js";
3
+
4
+ export default [
5
+ ...baseConfig,
6
+
7
+ // Node Only
8
+ { languageOptions: { globals: globals.node } }
9
+ ];
@@ -1,4 +1,5 @@
1
1
  import globals from "globals";
2
+ import baseConfig from "./base.js";
2
3
 
3
4
  // Fix plugins compatibility with ESLint 9.x
4
5
  import { fixupPluginRules } from "@eslint/compat";
@@ -12,6 +13,8 @@ import reactRefresh from "eslint-plugin-react-refresh";
12
13
  import reactRules from "../lints/react/index.js";
13
14
 
14
15
  export default [
16
+ ...baseConfig,
17
+
15
18
  // Browser Only
16
19
  { languageOptions: { globals: globals.browser } },
17
20
 
@@ -1,237 +1,251 @@
1
- export default {
2
- // Enforce that class methods utilize this.
3
- // https://typescript-eslint.io/rules/class-methods-use-this
4
- // Note: you must disable the base rule as it can report incorrect errors
5
- "class-methods-use-this": "off",
6
- "@typescript-eslint/class-methods-use-this": [
7
- "error",
8
- {
9
- ignoreOverrideMethods: true,
10
- ignoreClassesThatImplementAnInterface: true
11
- }
12
- ],
13
-
14
- // Require return statements to either always or never specify values
15
- // https://typescript-eslint.io/rules/consistent-return/
16
- // Note: you must disable the base rule as it can report incorrect errors
17
- "consistent-return": "off",
18
- "@typescript-eslint/consistent-return": ["error"],
19
-
20
- // Enforce consistent usage of type exports.
21
- // https://typescript-eslint.io/rules/consistent-type-exports
22
- "@typescript-eslint/consistent-type-exports": [
23
- "error",
24
- {
25
- fixMixedExportsWithInlineTypeSpecifier: true
26
- }
27
- ],
28
-
29
- // Enforce consistent usage of type imports.
30
- // https://typescript-eslint.io/rules/consistent-type-imports
31
- "@typescript-eslint/consistent-type-imports": ["error"],
32
-
33
- // Enforce default parameters to be last.
34
- // https://typescript-eslint.io/rules/default-param-last
35
- // Note: you must disable the base rule as it can report incorrect errors
36
- "default-param-last": "off",
37
- "@typescript-eslint/default-param-last": ["error"],
38
-
39
- // Require explicit return types on functions and class methods.
40
- // https://typescript-eslint.io/rules/explicit-function-return-type
41
- "@typescript-eslint/explicit-function-return-type": [
42
- "error",
43
- {
44
- allowExpressions: true
45
- }
46
- ],
47
-
48
- // Require explicit accessibility modifiers on class properties and methods.
49
- // https://typescript-eslint.io/rules/explicit-member-accessibility
50
- "@typescript-eslint/explicit-member-accessibility": [
51
- "error",
52
- {
53
- "overrides": {
54
- "constructors": "off"
55
- }
56
- }
57
- ],
58
-
59
- // Require explicit return and argument types on exported functions' and classes' public class methods.
60
- // https://typescript-eslint.io/rules/explicit-module-boundary-types
61
- "@typescript-eslint/explicit-module-boundary-types": ["error"],
62
-
63
- // Require or disallow initialization in variable declarations.
64
- // https://typescript-eslint.io/rules/init-declarations
65
- // Note: you must disable the base rule as it can report incorrect errors
66
- "init-declarations": "off",
67
- "@typescript-eslint/init-declarations": ["off"],
68
-
69
- // Enforce a maximum number of parameters in function definitions.
70
- // https://typescript-eslint.io/rules/max-params
71
- // Note: you must disable the base rule as it can report incorrect errors
72
- "max-params": "off",
73
- "@typescript-eslint/max-params": ["off"],
74
-
75
- // Require a consistent member declaration order.
76
- // https://typescript-eslint.io/rules/member-ordering
77
- "@typescript-eslint/member-ordering": [
78
- "error",
79
- { "default": ["constructor", "field", "static-method", "method", "signature"] }
80
- ],
81
-
82
- // Enforce using a particular method signature syntax.
83
- // https://typescript-eslint.io/rules/method-signature-style
84
- "@typescript-eslint/method-signature-style": ["error"],
85
-
86
- // Enforce naming conventions for everything across a codebase.
87
- // https://typescript-eslint.io/rules/naming-convention
88
- // TODO: We can split this rule. for components it enforces PascalCase and functions camelCase
89
- "@typescript-eslint/naming-convention": [
90
- "error",
91
- {
92
- selector: "function",
93
- format: ["PascalCase", "camelCase"]
94
- }
95
- ],
96
-
97
- // Disallow duplicate class members.
98
- // https://typescript-eslint.io/rules/no-dupe-class-members
99
- // Note: you must disable the base rule as it can report incorrect errors
100
- "no-dupe-class-members": "error",
101
- "@typescript-eslint/no-dupe-class-members": ["error"],
102
-
103
- // Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
104
- // https://typescript-eslint.io/rules/no-import-type-side-effects
105
- "@typescript-eslint/no-import-type-side-effects": ["error"],
106
-
107
- // Disallow this keywords outside of classes or class-like objects.
108
- // https://typescript-eslint.io/rules/no-invalid-this
109
- // Note: you must disable the base rule as it can report incorrect errors
110
- "no-invalid-this": "off",
111
- "@typescript-eslint/no-invalid-this": ["error"],
112
-
113
- // Disallow function declarations that contain unsafe references inside loop statements.
114
- // https://typescript-eslint.io/rules/no-loop-func
115
- // Note: you must disable the base rule as it can report incorrect errors
116
- "no-loop-func": "off",
117
- "@typescript-eslint/no-loop-func": ["error"],
118
-
119
- // Disallow magic numbers.
120
- // https://typescript-eslint.io/rules/no-magic-numbers
121
- // Note: you must disable the base rule as it can report incorrect errors
122
- "no-magic-numbers": "off",
123
- "@typescript-eslint/no-magic-numbers": ["off"],
124
-
125
- // Disallow variable redeclaration.
126
- // https://typescript-eslint.io/rules/no-redeclare
127
- // Note: you must disable the base rule as it can report incorrect errors
128
- "no-redeclare": "off",
129
- "@typescript-eslint/no-redeclare": ["off"],
130
-
131
- // Disallow invocation of require().
132
- // https://typescript-eslint.io/rules/no-require-imports
133
- "@typescript-eslint/no-require-imports": ["error"],
134
-
135
- // Disallow specified modules when loaded by import.
136
- // https://typescript-eslint.io/rules/no-restricted-imports
137
- // Note: you must disable the base rule as it can report incorrect errors
138
- "no-restricted-imports": "off",
139
- "@typescript-eslint/no-restricted-imports": ["off"],
140
-
141
- // Disallow variable declarations from shadowing variables declared in the outer scope.
142
- // https://typescript-eslint.io/rules/no-shadow
143
- // Note: you must disable the base rule as it can report incorrect errors
144
- "no-shadow": "off",
145
- "@typescript-eslint/no-shadow": ["error"],
146
-
147
- // Disallow unnecessary namespace qualifiers.
148
- // https://typescript-eslint.io/rules/no-unnecessary-qualifier
149
- "@typescript-eslint/no-unnecessary-qualifier": ["warn"],
150
-
151
- // Require unary negation to take a number.
152
- // https://typescript-eslint.io/rules/no-unsafe-unary-minus
153
- "@typescript-eslint/no-unsafe-unary-minus": ["error"],
154
-
155
- // Disallow unused expressions.
156
- // https://typescript-eslint.io/rules/no-unused-expressions
157
- // Note: you must disable the base rule as it can report incorrect errors
158
- "no-unused-expressions": "off",
159
- "@typescript-eslint/no-unused-expressions": ["off"],
160
-
161
- // Disallow the use of variables before they are defined.
162
- // https://typescript-eslint.io/rules/no-use-before-define
163
- // Note: you must disable the base rule as it can report incorrect errors
164
- "no-use-before-define": "off",
165
- "@typescript-eslint/no-use-before-define": ["error"],
166
-
167
- // Disallow empty exports that don't change anything in a module file.
168
- // https://typescript-eslint.io/rules/no-useless-empty-export
169
- "@typescript-eslint/no-useless-empty-export": ["warn"],
170
-
171
- // Require or disallow parameter properties in class constructors.
172
- // https://typescript-eslint.io/rules/parameter-properties
173
- "@typescript-eslint/parameter-properties": ["error"],
174
-
175
- // Require destructuring from arrays and/or objects.
176
- // https://typescript-eslint.io/rules/prefer-destructuring
177
- // Note: you must disable the base rule as it can report incorrect errors
178
- "prefer-destructuring": "off",
179
- "@typescript-eslint/prefer-destructuring": ["off"],
180
-
181
- // Require each enum member value to be explicitly initialized.
182
- // https://typescript-eslint.io/rules/prefer-enum-initializers
183
- "@typescript-eslint/prefer-enum-initializers": ["off"],
184
-
185
- // Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.
186
- // https://typescript-eslint.io/rules/prefer-find
187
- "@typescript-eslint/prefer-find": ["warn"],
188
-
189
- // Require private members to be marked as readonly if they're never modified outside the constructor.
190
- // https://typescript-eslint.io/rules/prefer-readonly
191
- "@typescript-eslint/prefer-readonly": ["warn"],
192
-
193
- // Require function parameters to be typed as readonly to prevent accidental mutation of inputs.
194
- // https://typescript-eslint.io/rules/prefer-readonly-parameter-types
195
- "@typescript-eslint/prefer-readonly-parameter-types": ["off"],
196
-
197
- // Enforce RegExp#exec over String#match if no global flag is provided.
198
- // https://typescript-eslint.io/rules/prefer-regexp-exec
199
- "@typescript-eslint/prefer-regexp-exec": ["warn"],
200
-
201
- // Require any function or method that returns a Promise to be marked async.
202
- // https://typescript-eslint.io/rules/promise-function-async
203
- "@typescript-eslint/promise-function-async": ["error"],
204
-
205
- // Require Array#sort and Array#toSorted calls to always provide a compareFunction.
206
- // https://typescript-eslint.io/rules/require-array-sort-compare
207
- "@typescript-eslint/require-array-sort-compare": ["error"],
208
-
209
- // Enforce consistent returning of awaited values.
210
- // https://typescript-eslint.io/rules/return-await
211
- // Note: you must disable the base rule as it can report incorrect errors
212
- "no-return-await": "off",
213
- "@typescript-eslint/return-await": ["off"],
214
-
215
- // Enforce constituents of a type union/intersection to be sorted alphabetically.
216
- // https://typescript-eslint.io/rules/sort-type-constituents
217
- "@typescript-eslint/sort-type-constituents": ["warn"],
218
-
219
- // Disallow certain types in boolean expressions.
220
- // https://typescript-eslint.io/rules/strict-boolean-expressions
221
- "@typescript-eslint/strict-boolean-expressions": [
222
- "error",
223
- {
224
- allowString: false,
225
- allowNumber: false,
226
- allowNullableObject: false
227
- }
228
- ],
229
-
230
- // Require switch-case statements to be exhaustive.
231
- // https://typescript-eslint.io/rules/switch-exhaustiveness-check
232
- "@typescript-eslint/switch-exhaustiveness-check": ["error"],
233
-
234
- // Require type annotations in certain places.
235
- // https://typescript-eslint.io/rules/typedef
236
- "@typescript-eslint/typedef": ["off"]
237
- };
1
+ export default {
2
+ // Enforce that class methods utilize this.
3
+ // https://typescript-eslint.io/rules/class-methods-use-this
4
+ // Note: you must disable the base rule as it can report incorrect errors
5
+ "class-methods-use-this": "off",
6
+ "@typescript-eslint/class-methods-use-this": [
7
+ "error",
8
+ {
9
+ ignoreOverrideMethods: true,
10
+ ignoreClassesThatImplementAnInterface: true
11
+ }
12
+ ],
13
+
14
+ // Require return statements to either always or never specify values
15
+ // https://typescript-eslint.io/rules/consistent-return/
16
+ // Note: you must disable the base rule as it can report incorrect errors
17
+ "consistent-return": "off",
18
+ "@typescript-eslint/consistent-return": "off",
19
+
20
+ // Enforce consistent usage of type exports.
21
+ // https://typescript-eslint.io/rules/consistent-type-exports
22
+ "@typescript-eslint/consistent-type-exports": [
23
+ "error",
24
+ {
25
+ fixMixedExportsWithInlineTypeSpecifier: true
26
+ }
27
+ ],
28
+
29
+ // Enforce consistent usage of type imports.
30
+ // https://typescript-eslint.io/rules/consistent-type-imports
31
+ "@typescript-eslint/consistent-type-imports": ["error"],
32
+
33
+ // Enforce default parameters to be last.
34
+ // https://typescript-eslint.io/rules/default-param-last
35
+ // Note: you must disable the base rule as it can report incorrect errors
36
+ "default-param-last": "off",
37
+ "@typescript-eslint/default-param-last": ["error"],
38
+
39
+ // Require explicit return types on functions and class methods.
40
+ // https://typescript-eslint.io/rules/explicit-function-return-type
41
+ "@typescript-eslint/explicit-function-return-type": [
42
+ "error",
43
+ {
44
+ allowExpressions: true
45
+ }
46
+ ],
47
+
48
+ // Require explicit accessibility modifiers on class properties and methods.
49
+ // https://typescript-eslint.io/rules/explicit-member-accessibility
50
+ "@typescript-eslint/explicit-member-accessibility": [
51
+ "error",
52
+ {
53
+ accessibility: "no-public",
54
+ overrides: {
55
+ constructors: "off"
56
+ }
57
+ }
58
+ ],
59
+
60
+ // Require explicit return and argument types on exported functions' and classes' public class methods.
61
+ // https://typescript-eslint.io/rules/explicit-module-boundary-types
62
+ "@typescript-eslint/explicit-module-boundary-types": ["error"],
63
+
64
+ // Require or disallow initialization in variable declarations.
65
+ // https://typescript-eslint.io/rules/init-declarations
66
+ // Note: you must disable the base rule as it can report incorrect errors
67
+ "init-declarations": "off",
68
+ "@typescript-eslint/init-declarations": ["off"],
69
+
70
+ // Enforce a maximum number of parameters in function definitions.
71
+ // https://typescript-eslint.io/rules/max-params
72
+ // Note: you must disable the base rule as it can report incorrect errors
73
+ "max-params": "off",
74
+ "@typescript-eslint/max-params": ["off"],
75
+
76
+ // Require a consistent member declaration order.
77
+ // https://typescript-eslint.io/rules/member-ordering
78
+ "@typescript-eslint/member-ordering": [
79
+ "error",
80
+ { default: ["constructor", "field", "static-method", "method", "signature"] }
81
+ ],
82
+
83
+ // Enforce using a particular method signature syntax.
84
+ // https://typescript-eslint.io/rules/method-signature-style
85
+ "@typescript-eslint/method-signature-style": ["error"],
86
+
87
+ // Enforce naming conventions for everything across a codebase.
88
+ // https://typescript-eslint.io/rules/naming-convention
89
+ // TODO: We can split this rule. for components it enforces PascalCase and functions camelCase
90
+ "@typescript-eslint/naming-convention": [
91
+ "error",
92
+ {
93
+ selector: "function",
94
+ format: ["PascalCase", "camelCase"]
95
+ }
96
+ ],
97
+
98
+ // Disallow duplicate class members.
99
+ // https://typescript-eslint.io/rules/no-dupe-class-members
100
+ // Note: you must disable the base rule as it can report incorrect errors
101
+ "no-dupe-class-members": "error",
102
+ "@typescript-eslint/no-dupe-class-members": ["error"],
103
+
104
+ // Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
105
+ // https://typescript-eslint.io/rules/no-import-type-side-effects
106
+ "@typescript-eslint/no-import-type-side-effects": ["error"],
107
+
108
+ // Disallow this keywords outside of classes or class-like objects.
109
+ // https://typescript-eslint.io/rules/no-invalid-this
110
+ // Note: you must disable the base rule as it can report incorrect errors
111
+ "no-invalid-this": "off",
112
+ "@typescript-eslint/no-invalid-this": ["error"],
113
+
114
+ // Disallow function declarations that contain unsafe references inside loop statements.
115
+ // https://typescript-eslint.io/rules/no-loop-func
116
+ // Note: you must disable the base rule as it can report incorrect errors
117
+ "no-loop-func": "off",
118
+ "@typescript-eslint/no-loop-func": ["error"],
119
+
120
+ // Disallow magic numbers.
121
+ // https://typescript-eslint.io/rules/no-magic-numbers
122
+ // Note: you must disable the base rule as it can report incorrect errors
123
+ "no-magic-numbers": "off",
124
+ "@typescript-eslint/no-magic-numbers": ["off"],
125
+
126
+ // Disallow variable redeclaration.
127
+ // https://typescript-eslint.io/rules/no-redeclare
128
+ // Note: you must disable the base rule as it can report incorrect errors
129
+ "no-redeclare": "off",
130
+ "@typescript-eslint/no-redeclare": ["off"],
131
+
132
+ // Disallow invocation of require().
133
+ // https://typescript-eslint.io/rules/no-require-imports
134
+ "@typescript-eslint/no-require-imports": ["error"],
135
+
136
+ // Disallow specified modules when loaded by import.
137
+ // https://typescript-eslint.io/rules/no-restricted-imports
138
+ // Note: you must disable the base rule as it can report incorrect errors
139
+ "no-restricted-imports": "off",
140
+ "@typescript-eslint/no-restricted-imports": ["off"],
141
+
142
+ // Disallow variable declarations from shadowing variables declared in the outer scope.
143
+ // https://typescript-eslint.io/rules/no-shadow
144
+ // Note: you must disable the base rule as it can report incorrect errors
145
+ "no-shadow": "off",
146
+ "@typescript-eslint/no-shadow": ["error"],
147
+
148
+ // Disallow unnecessary namespace qualifiers.
149
+ // https://typescript-eslint.io/rules/no-unnecessary-qualifier
150
+ "@typescript-eslint/no-unnecessary-qualifier": ["warn"],
151
+
152
+ // Require unary negation to take a number.
153
+ // https://typescript-eslint.io/rules/no-unsafe-unary-minus
154
+ "@typescript-eslint/no-unsafe-unary-minus": ["error"],
155
+
156
+ // Disallow unused expressions.
157
+ // https://typescript-eslint.io/rules/no-unused-expressions
158
+ // Note: you must disable the base rule as it can report incorrect errors
159
+ "no-unused-expressions": "off",
160
+ "@typescript-eslint/no-unused-expressions": ["off"],
161
+
162
+ // Disallow the use of variables before they are defined.
163
+ // https://typescript-eslint.io/rules/no-use-before-define
164
+ // Note: you must disable the base rule as it can report incorrect errors
165
+ "no-use-before-define": "off",
166
+ "@typescript-eslint/no-use-before-define": ["error"],
167
+
168
+ // Disallow empty exports that don't change anything in a module file.
169
+ // https://typescript-eslint.io/rules/no-useless-empty-export
170
+ "@typescript-eslint/no-useless-empty-export": ["warn"],
171
+
172
+ // Require or disallow parameter properties in class constructors.
173
+ // https://typescript-eslint.io/rules/parameter-properties
174
+ "@typescript-eslint/parameter-properties": ["error"],
175
+
176
+ // Require destructuring from arrays and/or objects.
177
+ // https://typescript-eslint.io/rules/prefer-destructuring
178
+ // Note: you must disable the base rule as it can report incorrect errors
179
+ "prefer-destructuring": "off",
180
+ "@typescript-eslint/prefer-destructuring": ["off"],
181
+
182
+ // Require each enum member value to be explicitly initialized.
183
+ // https://typescript-eslint.io/rules/prefer-enum-initializers
184
+ "@typescript-eslint/prefer-enum-initializers": ["off"],
185
+
186
+ // Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.
187
+ // https://typescript-eslint.io/rules/prefer-find
188
+ "@typescript-eslint/prefer-find": ["warn"],
189
+
190
+ // Require private members to be marked as readonly if they're never modified outside the constructor.
191
+ // https://typescript-eslint.io/rules/prefer-readonly
192
+ "@typescript-eslint/prefer-readonly": ["warn"],
193
+
194
+ // Require function parameters to be typed as readonly to prevent accidental mutation of inputs.
195
+ // https://typescript-eslint.io/rules/prefer-readonly-parameter-types
196
+ "@typescript-eslint/prefer-readonly-parameter-types": ["off"],
197
+
198
+ // Enforce RegExp#exec over String#match if no global flag is provided.
199
+ // https://typescript-eslint.io/rules/prefer-regexp-exec
200
+ "@typescript-eslint/prefer-regexp-exec": ["warn"],
201
+
202
+ // Require any function or method that returns a Promise to be marked async.
203
+ // https://typescript-eslint.io/rules/promise-function-async
204
+ "@typescript-eslint/promise-function-async": ["error"],
205
+
206
+ // Require Array#sort and Array#toSorted calls to always provide a compareFunction.
207
+ // https://typescript-eslint.io/rules/require-array-sort-compare
208
+ "@typescript-eslint/require-array-sort-compare": ["error"],
209
+
210
+ // Enforce consistent returning of awaited values.
211
+ // https://typescript-eslint.io/rules/return-await
212
+ // Note: you must disable the base rule as it can report incorrect errors
213
+ "no-return-await": "off",
214
+ "@typescript-eslint/return-await": ["off"],
215
+
216
+ // Enforce constituents of a type union/intersection to be sorted alphabetically.
217
+ // https://typescript-eslint.io/rules/sort-type-constituents
218
+ "@typescript-eslint/sort-type-constituents": ["warn"],
219
+
220
+ // Disallow certain types in boolean expressions.
221
+ // https://typescript-eslint.io/rules/strict-boolean-expressions
222
+ "@typescript-eslint/strict-boolean-expressions": [
223
+ "error",
224
+ {
225
+ allowString: false,
226
+ allowNumber: false,
227
+ allowNullableObject: false
228
+ }
229
+ ],
230
+
231
+ // Require switch-case statements to be exhaustive.
232
+ // https://typescript-eslint.io/rules/switch-exhaustiveness-check
233
+ "@typescript-eslint/switch-exhaustiveness-check": ["error"],
234
+
235
+ // Require type annotations in certain places.
236
+ // https://typescript-eslint.io/rules/typedef
237
+ "@typescript-eslint/typedef": ["off"],
238
+
239
+ // Enforce template literal expressions to be of string type.
240
+ // https://typescript-eslint.io/rules/restrict-template-expressions
241
+ rules: {
242
+ "@typescript-eslint/restrict-template-expressions": [
243
+ "error",
244
+ {
245
+ allowBoolean: true,
246
+ allowNumber: true,
247
+ allowRegExp: true
248
+ }
249
+ ]
250
+ }
251
+ };