@andrewt03/eslint-typescript-rules 0.0.16 → 0.0.18

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/dist/index.d.mts CHANGED
@@ -1 +1,27 @@
1
- export { SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES } from './eslint-rules/eslint.rules.mjs';
1
+ type ESLintOverrideRuleOptions = {
2
+ [key: string]: string | number | boolean | string[];
3
+ };
4
+ type ConsistentGenericConstructorOverrideRuleOptions = "constructor" | "type-annotation";
5
+ type ConsistentTypeDefinitionsOverrideRuleOptions = "interface" | "type";
6
+ type ConfigRules = {
7
+ [key: string]: "off" | "warn" | "error" | ["warn" | "error", ESLintOverrideRuleOptions] | ["warn" | "error", ...ESLintOverrideRuleOptions[]] | ["warn" | "error", "always" | "never"] | ["warn" | "error", "always" | "never", ESLintOverrideRuleOptions] | ["warn" | "error", ConsistentGenericConstructorOverrideRuleOptions] | ["warn" | "error", ConsistentTypeDefinitionsOverrideRuleOptions];
8
+ };
9
+
10
+ /**
11
+ * ESLint Ruleset Configuration (Exported At Bottom of File)
12
+ */
13
+ /**
14
+ * @tutorial [ESLint-Reference](https://eslint.org/docs/latest/rules/)
15
+ */
16
+ declare const STANDARD_ESLINT_CONFIG_RULES: ConfigRules;
17
+ /**
18
+ * @tutorial [TS-ESLint-Reference](https://typescript-eslint.io/rules/)
19
+ */
20
+ declare const TYPESCRIPT_ESLINT_CONFIG_RULES: ConfigRules;
21
+ /**
22
+ * @tutorial [Unicorn-Reference](https://github.com/sindresorhus/eslint-plugin-unicorn/tree/main?tab=readme-ov-file)
23
+ */
24
+ declare const UNICORN_ESLINT_CONFIG_RULES: ConfigRules;
25
+ declare const SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES: ConfigRules;
26
+
27
+ export { type ConfigRules, SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
package/dist/index.d.ts CHANGED
@@ -1 +1,27 @@
1
- export { SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES } from './eslint-rules/eslint.rules.js';
1
+ type ESLintOverrideRuleOptions = {
2
+ [key: string]: string | number | boolean | string[];
3
+ };
4
+ type ConsistentGenericConstructorOverrideRuleOptions = "constructor" | "type-annotation";
5
+ type ConsistentTypeDefinitionsOverrideRuleOptions = "interface" | "type";
6
+ type ConfigRules = {
7
+ [key: string]: "off" | "warn" | "error" | ["warn" | "error", ESLintOverrideRuleOptions] | ["warn" | "error", ...ESLintOverrideRuleOptions[]] | ["warn" | "error", "always" | "never"] | ["warn" | "error", "always" | "never", ESLintOverrideRuleOptions] | ["warn" | "error", ConsistentGenericConstructorOverrideRuleOptions] | ["warn" | "error", ConsistentTypeDefinitionsOverrideRuleOptions];
8
+ };
9
+
10
+ /**
11
+ * ESLint Ruleset Configuration (Exported At Bottom of File)
12
+ */
13
+ /**
14
+ * @tutorial [ESLint-Reference](https://eslint.org/docs/latest/rules/)
15
+ */
16
+ declare const STANDARD_ESLINT_CONFIG_RULES: ConfigRules;
17
+ /**
18
+ * @tutorial [TS-ESLint-Reference](https://typescript-eslint.io/rules/)
19
+ */
20
+ declare const TYPESCRIPT_ESLINT_CONFIG_RULES: ConfigRules;
21
+ /**
22
+ * @tutorial [Unicorn-Reference](https://github.com/sindresorhus/eslint-plugin-unicorn/tree/main?tab=readme-ov-file)
23
+ */
24
+ declare const UNICORN_ESLINT_CONFIG_RULES: ConfigRules;
25
+ declare const SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES: ConfigRules;
26
+
27
+ export { type ConfigRules, SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
package/dist/index.js CHANGED
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -11,12 +15,253 @@ var __copyProps = (to, from, except, desc) => {
11
15
  }
12
16
  return to;
13
17
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
16
21
  var index_exports = {};
22
+ __export(index_exports, {
23
+ SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES: () => SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES,
24
+ STANDARD_ESLINT_CONFIG_RULES: () => STANDARD_ESLINT_CONFIG_RULES,
25
+ TYPESCRIPT_ESLINT_CONFIG_RULES: () => TYPESCRIPT_ESLINT_CONFIG_RULES,
26
+ UNICORN_ESLINT_CONFIG_RULES: () => UNICORN_ESLINT_CONFIG_RULES
27
+ });
17
28
  module.exports = __toCommonJS(index_exports);
18
- __reExport(index_exports, require("./eslint-rules"), module.exports);
29
+
30
+ // src/eslint-rules/eslint.rules.ts
31
+ var STANDARD_ESLINT_CONFIG_RULES = {
32
+ semi: "error",
33
+ "no-console": "warn",
34
+ // FE - Warn, BE - Error
35
+ "no-debugger": "warn",
36
+ // FE - Warn, BE - Error
37
+ "no-var": "error",
38
+ "no-void": "error",
39
+ "prefer-const": "error",
40
+ "getter-return": "error",
41
+ "no-setter-return": "error",
42
+ "no-class-assign": "error",
43
+ "no-const-assign": "error",
44
+ "no-constant-binary-expression": "error",
45
+ "no-dupe-args": "error",
46
+ "no-dupe-else-if": "error",
47
+ "no-duplicate-case": "error",
48
+ "no-duplicate-imports": "error",
49
+ "no-ex-assign": "error",
50
+ "no-fallthrough": "error",
51
+ "no-inner-declarations": "error",
52
+ "no-octal": "error",
53
+ "no-octal-escape": "error",
54
+ "no-nonoctal-decimal-escape": "error",
55
+ "no-delete-var": "error",
56
+ "no-empty": "error",
57
+ // "no-empty-function": "error",
58
+ "no-empty-static-block": "error",
59
+ "no-eval": "error",
60
+ "no-implied-eval": "error",
61
+ "no-extend-native": "error",
62
+ "no-extra-bind": "error",
63
+ "no-extra-boolean-cast": "error",
64
+ "no-extra-label": "error",
65
+ "no-global-assign": "error",
66
+ "no-implicit-coercion": "error",
67
+ "no-label-var": "error",
68
+ "no-labels": "error",
69
+ "no-lone-blocks": "error",
70
+ "no-lonely-if": "error",
71
+ "no-multi-assign": "error",
72
+ "no-nested-ternary": "error",
73
+ "no-new": "error",
74
+ "no-new-func": "error",
75
+ "no-new-wrappers": "error",
76
+ "no-param-reassign": "error",
77
+ "no-proto": "error",
78
+ "no-return-assign": "error",
79
+ "no-script-url": "error",
80
+ "no-sequences": "error",
81
+ "no-compare-neg-zero": "error",
82
+ "no-underscore-dangle": "error",
83
+ "no-throw-literal": "error",
84
+ "no-unused-labels": "error",
85
+ "no-undefined": "error",
86
+ "no-useless-call": "error",
87
+ "no-useless-concat": "error",
88
+ "prefer-template": "error",
89
+ "no-useless-escape": "error",
90
+ "no-useless-return": "error",
91
+ "operator-assignment": ["error", "always"],
92
+ "prefer-exponentiation-operator": "error",
93
+ "prefer-object-has-own": "error",
94
+ "require-yield": "error",
95
+ yoda: "error",
96
+ "no-else-return": [
97
+ "error",
98
+ {
99
+ allowElseIf: true
100
+ }
101
+ ],
102
+ "max-len": [
103
+ "error",
104
+ {
105
+ code: 120,
106
+ tabWidth: 2,
107
+ ignoreComments: true,
108
+ ignoreTrailingComments: true,
109
+ ignoreUrls: true,
110
+ ignoreStrings: true,
111
+ ignoreTemplateLiterals: true
112
+ }
113
+ ],
114
+ "max-lines": [
115
+ "error",
116
+ {
117
+ max: 1e3,
118
+ skipBlankLines: true,
119
+ skipComments: true
120
+ }
121
+ ],
122
+ "logical-assignment-operators": [
123
+ "error",
124
+ "always",
125
+ { enforceForIfStatements: true }
126
+ ],
127
+ "no-restricted-syntax": [
128
+ "error",
129
+ {
130
+ selector: "TSEnumDeclaration:not([const=true])",
131
+ message: "Avoid declaring non-const enums. Use const-types instead."
132
+ },
133
+ {
134
+ selector: "TSEnumDeclaration[const=true]",
135
+ message: "Avoid declaring const enums. Use const-types instead."
136
+ },
137
+ /**
138
+ * @tutorial [No-Explicit-Void-Return-Type](https://typescript-eslint.io/play/#ts=5.7.2&showAST=es&fileType=.tsx&code=GYVwdgxgLglg9mABAZwIYE8ASMAUBKALkQDc4YATRAbwChFEIFk4AbAUwDoW4BzHAImz88AbhoBfGjUZhkUFBmwAmIvkQBeAHwkyldYjVbqdBk1adufQTGFjJ0pvLRYYAZlV4N20hQ2JQkLAIarT0MszsXLwCQqISUhAsqMjIiACCxvTOyvhEPpSh9Kay5lFWsWL0kvZsAB4ADnAATvKJyakAIqhQqADCcAC2jWBsYPKF4VBNINDNIYj29DxsUGksLF09uTq%2BhWFmkZYxNnFV8Q6y8r1JKUp%2BhTxNbCseXplF4aVH1rYm4gA08SAA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQHYHsBaaFAF2gEsBjUxAE0OQE9dSBDAD3TAG1xsciaNHzRIAGn4CsA7JGSIkNUd0gAxWLhoV8uACKIq8NtDakduMAD4wAFQDKtpgAdEAQVwF253dbv2ANXwKOgBpRCYAd1E6CSlZSABbFGQ2AHNEVTcAN2C6MEQOZ3hqClJ4JjBIynNcNLAAHUhckKawElJYaEsAawjo6HyAChJ6ukMASgA6SHiIAF9JWUw5uQUlUhUMdU1tXQBRIpJkZAs-BydXDy8zM5sHIJDwqJi45Zxkk-TM7Zy8gqKJSoZQqVRqFDqjWaeTaHS6vX6MTAI0Q9UKzmms2Wi1WMmW8kUhk2Ym2Dg0Wh8uEuiHOjhc7k8%2BG8d38jzCiMGb3eSRS3yyLXy6KBIMq1TKEPqTQFsMQnW6YD6L0GyNGYBMIkimNW83iAF1%2BDr5kA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false)
139
+ * New Rule: Intended for developers to stop explicitly writing "void" return type explicitly (developed using ESTree ASTs).
140
+ */
141
+ {
142
+ selector: "FunctionDeclaration > TSTypeAnnotation > TSVoidKeyword",
143
+ message: '[FunctionDeclaration] Avoid explicitly declaring a "void" return type.'
144
+ },
145
+ {
146
+ selector: "FunctionExpression > TSTypeAnnotation > TSVoidKeyword",
147
+ message: '[FunctionExpression] Avoid explicitly declaring a "void" return type.'
148
+ },
149
+ {
150
+ selector: "TSFunctionType > TSTypeAnnotation > TSVoidKeyword",
151
+ message: '[FunctionType] Avoid explicitly declaring a "void" return type.'
152
+ }
153
+ ]
154
+ };
155
+ var TYPESCRIPT_ESLINT_CONFIG_RULES = {
156
+ // "void" keyword is allowed
157
+ // Issue: https://github.com/typescript-eslint/typescript-eslint/issues/7250
158
+ // "@typescript-eslint/explicit-function-return-type": ["warn", {
159
+ // allowExpressions: true,
160
+ // allowTypedFunctionExpressions: true
161
+ // }],
162
+ "@typescript-eslint/no-explicit-any": "error",
163
+ "@typescript-eslint/no-unused-vars": "error",
164
+ "@typescript-eslint/prefer-readonly": "error",
165
+ "@typescript-eslint/array-type": "error",
166
+ "@typescript-eslint/ban-tslint-comment": "error",
167
+ "@typescript-eslint/consistent-generic-constructors": [
168
+ "error",
169
+ "constructor"
170
+ ],
171
+ "consistent-return": "off",
172
+ // "@typescript-eslint/consistent-return": "error",
173
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
174
+ "default-param-last": "off",
175
+ "@typescript-eslint/default-param-last": "error",
176
+ "@typescript-eslint/no-array-delete": "error",
177
+ "no-dupe-class-members": "off",
178
+ "@typescript-eslint/no-dupe-class-members": "error",
179
+ "@typescript-eslint/no-duplicate-enum-values": "error",
180
+ "@typescript-eslint/no-deprecated": "error",
181
+ "@typescript-eslint/no-dynamic-delete": "error",
182
+ "@typescript-eslint/no-extra-non-null-assertion": "error",
183
+ "@typescript-eslint/no-for-in-array": "error",
184
+ "no-loop-func": "off",
185
+ "@typescript-eslint/no-loop-func": "error",
186
+ "no-loss-of-precision": "off",
187
+ "@typescript-eslint/no-loss-of-precision": "error",
188
+ "@typescript-eslint/no-meaningless-void-operator": "error",
189
+ "@typescript-eslint/no-misused-new": "error",
190
+ "@typescript-eslint/no-mixed-enums": "error",
191
+ "@typescript-eslint/no-namespace": "error",
192
+ "@typescript-eslint/no-non-null-assertion": "off",
193
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
194
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
195
+ "no-redeclare": "off",
196
+ "@typescript-eslint/no-redeclare": "error",
197
+ "@typescript-eslint/no-require-imports": "error",
198
+ "@typescript-eslint/no-this-alias": "error",
199
+ "@typescript-eslint/no-unnecessary-condition": "error",
200
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
201
+ "@typescript-eslint/no-unnecessary-template-expression": "error",
202
+ "@typescript-eslint/no-unnecessary-type-arguments": "error",
203
+ "@typescript-eslint/no-unnecessary-type-constraint": "error",
204
+ "@typescript-eslint/no-unsafe-declaration-merging": "error",
205
+ "@typescript-eslint/no-unsafe-enum-comparison": "error",
206
+ "@typescript-eslint/no-unsafe-function-type": "error",
207
+ "@typescript-eslint/no-unsafe-return": "error",
208
+ "@typescript-eslint/no-unsafe-unary-minus": "error",
209
+ "no-useless-constructor": "off",
210
+ "@typescript-eslint/no-useless-constructor": "error",
211
+ "@typescript-eslint/no-useless-empty-export": "error",
212
+ "@typescript-eslint/no-var-requires": "error",
213
+ "@typescript-eslint/no-wrapper-object-types": "error",
214
+ "@typescript-eslint/prefer-as-const": "error",
215
+ "@typescript-eslint/prefer-find": "error",
216
+ "@typescript-eslint/prefer-for-of": "error",
217
+ "@typescript-eslint/prefer-function-type": "error",
218
+ "@typescript-eslint/prefer-includes": "error",
219
+ "@typescript-eslint/prefer-namespace-keyword": "error",
220
+ "@typescript-eslint/prefer-nullish-coalescing": "error",
221
+ "@typescript-eslint/prefer-optional-chain": "error",
222
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
223
+ "@typescript-eslint/related-getter-setter-pairs": "error",
224
+ "@typescript-eslint/prefer-ts-expect-error": "error",
225
+ "@typescript-eslint/require-array-sort-compare": "error",
226
+ "require-await": "off",
227
+ "@typescript-eslint/require-await": "error",
228
+ "@typescript-eslint/no-invalid-void-type": "error"
229
+ // "@typescript-eslint/sort-type-constituents": "error"
230
+ };
231
+ var UNICORN_ESLINT_CONFIG_RULES = {
232
+ "unicorn/no-console-spaces": "error",
233
+ "unicorn/no-empty-file": "error",
234
+ "unicorn/no-array-for-each": "error",
235
+ "unicorn/no-array-push-push": "error",
236
+ "unicorn/no-array-reduce": [
237
+ "error",
238
+ {
239
+ allowSimpleOperations: true
240
+ }
241
+ ],
242
+ "unicorn/no-for-loop": "error",
243
+ "unicorn/no-instanceof-array": "error",
244
+ "unicorn/no-new-array": "error",
245
+ "unicorn/no-new-buffer": "error",
246
+ "unicorn/no-this-assignment": "error",
247
+ "unicorn/prefer-string-slice": "error",
248
+ "unicorn/prefer-module": "error",
249
+ "unicorn/prefer-string-starts-ends-with": "error",
250
+ "unicorn/prefer-string-trim-start-end": "error",
251
+ "unicorn/prefer-negative-index": "error",
252
+ "unicorn/consistent-existence-index-check": "error",
253
+ "unicorn/switch-case-braces": "error",
254
+ "unicorn/empty-brace-spaces": "error",
255
+ "unicorn/require-number-to-fixed-digits-argument": "error"
256
+ };
257
+ var SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES = {
258
+ "no-console": "error",
259
+ "no-debugger": "error"
260
+ };
19
261
  // Annotate the CommonJS export names for ESM import in node:
20
262
  0 && (module.exports = {
21
- ...require("./eslint-rules")
263
+ SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES,
264
+ STANDARD_ESLINT_CONFIG_RULES,
265
+ TYPESCRIPT_ESLINT_CONFIG_RULES,
266
+ UNICORN_ESLINT_CONFIG_RULES
22
267
  });
package/dist/index.mjs CHANGED
@@ -1 +1,237 @@
1
- export * from "./eslint-rules";
1
+ // src/eslint-rules/eslint.rules.ts
2
+ var STANDARD_ESLINT_CONFIG_RULES = {
3
+ semi: "error",
4
+ "no-console": "warn",
5
+ // FE - Warn, BE - Error
6
+ "no-debugger": "warn",
7
+ // FE - Warn, BE - Error
8
+ "no-var": "error",
9
+ "no-void": "error",
10
+ "prefer-const": "error",
11
+ "getter-return": "error",
12
+ "no-setter-return": "error",
13
+ "no-class-assign": "error",
14
+ "no-const-assign": "error",
15
+ "no-constant-binary-expression": "error",
16
+ "no-dupe-args": "error",
17
+ "no-dupe-else-if": "error",
18
+ "no-duplicate-case": "error",
19
+ "no-duplicate-imports": "error",
20
+ "no-ex-assign": "error",
21
+ "no-fallthrough": "error",
22
+ "no-inner-declarations": "error",
23
+ "no-octal": "error",
24
+ "no-octal-escape": "error",
25
+ "no-nonoctal-decimal-escape": "error",
26
+ "no-delete-var": "error",
27
+ "no-empty": "error",
28
+ // "no-empty-function": "error",
29
+ "no-empty-static-block": "error",
30
+ "no-eval": "error",
31
+ "no-implied-eval": "error",
32
+ "no-extend-native": "error",
33
+ "no-extra-bind": "error",
34
+ "no-extra-boolean-cast": "error",
35
+ "no-extra-label": "error",
36
+ "no-global-assign": "error",
37
+ "no-implicit-coercion": "error",
38
+ "no-label-var": "error",
39
+ "no-labels": "error",
40
+ "no-lone-blocks": "error",
41
+ "no-lonely-if": "error",
42
+ "no-multi-assign": "error",
43
+ "no-nested-ternary": "error",
44
+ "no-new": "error",
45
+ "no-new-func": "error",
46
+ "no-new-wrappers": "error",
47
+ "no-param-reassign": "error",
48
+ "no-proto": "error",
49
+ "no-return-assign": "error",
50
+ "no-script-url": "error",
51
+ "no-sequences": "error",
52
+ "no-compare-neg-zero": "error",
53
+ "no-underscore-dangle": "error",
54
+ "no-throw-literal": "error",
55
+ "no-unused-labels": "error",
56
+ "no-undefined": "error",
57
+ "no-useless-call": "error",
58
+ "no-useless-concat": "error",
59
+ "prefer-template": "error",
60
+ "no-useless-escape": "error",
61
+ "no-useless-return": "error",
62
+ "operator-assignment": ["error", "always"],
63
+ "prefer-exponentiation-operator": "error",
64
+ "prefer-object-has-own": "error",
65
+ "require-yield": "error",
66
+ yoda: "error",
67
+ "no-else-return": [
68
+ "error",
69
+ {
70
+ allowElseIf: true
71
+ }
72
+ ],
73
+ "max-len": [
74
+ "error",
75
+ {
76
+ code: 120,
77
+ tabWidth: 2,
78
+ ignoreComments: true,
79
+ ignoreTrailingComments: true,
80
+ ignoreUrls: true,
81
+ ignoreStrings: true,
82
+ ignoreTemplateLiterals: true
83
+ }
84
+ ],
85
+ "max-lines": [
86
+ "error",
87
+ {
88
+ max: 1e3,
89
+ skipBlankLines: true,
90
+ skipComments: true
91
+ }
92
+ ],
93
+ "logical-assignment-operators": [
94
+ "error",
95
+ "always",
96
+ { enforceForIfStatements: true }
97
+ ],
98
+ "no-restricted-syntax": [
99
+ "error",
100
+ {
101
+ selector: "TSEnumDeclaration:not([const=true])",
102
+ message: "Avoid declaring non-const enums. Use const-types instead."
103
+ },
104
+ {
105
+ selector: "TSEnumDeclaration[const=true]",
106
+ message: "Avoid declaring const enums. Use const-types instead."
107
+ },
108
+ /**
109
+ * @tutorial [No-Explicit-Void-Return-Type](https://typescript-eslint.io/play/#ts=5.7.2&showAST=es&fileType=.tsx&code=GYVwdgxgLglg9mABAZwIYE8ASMAUBKALkQDc4YATRAbwChFEIFk4AbAUwDoW4BzHAImz88AbhoBfGjUZhkUFBmwAmIvkQBeAHwkyldYjVbqdBk1adufQTGFjJ0pvLRYYAZlV4N20hQ2JQkLAIarT0MszsXLwCQqISUhAsqMjIiACCxvTOyvhEPpSh9Kay5lFWsWL0kvZsAB4ADnAATvKJyakAIqhQqADCcAC2jWBsYPKF4VBNINDNIYj29DxsUGksLF09uTq%2BhWFmkZYxNnFV8Q6y8r1JKUp%2BhTxNbCseXplF4aVH1rYm4gA08SAA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQHYHsBaaFAF2gEsBjUxAE0OQE9dSBDAD3TAG1xsciaNHzRIAGn4CsA7JGSIkNUd0gAxWLhoV8uACKIq8NtDakduMAD4wAFQDKtpgAdEAQVwF253dbv2ANXwKOgBpRCYAd1E6CSlZSABbFGQ2AHNEVTcAN2C6MEQOZ3hqClJ4JjBIynNcNLAAHUhckKawElJYaEsAawjo6HyAChJ6ukMASgA6SHiIAF9JWUw5uQUlUhUMdU1tXQBRIpJkZAs-BydXDy8zM5sHIJDwqJi45Zxkk-TM7Zy8gqKJSoZQqVRqFDqjWaeTaHS6vX6MTAI0Q9UKzmms2Wi1WMmW8kUhk2Ym2Dg0Wh8uEuiHOjhc7k8%2BG8d38jzCiMGb3eSRS3yyLXy6KBIMq1TKEPqTQFsMQnW6YD6L0GyNGYBMIkimNW83iAF1%2BDr5kA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false)
110
+ * New Rule: Intended for developers to stop explicitly writing "void" return type explicitly (developed using ESTree ASTs).
111
+ */
112
+ {
113
+ selector: "FunctionDeclaration > TSTypeAnnotation > TSVoidKeyword",
114
+ message: '[FunctionDeclaration] Avoid explicitly declaring a "void" return type.'
115
+ },
116
+ {
117
+ selector: "FunctionExpression > TSTypeAnnotation > TSVoidKeyword",
118
+ message: '[FunctionExpression] Avoid explicitly declaring a "void" return type.'
119
+ },
120
+ {
121
+ selector: "TSFunctionType > TSTypeAnnotation > TSVoidKeyword",
122
+ message: '[FunctionType] Avoid explicitly declaring a "void" return type.'
123
+ }
124
+ ]
125
+ };
126
+ var TYPESCRIPT_ESLINT_CONFIG_RULES = {
127
+ // "void" keyword is allowed
128
+ // Issue: https://github.com/typescript-eslint/typescript-eslint/issues/7250
129
+ // "@typescript-eslint/explicit-function-return-type": ["warn", {
130
+ // allowExpressions: true,
131
+ // allowTypedFunctionExpressions: true
132
+ // }],
133
+ "@typescript-eslint/no-explicit-any": "error",
134
+ "@typescript-eslint/no-unused-vars": "error",
135
+ "@typescript-eslint/prefer-readonly": "error",
136
+ "@typescript-eslint/array-type": "error",
137
+ "@typescript-eslint/ban-tslint-comment": "error",
138
+ "@typescript-eslint/consistent-generic-constructors": [
139
+ "error",
140
+ "constructor"
141
+ ],
142
+ "consistent-return": "off",
143
+ // "@typescript-eslint/consistent-return": "error",
144
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
145
+ "default-param-last": "off",
146
+ "@typescript-eslint/default-param-last": "error",
147
+ "@typescript-eslint/no-array-delete": "error",
148
+ "no-dupe-class-members": "off",
149
+ "@typescript-eslint/no-dupe-class-members": "error",
150
+ "@typescript-eslint/no-duplicate-enum-values": "error",
151
+ "@typescript-eslint/no-deprecated": "error",
152
+ "@typescript-eslint/no-dynamic-delete": "error",
153
+ "@typescript-eslint/no-extra-non-null-assertion": "error",
154
+ "@typescript-eslint/no-for-in-array": "error",
155
+ "no-loop-func": "off",
156
+ "@typescript-eslint/no-loop-func": "error",
157
+ "no-loss-of-precision": "off",
158
+ "@typescript-eslint/no-loss-of-precision": "error",
159
+ "@typescript-eslint/no-meaningless-void-operator": "error",
160
+ "@typescript-eslint/no-misused-new": "error",
161
+ "@typescript-eslint/no-mixed-enums": "error",
162
+ "@typescript-eslint/no-namespace": "error",
163
+ "@typescript-eslint/no-non-null-assertion": "off",
164
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
165
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
166
+ "no-redeclare": "off",
167
+ "@typescript-eslint/no-redeclare": "error",
168
+ "@typescript-eslint/no-require-imports": "error",
169
+ "@typescript-eslint/no-this-alias": "error",
170
+ "@typescript-eslint/no-unnecessary-condition": "error",
171
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
172
+ "@typescript-eslint/no-unnecessary-template-expression": "error",
173
+ "@typescript-eslint/no-unnecessary-type-arguments": "error",
174
+ "@typescript-eslint/no-unnecessary-type-constraint": "error",
175
+ "@typescript-eslint/no-unsafe-declaration-merging": "error",
176
+ "@typescript-eslint/no-unsafe-enum-comparison": "error",
177
+ "@typescript-eslint/no-unsafe-function-type": "error",
178
+ "@typescript-eslint/no-unsafe-return": "error",
179
+ "@typescript-eslint/no-unsafe-unary-minus": "error",
180
+ "no-useless-constructor": "off",
181
+ "@typescript-eslint/no-useless-constructor": "error",
182
+ "@typescript-eslint/no-useless-empty-export": "error",
183
+ "@typescript-eslint/no-var-requires": "error",
184
+ "@typescript-eslint/no-wrapper-object-types": "error",
185
+ "@typescript-eslint/prefer-as-const": "error",
186
+ "@typescript-eslint/prefer-find": "error",
187
+ "@typescript-eslint/prefer-for-of": "error",
188
+ "@typescript-eslint/prefer-function-type": "error",
189
+ "@typescript-eslint/prefer-includes": "error",
190
+ "@typescript-eslint/prefer-namespace-keyword": "error",
191
+ "@typescript-eslint/prefer-nullish-coalescing": "error",
192
+ "@typescript-eslint/prefer-optional-chain": "error",
193
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
194
+ "@typescript-eslint/related-getter-setter-pairs": "error",
195
+ "@typescript-eslint/prefer-ts-expect-error": "error",
196
+ "@typescript-eslint/require-array-sort-compare": "error",
197
+ "require-await": "off",
198
+ "@typescript-eslint/require-await": "error",
199
+ "@typescript-eslint/no-invalid-void-type": "error"
200
+ // "@typescript-eslint/sort-type-constituents": "error"
201
+ };
202
+ var UNICORN_ESLINT_CONFIG_RULES = {
203
+ "unicorn/no-console-spaces": "error",
204
+ "unicorn/no-empty-file": "error",
205
+ "unicorn/no-array-for-each": "error",
206
+ "unicorn/no-array-push-push": "error",
207
+ "unicorn/no-array-reduce": [
208
+ "error",
209
+ {
210
+ allowSimpleOperations: true
211
+ }
212
+ ],
213
+ "unicorn/no-for-loop": "error",
214
+ "unicorn/no-instanceof-array": "error",
215
+ "unicorn/no-new-array": "error",
216
+ "unicorn/no-new-buffer": "error",
217
+ "unicorn/no-this-assignment": "error",
218
+ "unicorn/prefer-string-slice": "error",
219
+ "unicorn/prefer-module": "error",
220
+ "unicorn/prefer-string-starts-ends-with": "error",
221
+ "unicorn/prefer-string-trim-start-end": "error",
222
+ "unicorn/prefer-negative-index": "error",
223
+ "unicorn/consistent-existence-index-check": "error",
224
+ "unicorn/switch-case-braces": "error",
225
+ "unicorn/empty-brace-spaces": "error",
226
+ "unicorn/require-number-to-fixed-digits-argument": "error"
227
+ };
228
+ var SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES = {
229
+ "no-console": "error",
230
+ "no-debugger": "error"
231
+ };
232
+ export {
233
+ SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES,
234
+ STANDARD_ESLINT_CONFIG_RULES,
235
+ TYPESCRIPT_ESLINT_CONFIG_RULES,
236
+ UNICORN_ESLINT_CONFIG_RULES
237
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrewt03/eslint-typescript-rules",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "Recommended ESLint Rules for general TypeScript, Node.js/Express.js, Angular, and React.js Projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -1,26 +0,0 @@
1
- /**
2
- * ESLint Ruleset Configuration (Exported At Bottom of File)
3
- */
4
- type ESLintOverrideRuleOptions = {
5
- [key: string]: string | number | boolean | string[];
6
- };
7
- type ConsistentGenericConstructorOverrideRuleOptions = "constructor" | "type-annotation";
8
- type ConsistentTypeDefinitionsOverrideRuleOptions = "interface" | "type";
9
- type ConfigRules = {
10
- [key: string]: "off" | "warn" | "error" | ["warn" | "error", ESLintOverrideRuleOptions] | ["warn" | "error", ...ESLintOverrideRuleOptions[]] | ["warn" | "error", "always" | "never"] | ["warn" | "error", "always" | "never", ESLintOverrideRuleOptions] | ["warn" | "error", ConsistentGenericConstructorOverrideRuleOptions] | ["warn" | "error", ConsistentTypeDefinitionsOverrideRuleOptions];
11
- };
12
- /**
13
- * @tutorial [ESLint-Reference](https://eslint.org/docs/latest/rules/)
14
- */
15
- declare const STANDARD_ESLINT_CONFIG_RULES: ConfigRules;
16
- /**
17
- * @tutorial [TS-ESLint-Reference](https://typescript-eslint.io/rules/)
18
- */
19
- declare const TYPESCRIPT_ESLINT_CONFIG_RULES: ConfigRules;
20
- /**
21
- * @tutorial [Unicorn-Reference](https://github.com/sindresorhus/eslint-plugin-unicorn/tree/main?tab=readme-ov-file)
22
- */
23
- declare const UNICORN_ESLINT_CONFIG_RULES: ConfigRules;
24
- declare const SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES: ConfigRules;
25
-
26
- export { SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
@@ -1,26 +0,0 @@
1
- /**
2
- * ESLint Ruleset Configuration (Exported At Bottom of File)
3
- */
4
- type ESLintOverrideRuleOptions = {
5
- [key: string]: string | number | boolean | string[];
6
- };
7
- type ConsistentGenericConstructorOverrideRuleOptions = "constructor" | "type-annotation";
8
- type ConsistentTypeDefinitionsOverrideRuleOptions = "interface" | "type";
9
- type ConfigRules = {
10
- [key: string]: "off" | "warn" | "error" | ["warn" | "error", ESLintOverrideRuleOptions] | ["warn" | "error", ...ESLintOverrideRuleOptions[]] | ["warn" | "error", "always" | "never"] | ["warn" | "error", "always" | "never", ESLintOverrideRuleOptions] | ["warn" | "error", ConsistentGenericConstructorOverrideRuleOptions] | ["warn" | "error", ConsistentTypeDefinitionsOverrideRuleOptions];
11
- };
12
- /**
13
- * @tutorial [ESLint-Reference](https://eslint.org/docs/latest/rules/)
14
- */
15
- declare const STANDARD_ESLINT_CONFIG_RULES: ConfigRules;
16
- /**
17
- * @tutorial [TS-ESLint-Reference](https://typescript-eslint.io/rules/)
18
- */
19
- declare const TYPESCRIPT_ESLINT_CONFIG_RULES: ConfigRules;
20
- /**
21
- * @tutorial [Unicorn-Reference](https://github.com/sindresorhus/eslint-plugin-unicorn/tree/main?tab=readme-ov-file)
22
- */
23
- declare const UNICORN_ESLINT_CONFIG_RULES: ConfigRules;
24
- declare const SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES: ConfigRules;
25
-
26
- export { SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES };
@@ -1,263 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var eslint_rules_exports = {};
20
- __export(eslint_rules_exports, {
21
- SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES: () => SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES,
22
- STANDARD_ESLINT_CONFIG_RULES: () => STANDARD_ESLINT_CONFIG_RULES,
23
- TYPESCRIPT_ESLINT_CONFIG_RULES: () => TYPESCRIPT_ESLINT_CONFIG_RULES,
24
- UNICORN_ESLINT_CONFIG_RULES: () => UNICORN_ESLINT_CONFIG_RULES
25
- });
26
- module.exports = __toCommonJS(eslint_rules_exports);
27
- const STANDARD_ESLINT_CONFIG_RULES = {
28
- semi: "error",
29
- "no-console": "warn",
30
- // FE - Warn, BE - Error
31
- "no-debugger": "warn",
32
- // FE - Warn, BE - Error
33
- "no-var": "error",
34
- "no-void": "error",
35
- "prefer-const": "error",
36
- "getter-return": "error",
37
- "no-setter-return": "error",
38
- "no-class-assign": "error",
39
- "no-const-assign": "error",
40
- "no-constant-binary-expression": "error",
41
- "no-dupe-args": "error",
42
- "no-dupe-else-if": "error",
43
- "no-duplicate-case": "error",
44
- "no-duplicate-imports": "error",
45
- "no-ex-assign": "error",
46
- "no-fallthrough": "error",
47
- "no-inner-declarations": "error",
48
- "no-octal": "error",
49
- "no-octal-escape": "error",
50
- "no-nonoctal-decimal-escape": "error",
51
- "no-delete-var": "error",
52
- "no-empty": "error",
53
- // "no-empty-function": "error",
54
- "no-empty-static-block": "error",
55
- "no-eval": "error",
56
- "no-implied-eval": "error",
57
- "no-extend-native": "error",
58
- "no-extra-bind": "error",
59
- "no-extra-boolean-cast": "error",
60
- "no-extra-label": "error",
61
- "no-global-assign": "error",
62
- "no-implicit-coercion": "error",
63
- "no-label-var": "error",
64
- "no-labels": "error",
65
- "no-lone-blocks": "error",
66
- "no-lonely-if": "error",
67
- "no-multi-assign": "error",
68
- "no-nested-ternary": "error",
69
- "no-new": "error",
70
- "no-new-func": "error",
71
- "no-new-wrappers": "error",
72
- "no-param-reassign": "error",
73
- "no-proto": "error",
74
- "no-return-assign": "error",
75
- "no-script-url": "error",
76
- "no-sequences": "error",
77
- "no-compare-neg-zero": "error",
78
- "no-underscore-dangle": "error",
79
- "no-throw-literal": "error",
80
- "no-unused-labels": "error",
81
- "no-undefined": "error",
82
- "no-useless-call": "error",
83
- "no-useless-concat": "error",
84
- "prefer-template": "error",
85
- "no-useless-escape": "error",
86
- "no-useless-return": "error",
87
- "operator-assignment": ["error", "always"],
88
- "prefer-exponentiation-operator": "error",
89
- "prefer-object-has-own": "error",
90
- "require-yield": "error",
91
- yoda: "error",
92
- "no-else-return": [
93
- "error",
94
- {
95
- allowElseIf: true
96
- }
97
- ],
98
- "max-len": [
99
- "error",
100
- {
101
- code: 120,
102
- tabWidth: 2,
103
- ignoreComments: true,
104
- ignoreTrailingComments: true,
105
- ignoreUrls: true,
106
- ignoreStrings: true,
107
- ignoreTemplateLiterals: true
108
- }
109
- ],
110
- "max-lines": [
111
- "error",
112
- {
113
- max: 1e3,
114
- skipBlankLines: true,
115
- skipComments: true
116
- }
117
- ],
118
- "logical-assignment-operators": [
119
- "error",
120
- "always",
121
- { enforceForIfStatements: true }
122
- ],
123
- "no-restricted-syntax": [
124
- "error",
125
- {
126
- selector: "TSEnumDeclaration:not([const=true])",
127
- message: "Avoid declaring non-const enums. Use const-types instead."
128
- },
129
- {
130
- selector: "TSEnumDeclaration[const=true]",
131
- message: "Avoid declaring const enums. Use const-types instead."
132
- },
133
- /**
134
- * @tutorial [No-Explicit-Void-Return-Type](https://typescript-eslint.io/play/#ts=5.7.2&showAST=es&fileType=.tsx&code=GYVwdgxgLglg9mABAZwIYE8ASMAUBKALkQDc4YATRAbwChFEIFk4AbAUwDoW4BzHAImz88AbhoBfGjUZhkUFBmwAmIvkQBeAHwkyldYjVbqdBk1adufQTGFjJ0pvLRYYAZlV4N20hQ2JQkLAIarT0MszsXLwCQqISUhAsqMjIiACCxvTOyvhEPpSh9Kay5lFWsWL0kvZsAB4ADnAATvKJyakAIqhQqADCcAC2jWBsYPKF4VBNINDNIYj29DxsUGksLF09uTq%2BhWFmkZYxNnFV8Q6y8r1JKUp%2BhTxNbCseXplF4aVH1rYm4gA08SAA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQHYHsBaaFAF2gEsBjUxAE0OQE9dSBDAD3TAG1xsciaNHzRIAGn4CsA7JGSIkNUd0gAxWLhoV8uACKIq8NtDakduMAD4wAFQDKtpgAdEAQVwF253dbv2ANXwKOgBpRCYAd1E6CSlZSABbFGQ2AHNEVTcAN2C6MEQOZ3hqClJ4JjBIynNcNLAAHUhckKawElJYaEsAawjo6HyAChJ6ukMASgA6SHiIAF9JWUw5uQUlUhUMdU1tXQBRIpJkZAs-BydXDy8zM5sHIJDwqJi45Zxkk-TM7Zy8gqKJSoZQqVRqFDqjWaeTaHS6vX6MTAI0Q9UKzmms2Wi1WMmW8kUhk2Ym2Dg0Wh8uEuiHOjhc7k8%2BG8d38jzCiMGb3eSRS3yyLXy6KBIMq1TKEPqTQFsMQnW6YD6L0GyNGYBMIkimNW83iAF1%2BDr5kA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false)
135
- * New Rule: Intended for developers to stop explicitly writing "void" return type explicitly (developed using ESTree ASTs).
136
- */
137
- {
138
- selector: "FunctionDeclaration > TSTypeAnnotation > TSVoidKeyword",
139
- message: '[FunctionDeclaration] Avoid explicitly declaring a "void" return type.'
140
- },
141
- {
142
- selector: "FunctionExpression > TSTypeAnnotation > TSVoidKeyword",
143
- message: '[FunctionExpression] Avoid explicitly declaring a "void" return type.'
144
- },
145
- {
146
- selector: "TSFunctionType > TSTypeAnnotation > TSVoidKeyword",
147
- message: '[FunctionType] Avoid explicitly declaring a "void" return type.'
148
- }
149
- ]
150
- };
151
- const TYPESCRIPT_ESLINT_CONFIG_RULES = {
152
- // "void" keyword is allowed
153
- // Issue: https://github.com/typescript-eslint/typescript-eslint/issues/7250
154
- // "@typescript-eslint/explicit-function-return-type": ["warn", {
155
- // allowExpressions: true,
156
- // allowTypedFunctionExpressions: true
157
- // }],
158
- "@typescript-eslint/no-explicit-any": "error",
159
- "@typescript-eslint/no-unused-vars": "error",
160
- "@typescript-eslint/prefer-readonly": "error",
161
- "@typescript-eslint/array-type": "error",
162
- "@typescript-eslint/ban-tslint-comment": "error",
163
- "@typescript-eslint/consistent-generic-constructors": [
164
- "error",
165
- "constructor"
166
- ],
167
- "consistent-return": "off",
168
- // "@typescript-eslint/consistent-return": "error",
169
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
170
- "default-param-last": "off",
171
- "@typescript-eslint/default-param-last": "error",
172
- "@typescript-eslint/no-array-delete": "error",
173
- "no-dupe-class-members": "off",
174
- "@typescript-eslint/no-dupe-class-members": "error",
175
- "@typescript-eslint/no-duplicate-enum-values": "error",
176
- "@typescript-eslint/no-deprecated": "error",
177
- "@typescript-eslint/no-dynamic-delete": "error",
178
- "@typescript-eslint/no-extra-non-null-assertion": "error",
179
- "@typescript-eslint/no-for-in-array": "error",
180
- "no-loop-func": "off",
181
- "@typescript-eslint/no-loop-func": "error",
182
- "no-loss-of-precision": "off",
183
- "@typescript-eslint/no-loss-of-precision": "error",
184
- "@typescript-eslint/no-meaningless-void-operator": "error",
185
- "@typescript-eslint/no-misused-new": "error",
186
- "@typescript-eslint/no-mixed-enums": "error",
187
- "@typescript-eslint/no-namespace": "error",
188
- "@typescript-eslint/no-non-null-assertion": "off",
189
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
190
- "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
191
- "no-redeclare": "off",
192
- "@typescript-eslint/no-redeclare": "error",
193
- "@typescript-eslint/no-require-imports": "error",
194
- "@typescript-eslint/no-this-alias": "error",
195
- "@typescript-eslint/no-unnecessary-condition": "error",
196
- "@typescript-eslint/no-unnecessary-qualifier": "error",
197
- "@typescript-eslint/no-unnecessary-template-expression": "error",
198
- "@typescript-eslint/no-unnecessary-type-arguments": "error",
199
- "@typescript-eslint/no-unnecessary-type-constraint": "error",
200
- "@typescript-eslint/no-unsafe-declaration-merging": "error",
201
- "@typescript-eslint/no-unsafe-enum-comparison": "error",
202
- "@typescript-eslint/no-unsafe-function-type": "error",
203
- "@typescript-eslint/no-unsafe-return": "error",
204
- "@typescript-eslint/no-unsafe-unary-minus": "error",
205
- "no-useless-constructor": "off",
206
- "@typescript-eslint/no-useless-constructor": "error",
207
- "@typescript-eslint/no-useless-empty-export": "error",
208
- "@typescript-eslint/no-var-requires": "error",
209
- "@typescript-eslint/no-wrapper-object-types": "error",
210
- "@typescript-eslint/prefer-as-const": "error",
211
- "@typescript-eslint/prefer-find": "error",
212
- "@typescript-eslint/prefer-for-of": "error",
213
- "@typescript-eslint/prefer-function-type": "error",
214
- "@typescript-eslint/prefer-includes": "error",
215
- "@typescript-eslint/prefer-namespace-keyword": "error",
216
- "@typescript-eslint/prefer-nullish-coalescing": "error",
217
- "@typescript-eslint/prefer-optional-chain": "error",
218
- "@typescript-eslint/prefer-string-starts-ends-with": "error",
219
- "@typescript-eslint/related-getter-setter-pairs": "error",
220
- "@typescript-eslint/prefer-ts-expect-error": "error",
221
- "@typescript-eslint/require-array-sort-compare": "error",
222
- "require-await": "off",
223
- "@typescript-eslint/require-await": "error",
224
- "@typescript-eslint/no-invalid-void-type": "error"
225
- // "@typescript-eslint/sort-type-constituents": "error"
226
- };
227
- const UNICORN_ESLINT_CONFIG_RULES = {
228
- "unicorn/no-console-spaces": "error",
229
- "unicorn/no-empty-file": "error",
230
- "unicorn/no-array-for-each": "error",
231
- "unicorn/no-array-push-push": "error",
232
- "unicorn/no-array-reduce": [
233
- "error",
234
- {
235
- allowSimpleOperations: true
236
- }
237
- ],
238
- "unicorn/no-for-loop": "error",
239
- "unicorn/no-instanceof-array": "error",
240
- "unicorn/no-new-array": "error",
241
- "unicorn/no-new-buffer": "error",
242
- "unicorn/no-this-assignment": "error",
243
- "unicorn/prefer-string-slice": "error",
244
- "unicorn/prefer-module": "error",
245
- "unicorn/prefer-string-starts-ends-with": "error",
246
- "unicorn/prefer-string-trim-start-end": "error",
247
- "unicorn/prefer-negative-index": "error",
248
- "unicorn/consistent-existence-index-check": "error",
249
- "unicorn/switch-case-braces": "error",
250
- "unicorn/empty-brace-spaces": "error",
251
- "unicorn/require-number-to-fixed-digits-argument": "error"
252
- };
253
- const SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES = {
254
- "no-console": "error",
255
- "no-debugger": "error"
256
- };
257
- // Annotate the CommonJS export names for ESM import in node:
258
- 0 && (module.exports = {
259
- SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES,
260
- STANDARD_ESLINT_CONFIG_RULES,
261
- TYPESCRIPT_ESLINT_CONFIG_RULES,
262
- UNICORN_ESLINT_CONFIG_RULES
263
- });
@@ -1,236 +0,0 @@
1
- const STANDARD_ESLINT_CONFIG_RULES = {
2
- semi: "error",
3
- "no-console": "warn",
4
- // FE - Warn, BE - Error
5
- "no-debugger": "warn",
6
- // FE - Warn, BE - Error
7
- "no-var": "error",
8
- "no-void": "error",
9
- "prefer-const": "error",
10
- "getter-return": "error",
11
- "no-setter-return": "error",
12
- "no-class-assign": "error",
13
- "no-const-assign": "error",
14
- "no-constant-binary-expression": "error",
15
- "no-dupe-args": "error",
16
- "no-dupe-else-if": "error",
17
- "no-duplicate-case": "error",
18
- "no-duplicate-imports": "error",
19
- "no-ex-assign": "error",
20
- "no-fallthrough": "error",
21
- "no-inner-declarations": "error",
22
- "no-octal": "error",
23
- "no-octal-escape": "error",
24
- "no-nonoctal-decimal-escape": "error",
25
- "no-delete-var": "error",
26
- "no-empty": "error",
27
- // "no-empty-function": "error",
28
- "no-empty-static-block": "error",
29
- "no-eval": "error",
30
- "no-implied-eval": "error",
31
- "no-extend-native": "error",
32
- "no-extra-bind": "error",
33
- "no-extra-boolean-cast": "error",
34
- "no-extra-label": "error",
35
- "no-global-assign": "error",
36
- "no-implicit-coercion": "error",
37
- "no-label-var": "error",
38
- "no-labels": "error",
39
- "no-lone-blocks": "error",
40
- "no-lonely-if": "error",
41
- "no-multi-assign": "error",
42
- "no-nested-ternary": "error",
43
- "no-new": "error",
44
- "no-new-func": "error",
45
- "no-new-wrappers": "error",
46
- "no-param-reassign": "error",
47
- "no-proto": "error",
48
- "no-return-assign": "error",
49
- "no-script-url": "error",
50
- "no-sequences": "error",
51
- "no-compare-neg-zero": "error",
52
- "no-underscore-dangle": "error",
53
- "no-throw-literal": "error",
54
- "no-unused-labels": "error",
55
- "no-undefined": "error",
56
- "no-useless-call": "error",
57
- "no-useless-concat": "error",
58
- "prefer-template": "error",
59
- "no-useless-escape": "error",
60
- "no-useless-return": "error",
61
- "operator-assignment": ["error", "always"],
62
- "prefer-exponentiation-operator": "error",
63
- "prefer-object-has-own": "error",
64
- "require-yield": "error",
65
- yoda: "error",
66
- "no-else-return": [
67
- "error",
68
- {
69
- allowElseIf: true
70
- }
71
- ],
72
- "max-len": [
73
- "error",
74
- {
75
- code: 120,
76
- tabWidth: 2,
77
- ignoreComments: true,
78
- ignoreTrailingComments: true,
79
- ignoreUrls: true,
80
- ignoreStrings: true,
81
- ignoreTemplateLiterals: true
82
- }
83
- ],
84
- "max-lines": [
85
- "error",
86
- {
87
- max: 1e3,
88
- skipBlankLines: true,
89
- skipComments: true
90
- }
91
- ],
92
- "logical-assignment-operators": [
93
- "error",
94
- "always",
95
- { enforceForIfStatements: true }
96
- ],
97
- "no-restricted-syntax": [
98
- "error",
99
- {
100
- selector: "TSEnumDeclaration:not([const=true])",
101
- message: "Avoid declaring non-const enums. Use const-types instead."
102
- },
103
- {
104
- selector: "TSEnumDeclaration[const=true]",
105
- message: "Avoid declaring const enums. Use const-types instead."
106
- },
107
- /**
108
- * @tutorial [No-Explicit-Void-Return-Type](https://typescript-eslint.io/play/#ts=5.7.2&showAST=es&fileType=.tsx&code=GYVwdgxgLglg9mABAZwIYE8ASMAUBKALkQDc4YATRAbwChFEIFk4AbAUwDoW4BzHAImz88AbhoBfGjUZhkUFBmwAmIvkQBeAHwkyldYjVbqdBk1adufQTGFjJ0pvLRYYAZlV4N20hQ2JQkLAIarT0MszsXLwCQqISUhAsqMjIiACCxvTOyvhEPpSh9Kay5lFWsWL0kvZsAB4ADnAATvKJyakAIqhQqADCcAC2jWBsYPKF4VBNINDNIYj29DxsUGksLF09uTq%2BhWFmkZYxNnFV8Q6y8r1JKUp%2BhTxNbCseXplF4aVH1rYm4gA08SAA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQHYHsBaaFAF2gEsBjUxAE0OQE9dSBDAD3TAG1xsciaNHzRIAGn4CsA7JGSIkNUd0gAxWLhoV8uACKIq8NtDakduMAD4wAFQDKtpgAdEAQVwF253dbv2ANXwKOgBpRCYAd1E6CSlZSABbFGQ2AHNEVTcAN2C6MEQOZ3hqClJ4JjBIynNcNLAAHUhckKawElJYaEsAawjo6HyAChJ6ukMASgA6SHiIAF9JWUw5uQUlUhUMdU1tXQBRIpJkZAs-BydXDy8zM5sHIJDwqJi45Zxkk-TM7Zy8gqKJSoZQqVRqFDqjWaeTaHS6vX6MTAI0Q9UKzmms2Wi1WMmW8kUhk2Ym2Dg0Wh8uEuiHOjhc7k8%2BG8d38jzCiMGb3eSRS3yyLXy6KBIMq1TKEPqTQFsMQnW6YD6L0GyNGYBMIkimNW83iAF1%2BDr5kA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false)
109
- * New Rule: Intended for developers to stop explicitly writing "void" return type explicitly (developed using ESTree ASTs).
110
- */
111
- {
112
- selector: "FunctionDeclaration > TSTypeAnnotation > TSVoidKeyword",
113
- message: '[FunctionDeclaration] Avoid explicitly declaring a "void" return type.'
114
- },
115
- {
116
- selector: "FunctionExpression > TSTypeAnnotation > TSVoidKeyword",
117
- message: '[FunctionExpression] Avoid explicitly declaring a "void" return type.'
118
- },
119
- {
120
- selector: "TSFunctionType > TSTypeAnnotation > TSVoidKeyword",
121
- message: '[FunctionType] Avoid explicitly declaring a "void" return type.'
122
- }
123
- ]
124
- };
125
- const TYPESCRIPT_ESLINT_CONFIG_RULES = {
126
- // "void" keyword is allowed
127
- // Issue: https://github.com/typescript-eslint/typescript-eslint/issues/7250
128
- // "@typescript-eslint/explicit-function-return-type": ["warn", {
129
- // allowExpressions: true,
130
- // allowTypedFunctionExpressions: true
131
- // }],
132
- "@typescript-eslint/no-explicit-any": "error",
133
- "@typescript-eslint/no-unused-vars": "error",
134
- "@typescript-eslint/prefer-readonly": "error",
135
- "@typescript-eslint/array-type": "error",
136
- "@typescript-eslint/ban-tslint-comment": "error",
137
- "@typescript-eslint/consistent-generic-constructors": [
138
- "error",
139
- "constructor"
140
- ],
141
- "consistent-return": "off",
142
- // "@typescript-eslint/consistent-return": "error",
143
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
144
- "default-param-last": "off",
145
- "@typescript-eslint/default-param-last": "error",
146
- "@typescript-eslint/no-array-delete": "error",
147
- "no-dupe-class-members": "off",
148
- "@typescript-eslint/no-dupe-class-members": "error",
149
- "@typescript-eslint/no-duplicate-enum-values": "error",
150
- "@typescript-eslint/no-deprecated": "error",
151
- "@typescript-eslint/no-dynamic-delete": "error",
152
- "@typescript-eslint/no-extra-non-null-assertion": "error",
153
- "@typescript-eslint/no-for-in-array": "error",
154
- "no-loop-func": "off",
155
- "@typescript-eslint/no-loop-func": "error",
156
- "no-loss-of-precision": "off",
157
- "@typescript-eslint/no-loss-of-precision": "error",
158
- "@typescript-eslint/no-meaningless-void-operator": "error",
159
- "@typescript-eslint/no-misused-new": "error",
160
- "@typescript-eslint/no-mixed-enums": "error",
161
- "@typescript-eslint/no-namespace": "error",
162
- "@typescript-eslint/no-non-null-assertion": "off",
163
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
164
- "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
165
- "no-redeclare": "off",
166
- "@typescript-eslint/no-redeclare": "error",
167
- "@typescript-eslint/no-require-imports": "error",
168
- "@typescript-eslint/no-this-alias": "error",
169
- "@typescript-eslint/no-unnecessary-condition": "error",
170
- "@typescript-eslint/no-unnecessary-qualifier": "error",
171
- "@typescript-eslint/no-unnecessary-template-expression": "error",
172
- "@typescript-eslint/no-unnecessary-type-arguments": "error",
173
- "@typescript-eslint/no-unnecessary-type-constraint": "error",
174
- "@typescript-eslint/no-unsafe-declaration-merging": "error",
175
- "@typescript-eslint/no-unsafe-enum-comparison": "error",
176
- "@typescript-eslint/no-unsafe-function-type": "error",
177
- "@typescript-eslint/no-unsafe-return": "error",
178
- "@typescript-eslint/no-unsafe-unary-minus": "error",
179
- "no-useless-constructor": "off",
180
- "@typescript-eslint/no-useless-constructor": "error",
181
- "@typescript-eslint/no-useless-empty-export": "error",
182
- "@typescript-eslint/no-var-requires": "error",
183
- "@typescript-eslint/no-wrapper-object-types": "error",
184
- "@typescript-eslint/prefer-as-const": "error",
185
- "@typescript-eslint/prefer-find": "error",
186
- "@typescript-eslint/prefer-for-of": "error",
187
- "@typescript-eslint/prefer-function-type": "error",
188
- "@typescript-eslint/prefer-includes": "error",
189
- "@typescript-eslint/prefer-namespace-keyword": "error",
190
- "@typescript-eslint/prefer-nullish-coalescing": "error",
191
- "@typescript-eslint/prefer-optional-chain": "error",
192
- "@typescript-eslint/prefer-string-starts-ends-with": "error",
193
- "@typescript-eslint/related-getter-setter-pairs": "error",
194
- "@typescript-eslint/prefer-ts-expect-error": "error",
195
- "@typescript-eslint/require-array-sort-compare": "error",
196
- "require-await": "off",
197
- "@typescript-eslint/require-await": "error",
198
- "@typescript-eslint/no-invalid-void-type": "error"
199
- // "@typescript-eslint/sort-type-constituents": "error"
200
- };
201
- const UNICORN_ESLINT_CONFIG_RULES = {
202
- "unicorn/no-console-spaces": "error",
203
- "unicorn/no-empty-file": "error",
204
- "unicorn/no-array-for-each": "error",
205
- "unicorn/no-array-push-push": "error",
206
- "unicorn/no-array-reduce": [
207
- "error",
208
- {
209
- allowSimpleOperations: true
210
- }
211
- ],
212
- "unicorn/no-for-loop": "error",
213
- "unicorn/no-instanceof-array": "error",
214
- "unicorn/no-new-array": "error",
215
- "unicorn/no-new-buffer": "error",
216
- "unicorn/no-this-assignment": "error",
217
- "unicorn/prefer-string-slice": "error",
218
- "unicorn/prefer-module": "error",
219
- "unicorn/prefer-string-starts-ends-with": "error",
220
- "unicorn/prefer-string-trim-start-end": "error",
221
- "unicorn/prefer-negative-index": "error",
222
- "unicorn/consistent-existence-index-check": "error",
223
- "unicorn/switch-case-braces": "error",
224
- "unicorn/empty-brace-spaces": "error",
225
- "unicorn/require-number-to-fixed-digits-argument": "error"
226
- };
227
- const SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES = {
228
- "no-console": "error",
229
- "no-debugger": "error"
230
- };
231
- export {
232
- SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES,
233
- STANDARD_ESLINT_CONFIG_RULES,
234
- TYPESCRIPT_ESLINT_CONFIG_RULES,
235
- UNICORN_ESLINT_CONFIG_RULES
236
- };
@@ -1 +0,0 @@
1
- export { SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES } from './eslint.rules.mjs';
@@ -1 +0,0 @@
1
- export { SERVER_NODE_EXPRESS_ESLINT_CONFIG_RULES, STANDARD_ESLINT_CONFIG_RULES, TYPESCRIPT_ESLINT_CONFIG_RULES, UNICORN_ESLINT_CONFIG_RULES } from './eslint.rules.js';
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var eslint_rules_exports = {};
17
- module.exports = __toCommonJS(eslint_rules_exports);
18
- __reExport(eslint_rules_exports, require("./eslint.rules"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./eslint.rules")
22
- });
@@ -1 +0,0 @@
1
- export * from "./eslint.rules";