@storm-software/eslint 0.0.1 → 0.2.0
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/CHANGELOG.md +22 -0
- package/{base.cjs → base.js} +1 -27
- package/{graphql.cjs → graphql.js} +1 -25
- package/index.js +1465 -0
- package/{javascript.cjs → javascript.js} +2 -31
- package/jest.js +12 -0
- package/{json.cjs → json.js} +1 -27
- package/{mdx.cjs → mdx.js} +1 -27
- package/meta.json +1 -1
- package/{next.cjs → next.js} +1 -14
- package/package.json +6 -6
- package/packages/eslint/src/base.d.ts +1 -0
- package/packages/eslint/src/constants.d.ts +20 -0
- package/packages/eslint/src/graphql.d.ts +1 -0
- package/packages/eslint/src/index.d.ts +19 -0
- package/packages/eslint/src/javascript.d.ts +1 -0
- package/packages/eslint/src/jest.d.ts +1 -0
- package/packages/eslint/src/json.d.ts +1 -0
- package/packages/eslint/src/mdx.d.ts +1 -0
- package/packages/eslint/src/next.d.ts +1 -0
- package/packages/eslint/src/nx.d.ts +1 -0
- package/packages/eslint/src/react.d.ts +1 -0
- package/packages/eslint/src/recommended.d.ts +1 -0
- package/packages/eslint/src/rules/import.d.ts +3 -0
- package/packages/eslint/src/rules/jsx-a11y.d.ts +3 -0
- package/packages/eslint/src/rules/react.d.ts +3 -0
- package/packages/eslint/src/rules/storm.d.ts +3 -0
- package/packages/eslint/src/rules/ts-docs.d.ts +3 -0
- package/packages/eslint/src/rules/unicorn.d.ts +3 -0
- package/packages/eslint/src/typescript.d.ts +1 -0
- package/packages/eslint/src/yml.d.ts +1 -0
- package/{react.cjs → react.js} +1 -28
- package/{recommended.cjs → recommended.js} +1 -27
- package/{typescript.cjs → typescript.js} +2 -31
- package/{yml.cjs → yml.js} +1 -27
- package/index.cjs +0 -949
- package/jest.cjs +0 -36
package/index.js
ADDED
|
@@ -0,0 +1,1465 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __esm = (fn, res) => function __init() {
|
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
+
};
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
|
|
36
|
+
// packages/eslint/src/constants.ts
|
|
37
|
+
var RESTRICTED_SYNTAX, REACT_RESTRICTED_SYNTAX, RESTRICTED_GLOBALS, RESTRICTED_MODULES, JS_FILES, CODE_BLOCK, CODE_FILE, TS_FILE;
|
|
38
|
+
var init_constants = __esm({
|
|
39
|
+
"packages/eslint/src/constants.ts"() {
|
|
40
|
+
RESTRICTED_SYNTAX = [
|
|
41
|
+
{
|
|
42
|
+
// ❌ readFile(…, { encoding: … })
|
|
43
|
+
selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
|
|
44
|
+
message: "Specify encoding as last argument instead of object with encoding key"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
// ❌ readFile(…, {})
|
|
48
|
+
selector: "CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
|
|
49
|
+
message: "Specify encoding as last argument"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
// ❌ readFileSync(…).toString(…)
|
|
53
|
+
selector: "CallExpression[callee.name=readFileSync][parent.property.name=toString]",
|
|
54
|
+
message: "toString is redundant, specify encoding as last argument"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
// ❌ ….readFile(…, { encoding: … })
|
|
58
|
+
selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]",
|
|
59
|
+
message: "Specify encoding as last argument instead of object with encoding key"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
// ❌ ….readFile(…, {})
|
|
63
|
+
selector: "CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]",
|
|
64
|
+
message: "Specify encoding as last argument"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
// ❌ Boolean(…)
|
|
68
|
+
selector: "CallExpression[callee.name=Boolean][arguments.1.elements.length!=0]",
|
|
69
|
+
message: "Prefer `!!\u2026` over `Boolean(\u2026)` because TypeScript infers a narrow literal boolean `type: true` instead of `type: boolean`."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
// ❌ process.browser
|
|
73
|
+
selector: "ExpressionStatement[expression.object.name=process][expression.property.name=browser]",
|
|
74
|
+
message: "`process.browser` is deprecated, use `!!globalThis.window`"
|
|
75
|
+
}
|
|
76
|
+
// {
|
|
77
|
+
// // ❌ let { foo: { bar } } = baz
|
|
78
|
+
// // ✅ let { bar } = baz.foo
|
|
79
|
+
// // ✅ let { foo: { bar } } = await baz
|
|
80
|
+
// selector:
|
|
81
|
+
// 'VariableDeclarator[init.type!=AwaitExpression] > ObjectPattern[properties.length=1][properties.0.value.type=ObjectPattern]',
|
|
82
|
+
// message: 'Do not use nested destructuring.',
|
|
83
|
+
// },
|
|
84
|
+
];
|
|
85
|
+
REACT_RESTRICTED_SYNTAX = [
|
|
86
|
+
...RESTRICTED_SYNTAX,
|
|
87
|
+
{
|
|
88
|
+
// ❌ useMemo(…, [])
|
|
89
|
+
selector: "CallExpression[callee.name=useMemo][arguments.1.type=ArrayExpression][arguments.1.elements.length=0]",
|
|
90
|
+
message: "`useMemo` with an empty dependency array can't provide a stable reference, use `useRef` instead."
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
RESTRICTED_GLOBALS = [
|
|
94
|
+
"stop",
|
|
95
|
+
{ name: "isNaN", message: "Use Number.isNaN instead" }
|
|
96
|
+
];
|
|
97
|
+
RESTRICTED_MODULES = [
|
|
98
|
+
{ name: "axios", message: "Use `fetch/node-fetch` instead." },
|
|
99
|
+
{ name: "moment", message: "Use `dayjs/date-fns` instead." },
|
|
100
|
+
{ name: "classnames", message: "Use `clsx` instead because it is faster." },
|
|
101
|
+
{
|
|
102
|
+
name: "lodash/isString.js",
|
|
103
|
+
message: "Use `typeof yourVar === 'string'` instead."
|
|
104
|
+
},
|
|
105
|
+
{ name: "lodash/isArray.js", message: "Use `Array.isArray` instead." },
|
|
106
|
+
{ name: "lodash/flatten.js", message: "Use `Array#flat()` instead." },
|
|
107
|
+
{
|
|
108
|
+
name: "lodash/compact.js",
|
|
109
|
+
message: "Use `Array#filter(Boolean)` instead."
|
|
110
|
+
},
|
|
111
|
+
{ name: "lodash/identity.js", message: "Use `(value) => value` instead." }
|
|
112
|
+
];
|
|
113
|
+
JS_FILES = ["*.js?(x)", "*.mjs"];
|
|
114
|
+
CODE_BLOCK = "**/*.md{,x}/*";
|
|
115
|
+
CODE_FILE = "*.{,c,m}{j,t}s{,x}";
|
|
116
|
+
TS_FILE = "*.{,c,m}ts{,x}";
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// packages/eslint/src/base.ts
|
|
121
|
+
var require_base = __commonJS({
|
|
122
|
+
"packages/eslint/src/base.ts"(exports2, module2) {
|
|
123
|
+
init_constants();
|
|
124
|
+
module2.exports = {
|
|
125
|
+
parser: "@typescript-eslint/parser",
|
|
126
|
+
extends: [
|
|
127
|
+
"eslint:recommended",
|
|
128
|
+
"plugin:@typescript-eslint/recommended",
|
|
129
|
+
"prettier"
|
|
130
|
+
],
|
|
131
|
+
plugins: ["sonarjs", "unicorn", "promise", "import", "n"],
|
|
132
|
+
rules: {
|
|
133
|
+
// Disallows if statements as the only statement in else blocks
|
|
134
|
+
// https://eslint.org/docs/rules/no-lonely-if
|
|
135
|
+
"no-lonely-if": "error",
|
|
136
|
+
// Disallows the use of console
|
|
137
|
+
// https://eslint.org/docs/rules/no-console
|
|
138
|
+
"no-console": "error",
|
|
139
|
+
// Requires method and property shorthand syntax for object literals
|
|
140
|
+
// https://eslint.org/docs/rules/object-shorthand
|
|
141
|
+
"object-shorthand": ["error", "always"],
|
|
142
|
+
// Disallows loops with a body that allows only one iteration
|
|
143
|
+
// https://eslint.org/docs/rules/no-unreachable-loop
|
|
144
|
+
"no-unreachable-loop": "error",
|
|
145
|
+
"sonarjs/no-one-iteration-loop": "off",
|
|
146
|
+
// similar to 'no-unreachable-loop' but reports less cases
|
|
147
|
+
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
|
|
148
|
+
"sonarjs/no-unused-collection": "error",
|
|
149
|
+
"sonarjs/no-identical-conditions": "error",
|
|
150
|
+
"sonarjs/no-inverted-boolean-check": "error",
|
|
151
|
+
"sonarjs/no-use-of-empty-return-value": "error",
|
|
152
|
+
"sonarjs/no-gratuitous-expressions": "error",
|
|
153
|
+
"sonarjs/no-nested-switch": "error",
|
|
154
|
+
"unicorn/no-lonely-if": "error",
|
|
155
|
+
"sonarjs/no-collapsible-if": "off",
|
|
156
|
+
// same as 'unicorn/no-lonely-if'
|
|
157
|
+
"unicorn/no-array-push-push": "error",
|
|
158
|
+
"unicorn/no-instanceof-array": "error",
|
|
159
|
+
"unicorn/no-empty-file": "error",
|
|
160
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
161
|
+
"unicorn/prefer-array-find": "error",
|
|
162
|
+
"unicorn/no-useless-spread": "error",
|
|
163
|
+
"unicorn/prefer-includes": "error",
|
|
164
|
+
// Disallows specified syntax
|
|
165
|
+
// https://eslint.org/docs/rules/no-restricted-syntax
|
|
166
|
+
"no-restricted-syntax": ["error", ...RESTRICTED_SYNTAX],
|
|
167
|
+
"no-else-return": ["error", { allowElseIf: false }],
|
|
168
|
+
"promise/no-nesting": "error",
|
|
169
|
+
"import/extensions": ["error", "ignorePackages"],
|
|
170
|
+
// Bob when bundling requires to have `.js` extension
|
|
171
|
+
"import/no-default-export": "error",
|
|
172
|
+
"import/prefer-default-export": "off",
|
|
173
|
+
// disable opposite of 'import/no-default-export'
|
|
174
|
+
"unicorn/filename-case": "error",
|
|
175
|
+
"@typescript-eslint/no-unused-vars": [
|
|
176
|
+
"error",
|
|
177
|
+
{
|
|
178
|
+
argsIgnorePattern: "^_",
|
|
179
|
+
varsIgnorePattern: "^_"
|
|
180
|
+
// allow underscores in destructuring
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
// Enforce the style of numeric separators by correctly grouping digits
|
|
184
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
|
|
185
|
+
"unicorn/numeric-separators-style": "error",
|
|
186
|
+
// Prefer using the node: protocol when importing Node.js builtin modules
|
|
187
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
188
|
+
"unicorn/prefer-node-protocol": "error",
|
|
189
|
+
// Reports any imports that come after non-import statements
|
|
190
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
191
|
+
"import/first": "error",
|
|
192
|
+
// Disallow shorthand type conversions
|
|
193
|
+
// https://eslint.org/docs/latest/rules/no-implicit-coercion
|
|
194
|
+
"no-implicit-coercion": [
|
|
195
|
+
"error",
|
|
196
|
+
{
|
|
197
|
+
disallowTemplateShorthand: true,
|
|
198
|
+
// in TypeScript `!!` is preferable https://www.typescriptlang.org/docs/handbook/2/narrowing.html#truthiness-narrowing
|
|
199
|
+
boolean: false
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
// Disallow specified modules when loaded by `import` declarations
|
|
203
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md
|
|
204
|
+
"n/no-restricted-import": ["error", RESTRICTED_MODULES],
|
|
205
|
+
// Disallow specified modules when loaded by require
|
|
206
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-require.md
|
|
207
|
+
"n/no-restricted-require": ["error", RESTRICTED_MODULES],
|
|
208
|
+
"no-restricted-modules": "off",
|
|
209
|
+
// deprecated in favor of corresponding rules from `eslint-plugin-n`
|
|
210
|
+
// Disallow specified global variables
|
|
211
|
+
// https://eslint.org/docs/latest/rules/no-restricted-globals
|
|
212
|
+
"no-restricted-globals": ["error", ...RESTRICTED_GLOBALS],
|
|
213
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
214
|
+
"prefer-const": ["error", { destructuring: "all" }],
|
|
215
|
+
"import/no-duplicates": "error",
|
|
216
|
+
"import/newline-after-import": "off",
|
|
217
|
+
// prettified by prettier-plugin-sort-imports
|
|
218
|
+
"prefer-object-has-own": "error",
|
|
219
|
+
"logical-assignment-operators": [
|
|
220
|
+
"error",
|
|
221
|
+
"always",
|
|
222
|
+
{ enforceForIfStatements: true }
|
|
223
|
+
],
|
|
224
|
+
yoda: "error",
|
|
225
|
+
"unicorn/prefer-export-from": ["error", { ignoreUsedVariables: true }],
|
|
226
|
+
"promise/no-multiple-resolved": "error",
|
|
227
|
+
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
228
|
+
"no-unused-expressions": "off",
|
|
229
|
+
"@typescript-eslint/no-unused-expressions": "error",
|
|
230
|
+
"no-negated-condition": "off",
|
|
231
|
+
"unicorn/no-negated-condition": "error",
|
|
232
|
+
// has autofix
|
|
233
|
+
"unicorn/no-array-for-each": "error",
|
|
234
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
235
|
+
"no-self-compare": "error",
|
|
236
|
+
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
237
|
+
"import/no-useless-path-segments": "error",
|
|
238
|
+
// 'prefer-destructuring': [ // TODO: Rediscuss later
|
|
239
|
+
// 'error',
|
|
240
|
+
// {
|
|
241
|
+
// VariableDeclarator: { array: false, object: true },
|
|
242
|
+
// AssignmentExpression: { array: true, object: false },
|
|
243
|
+
// },
|
|
244
|
+
// { enforceForRenamedProperties: false },
|
|
245
|
+
// ],
|
|
246
|
+
"require-await": "off",
|
|
247
|
+
// Disallow async functions which have no await expression
|
|
248
|
+
// https://typescript-eslint.io/rules/require-await/
|
|
249
|
+
// '@typescript-eslint/require-await': 'error', // TODO: enable
|
|
250
|
+
"no-return-await": "off"
|
|
251
|
+
// Enforce consistent returning of awaited values.
|
|
252
|
+
// https://typescript-eslint.io/rules/return-await/
|
|
253
|
+
// '@typescript-eslint/return-await': 'error', // TODO: enable
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// packages/eslint/src/json.ts
|
|
260
|
+
var require_json = __commonJS({
|
|
261
|
+
"packages/eslint/src/json.ts"(exports2, module2) {
|
|
262
|
+
init_constants();
|
|
263
|
+
var JSONC_FILES = [
|
|
264
|
+
"tsconfig.json",
|
|
265
|
+
"tsconfig.base.json",
|
|
266
|
+
"nx.json",
|
|
267
|
+
".vscode/launch.json"
|
|
268
|
+
];
|
|
269
|
+
module2.exports = {
|
|
270
|
+
root: true,
|
|
271
|
+
overrides: [
|
|
272
|
+
{
|
|
273
|
+
files: "*.json",
|
|
274
|
+
excludedFiles: JSONC_FILES,
|
|
275
|
+
extends: "plugin:jsonc/recommended-with-json"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"files": ["**/executors/**/schema.json", "**/generators/**/schema.json"],
|
|
279
|
+
"parser": "jsonc-eslint-parser",
|
|
280
|
+
"rules": {
|
|
281
|
+
"@nx/workspace/valid-schema-description": "error"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
files: ["*.jsonc", ...JSONC_FILES],
|
|
286
|
+
extends: "plugin:jsonc/recommended-with-jsonc"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
files: "*.json5",
|
|
290
|
+
extends: "plugin:jsonc/recommended-with-json5"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
files: "*.json{,c,5}",
|
|
294
|
+
excludedFiles: CODE_BLOCK,
|
|
295
|
+
plugins: ["unicorn"],
|
|
296
|
+
rules: {
|
|
297
|
+
"unicorn/filename-case": "error"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// packages/eslint/src/next.ts
|
|
306
|
+
var require_next = __commonJS({
|
|
307
|
+
"packages/eslint/src/next.ts"(exports2, module2) {
|
|
308
|
+
init_constants();
|
|
309
|
+
var babelOptions = {
|
|
310
|
+
presets: (() => {
|
|
311
|
+
try {
|
|
312
|
+
require.resolve("next/babel");
|
|
313
|
+
return ["next/babel"];
|
|
314
|
+
} catch (_e) {
|
|
315
|
+
return [];
|
|
316
|
+
}
|
|
317
|
+
})()
|
|
318
|
+
};
|
|
319
|
+
module2.exports = {
|
|
320
|
+
root: true,
|
|
321
|
+
ignorePatterns: ["next-env.d.ts"],
|
|
322
|
+
extends: ["plugin:@next/next/recommended"],
|
|
323
|
+
overrides: [
|
|
324
|
+
{
|
|
325
|
+
files: CODE_FILE,
|
|
326
|
+
extends: "./react-base"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
files: [
|
|
330
|
+
"**/pages/**",
|
|
331
|
+
// Next.js pages directory use default export
|
|
332
|
+
"next.config.{js,mjs}",
|
|
333
|
+
"**/*.stories.tsx",
|
|
334
|
+
".storybook/main.ts"
|
|
335
|
+
],
|
|
336
|
+
rules: {
|
|
337
|
+
"import/no-default-export": "off"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
files: ["next.config.{js,mjs}"],
|
|
342
|
+
env: {
|
|
343
|
+
node: true
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
files: JS_FILES,
|
|
348
|
+
parserOptions: { babelOptions }
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// packages/eslint/src/recommended.ts
|
|
356
|
+
var require_recommended = __commonJS({
|
|
357
|
+
"packages/eslint/src/recommended.ts"(exports2, module2) {
|
|
358
|
+
init_constants();
|
|
359
|
+
module2.exports = {
|
|
360
|
+
extends: [
|
|
361
|
+
"./base",
|
|
362
|
+
"./nx",
|
|
363
|
+
"./json",
|
|
364
|
+
"./yml",
|
|
365
|
+
"./javascript",
|
|
366
|
+
"./typescript",
|
|
367
|
+
"./react",
|
|
368
|
+
"./next"
|
|
369
|
+
],
|
|
370
|
+
reportUnusedDisableDirectives: true,
|
|
371
|
+
ignorePatterns: [
|
|
372
|
+
"!.*",
|
|
373
|
+
// Don't ignore dot-files because by default ESLint ignore dot-files (except for .eslintrc.*) and dot-folders
|
|
374
|
+
".git"
|
|
375
|
+
],
|
|
376
|
+
overrides: [
|
|
377
|
+
{
|
|
378
|
+
files: CODE_FILE,
|
|
379
|
+
extends: "./base"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
// Rules which require type info and exclude virtual ts files extracted by `eslint-plugin-mdx`
|
|
383
|
+
files: TS_FILE,
|
|
384
|
+
excludedFiles: [CODE_BLOCK],
|
|
385
|
+
rules: {
|
|
386
|
+
"@typescript-eslint/prefer-optional-chain": "error"
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
files: TS_FILE,
|
|
391
|
+
rules: {
|
|
392
|
+
"@typescript-eslint/consistent-type-assertions": "error"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
files: ["*.c{j,t}s"],
|
|
397
|
+
env: { node: true },
|
|
398
|
+
rules: { "@typescript-eslint/no-var-requires": "off" }
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
files: [
|
|
402
|
+
"jest.config.js",
|
|
403
|
+
"webpack.config.js",
|
|
404
|
+
"bob.config.js",
|
|
405
|
+
"babel.config.js",
|
|
406
|
+
"postcss.config.{js,cjs}",
|
|
407
|
+
"rollup.config.js",
|
|
408
|
+
"next-sitemap.config.js"
|
|
409
|
+
],
|
|
410
|
+
env: { node: true }
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
files: ["*.{spec,test}.*"],
|
|
414
|
+
env: { jest: true },
|
|
415
|
+
rules: { "import/extensions": ["error", "never"] }
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
files: [
|
|
419
|
+
"vite.config.ts",
|
|
420
|
+
"jest.config.js",
|
|
421
|
+
"*.d.ts",
|
|
422
|
+
"website/theme.config.tsx",
|
|
423
|
+
"tsup.config.ts",
|
|
424
|
+
"postcss.config.ts",
|
|
425
|
+
"tailwind.config.ts",
|
|
426
|
+
"next-sitemap.config.js"
|
|
427
|
+
],
|
|
428
|
+
rules: { "import/no-default-export": "off" }
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
files: ["*.d.ts"],
|
|
432
|
+
rules: {
|
|
433
|
+
"no-var": "off"
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
"globals": {
|
|
438
|
+
"BigInt": true
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// packages/eslint/src/rules/react.ts
|
|
445
|
+
var config, react_default;
|
|
446
|
+
var init_react = __esm({
|
|
447
|
+
"packages/eslint/src/rules/react.ts"() {
|
|
448
|
+
config = {
|
|
449
|
+
// We recommend using TypeScript over `prop-types`, as `prop-types` can add
|
|
450
|
+
// to a project's build size.
|
|
451
|
+
"react/prop-types": "off",
|
|
452
|
+
// Disable requiring React to be imported, as this is no longer required.
|
|
453
|
+
"react/react-in-jsx-scope": "off",
|
|
454
|
+
/**
|
|
455
|
+
* Require an explicit type when using button elements.
|
|
456
|
+
*
|
|
457
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
|
|
458
|
+
*/
|
|
459
|
+
"react/button-has-type": "warn",
|
|
460
|
+
/**
|
|
461
|
+
* Require consistent function type for function components.
|
|
462
|
+
*
|
|
463
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md
|
|
464
|
+
*/
|
|
465
|
+
"react/function-component-definition": "warn",
|
|
466
|
+
/**
|
|
467
|
+
* Require destructuring and symmetric naming of `useState` hook value and setter variables.
|
|
468
|
+
*
|
|
469
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
|
|
470
|
+
*/
|
|
471
|
+
"react/hook-use-state": "warn",
|
|
472
|
+
/**
|
|
473
|
+
* Require consistent boolean attributes notation in JSX.
|
|
474
|
+
*
|
|
475
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
|
|
476
|
+
*/
|
|
477
|
+
"react/jsx-boolean-value": "warn",
|
|
478
|
+
/**
|
|
479
|
+
* Disallow unnecessary curly braces in JSX props and children.
|
|
480
|
+
*
|
|
481
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
|
|
482
|
+
*/
|
|
483
|
+
"react/jsx-curly-brace-presence": "warn",
|
|
484
|
+
/**
|
|
485
|
+
* Require using shorthand form for React fragments, unless required.
|
|
486
|
+
*
|
|
487
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
|
|
488
|
+
*/
|
|
489
|
+
"react/jsx-fragments": "warn",
|
|
490
|
+
/**
|
|
491
|
+
* Prevent problematic leaked values from being rendered.
|
|
492
|
+
*
|
|
493
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
|
|
494
|
+
*/
|
|
495
|
+
"react/jsx-no-leaked-render": "warn",
|
|
496
|
+
/**
|
|
497
|
+
* Prevents usage of unsafe `target='_blank'`.
|
|
498
|
+
*
|
|
499
|
+
* This rule is a part of `react/recommended`, but we've modified it to
|
|
500
|
+
* allow referrer.
|
|
501
|
+
*
|
|
502
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
|
|
503
|
+
*/
|
|
504
|
+
"react/jsx-no-target-blank": [
|
|
505
|
+
"error",
|
|
506
|
+
{
|
|
507
|
+
allowReferrer: true
|
|
508
|
+
}
|
|
509
|
+
],
|
|
510
|
+
/**
|
|
511
|
+
* Disallow empty React fragments.
|
|
512
|
+
*
|
|
513
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
|
|
514
|
+
*/
|
|
515
|
+
"react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
|
|
516
|
+
/**
|
|
517
|
+
* Require the use of PascalCase for user-defined JSX components.
|
|
518
|
+
*
|
|
519
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
|
|
520
|
+
*/
|
|
521
|
+
"react/jsx-pascal-case": "warn",
|
|
522
|
+
/**
|
|
523
|
+
* Require props to be sorted alphabetically.
|
|
524
|
+
*
|
|
525
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
|
|
526
|
+
*/
|
|
527
|
+
"react/jsx-sort-props": "warn",
|
|
528
|
+
/**
|
|
529
|
+
* Disallow usage of Array index in keys.
|
|
530
|
+
*
|
|
531
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
|
|
532
|
+
*/
|
|
533
|
+
"react/no-array-index-key": "warn",
|
|
534
|
+
/**
|
|
535
|
+
* Disallow creating unstable components inside components.
|
|
536
|
+
*
|
|
537
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
|
|
538
|
+
*/
|
|
539
|
+
"react/no-unstable-nested-components": "error",
|
|
540
|
+
/**
|
|
541
|
+
* Disallow closing tags for components without children.
|
|
542
|
+
*
|
|
543
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
|
|
544
|
+
*/
|
|
545
|
+
"react/self-closing-comp": "warn"
|
|
546
|
+
};
|
|
547
|
+
react_default = config;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
// packages/eslint/src/rules/ts-docs.ts
|
|
552
|
+
var config2, ts_docs_default;
|
|
553
|
+
var init_ts_docs = __esm({
|
|
554
|
+
"packages/eslint/src/rules/ts-docs.ts"() {
|
|
555
|
+
config2 = {
|
|
556
|
+
/**
|
|
557
|
+
* Require TSDoc comments conform to the TSDoc specification.
|
|
558
|
+
*
|
|
559
|
+
* 🚫 Not fixable - https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
|
|
560
|
+
*/
|
|
561
|
+
"tsdoc/syntax": "error"
|
|
562
|
+
};
|
|
563
|
+
ts_docs_default = config2;
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
// packages/eslint/src/react.ts
|
|
568
|
+
var require_react = __commonJS({
|
|
569
|
+
"packages/eslint/src/react.ts"(exports2, module2) {
|
|
570
|
+
init_react();
|
|
571
|
+
init_ts_docs();
|
|
572
|
+
module2.exports = {
|
|
573
|
+
extends: [
|
|
574
|
+
"plugin:react/recommended",
|
|
575
|
+
"plugin:react-hooks/recommended",
|
|
576
|
+
"plugin:jsx-a11y/recommended",
|
|
577
|
+
"plugin:import/react",
|
|
578
|
+
"prettier"
|
|
579
|
+
],
|
|
580
|
+
settings: {
|
|
581
|
+
react: {
|
|
582
|
+
version: "detect"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
rules: {
|
|
586
|
+
...ts_docs_default,
|
|
587
|
+
...react_default
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
// packages/eslint/src/rules/import.ts
|
|
594
|
+
var config3, import_default;
|
|
595
|
+
var init_import = __esm({
|
|
596
|
+
"packages/eslint/src/rules/import.ts"() {
|
|
597
|
+
config3 = {
|
|
598
|
+
/**
|
|
599
|
+
* Disallow non-import statements appearing before import statements.
|
|
600
|
+
*
|
|
601
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
602
|
+
*/
|
|
603
|
+
"import/first": "error",
|
|
604
|
+
/**
|
|
605
|
+
* Require a newline after the last import/require.
|
|
606
|
+
*
|
|
607
|
+
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
|
|
608
|
+
*/
|
|
609
|
+
"import/newline-after-import": "warn",
|
|
610
|
+
/**
|
|
611
|
+
* Disallow import of modules using absolute paths.
|
|
612
|
+
*
|
|
613
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
|
|
614
|
+
*/
|
|
615
|
+
"import/no-absolute-path": "error",
|
|
616
|
+
/**
|
|
617
|
+
* Disallow cyclical dependencies between modules.
|
|
618
|
+
*
|
|
619
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
|
|
620
|
+
*/
|
|
621
|
+
"import/no-cycle": "error",
|
|
622
|
+
/**
|
|
623
|
+
* Disallow default exports.
|
|
624
|
+
*
|
|
625
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
|
|
626
|
+
*/
|
|
627
|
+
"import/no-default-export": "error",
|
|
628
|
+
/**
|
|
629
|
+
* Disallow the use of extraneous packages.
|
|
630
|
+
*
|
|
631
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
632
|
+
*/
|
|
633
|
+
"import/no-extraneous-dependencies": ["error", { includeInternal: true, includeTypes: true }],
|
|
634
|
+
/**
|
|
635
|
+
* Disallow mutable exports.
|
|
636
|
+
*
|
|
637
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
|
|
638
|
+
*/
|
|
639
|
+
"import/no-mutable-exports": "error",
|
|
640
|
+
/**
|
|
641
|
+
* Disallow importing packages through relative paths.
|
|
642
|
+
*
|
|
643
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
|
|
644
|
+
*/
|
|
645
|
+
"import/no-relative-packages": "warn",
|
|
646
|
+
/**
|
|
647
|
+
* Disallow a module from importing itself.
|
|
648
|
+
*
|
|
649
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
|
|
650
|
+
*/
|
|
651
|
+
"import/no-self-import": "error",
|
|
652
|
+
/**
|
|
653
|
+
* Ensures that there are no useless path segments.
|
|
654
|
+
*
|
|
655
|
+
* 🚫 Not fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
|
|
656
|
+
*/
|
|
657
|
+
"import/no-useless-path-segments": ["error"],
|
|
658
|
+
/**
|
|
659
|
+
* Enforce a module import order convention.
|
|
660
|
+
*
|
|
661
|
+
* 🔧 Fixable - https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
662
|
+
*/
|
|
663
|
+
"import/order": [
|
|
664
|
+
"warn",
|
|
665
|
+
{
|
|
666
|
+
groups: [
|
|
667
|
+
"builtin",
|
|
668
|
+
// Node.js built-in modules
|
|
669
|
+
"external",
|
|
670
|
+
// Packages
|
|
671
|
+
"internal",
|
|
672
|
+
// Aliased modules
|
|
673
|
+
"parent",
|
|
674
|
+
// Relative parent
|
|
675
|
+
"sibling",
|
|
676
|
+
// Relative sibling
|
|
677
|
+
"index"
|
|
678
|
+
// Relative index
|
|
679
|
+
],
|
|
680
|
+
"newlines-between": "never"
|
|
681
|
+
}
|
|
682
|
+
]
|
|
683
|
+
};
|
|
684
|
+
import_default = config3;
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
// packages/eslint/src/rules/storm.ts
|
|
689
|
+
var config4, storm_default;
|
|
690
|
+
var init_storm = __esm({
|
|
691
|
+
"packages/eslint/src/rules/storm.ts"() {
|
|
692
|
+
config4 = {
|
|
693
|
+
/**
|
|
694
|
+
* Require return statements in array methods callbacks.
|
|
695
|
+
*
|
|
696
|
+
* 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return
|
|
697
|
+
*/
|
|
698
|
+
"array-callback-return": ["error", { allowImplicit: true }],
|
|
699
|
+
/**
|
|
700
|
+
* Treat `var` statements as if they were block scoped.
|
|
701
|
+
*
|
|
702
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var
|
|
703
|
+
*/
|
|
704
|
+
"block-scoped-var": "error",
|
|
705
|
+
/**
|
|
706
|
+
* Require curly braces for multiline blocks.
|
|
707
|
+
*
|
|
708
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/curly
|
|
709
|
+
*/
|
|
710
|
+
curly: ["warn", "multi-line"],
|
|
711
|
+
/**
|
|
712
|
+
* Require default clauses in switch statements to be last (if used).
|
|
713
|
+
*
|
|
714
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last
|
|
715
|
+
*/
|
|
716
|
+
"default-case-last": "error",
|
|
717
|
+
/**
|
|
718
|
+
* Require triple equals (`===` and `!==`).
|
|
719
|
+
*
|
|
720
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq
|
|
721
|
+
*/
|
|
722
|
+
eqeqeq: "error",
|
|
723
|
+
/**
|
|
724
|
+
* Require grouped accessor pairs in object literals and classes.
|
|
725
|
+
*
|
|
726
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs
|
|
727
|
+
*/
|
|
728
|
+
"grouped-accessor-pairs": "error",
|
|
729
|
+
/**
|
|
730
|
+
* Disallow use of `alert()`.
|
|
731
|
+
*
|
|
732
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-alert
|
|
733
|
+
*/
|
|
734
|
+
"no-alert": "error",
|
|
735
|
+
/**
|
|
736
|
+
* Disallow use of `caller`/`callee`.
|
|
737
|
+
*
|
|
738
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-caller
|
|
739
|
+
*/
|
|
740
|
+
"no-caller": "error",
|
|
741
|
+
/**
|
|
742
|
+
* Disallow returning value in constructor.
|
|
743
|
+
*
|
|
744
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return
|
|
745
|
+
*/
|
|
746
|
+
"no-constructor-return": "error",
|
|
747
|
+
/**
|
|
748
|
+
* Disallow using an `else` if the `if` block contains a return.
|
|
749
|
+
*
|
|
750
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-else-return
|
|
751
|
+
*/
|
|
752
|
+
"no-else-return": "warn",
|
|
753
|
+
/**
|
|
754
|
+
* Disallow `eval()`.
|
|
755
|
+
*
|
|
756
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-eval
|
|
757
|
+
*/
|
|
758
|
+
"no-eval": "error",
|
|
759
|
+
/**
|
|
760
|
+
* Disallow extending native objects.
|
|
761
|
+
*
|
|
762
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native
|
|
763
|
+
*/
|
|
764
|
+
"no-extend-native": "error",
|
|
765
|
+
/**
|
|
766
|
+
* Disallow unnecessary function binding.
|
|
767
|
+
*
|
|
768
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind
|
|
769
|
+
*/
|
|
770
|
+
"no-extra-bind": "error",
|
|
771
|
+
/**
|
|
772
|
+
* Disallow unnecessary labels.
|
|
773
|
+
*
|
|
774
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label
|
|
775
|
+
*/
|
|
776
|
+
"no-extra-label": "error",
|
|
777
|
+
/**
|
|
778
|
+
* Disallow floating decimals.
|
|
779
|
+
*
|
|
780
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-floating-decimal
|
|
781
|
+
*/
|
|
782
|
+
"no-floating-decimal": "error",
|
|
783
|
+
/**
|
|
784
|
+
* Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.
|
|
785
|
+
*
|
|
786
|
+
* 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion
|
|
787
|
+
*/
|
|
788
|
+
"no-implicit-coercion": "error",
|
|
789
|
+
/**
|
|
790
|
+
* Disallow use of `eval()`-like methods.
|
|
791
|
+
*
|
|
792
|
+
* https://eslint.org/docs/rules/no-implied-eval
|
|
793
|
+
*/
|
|
794
|
+
"no-implied-eval": "error",
|
|
795
|
+
/**
|
|
796
|
+
* Disallow usage of `__iterator__` property.
|
|
797
|
+
*
|
|
798
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator
|
|
799
|
+
*/
|
|
800
|
+
"no-iterator": "error",
|
|
801
|
+
/**
|
|
802
|
+
* Disallow use of labels for anything other than loops and switches.
|
|
803
|
+
*
|
|
804
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-labels
|
|
805
|
+
*/
|
|
806
|
+
"no-labels": ["error"],
|
|
807
|
+
/**
|
|
808
|
+
* Disallow unnecessary nested blocks.
|
|
809
|
+
*
|
|
810
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks
|
|
811
|
+
*/
|
|
812
|
+
"no-lone-blocks": "error",
|
|
813
|
+
/**
|
|
814
|
+
* Disallow `new` for side effects.
|
|
815
|
+
*
|
|
816
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new
|
|
817
|
+
*/
|
|
818
|
+
"no-new": "error",
|
|
819
|
+
/**
|
|
820
|
+
* Disallow function constructors.
|
|
821
|
+
*
|
|
822
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func
|
|
823
|
+
*/
|
|
824
|
+
"no-new-func": "error",
|
|
825
|
+
/**
|
|
826
|
+
* Disallow base types wrapper instances, such as `new String('foo')`.
|
|
827
|
+
*
|
|
828
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers
|
|
829
|
+
*/
|
|
830
|
+
"no-new-wrappers": "error",
|
|
831
|
+
/**
|
|
832
|
+
* Disallow use of octal escape sequences in string literals.
|
|
833
|
+
*
|
|
834
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape
|
|
835
|
+
*/
|
|
836
|
+
"no-octal-escape": "error",
|
|
837
|
+
/**
|
|
838
|
+
* Disallow reassignment of function parameters.
|
|
839
|
+
*
|
|
840
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign
|
|
841
|
+
*/
|
|
842
|
+
"no-param-reassign": "error",
|
|
843
|
+
/**
|
|
844
|
+
* Disallow usage of the deprecated `__proto__` property.
|
|
845
|
+
*
|
|
846
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-proto
|
|
847
|
+
*/
|
|
848
|
+
"no-proto": "error",
|
|
849
|
+
/**
|
|
850
|
+
* Disallow assignment in `return` statement.
|
|
851
|
+
*
|
|
852
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign
|
|
853
|
+
*/
|
|
854
|
+
"no-return-assign": "error",
|
|
855
|
+
/**
|
|
856
|
+
* Disallows unnecessary `return await`.
|
|
857
|
+
*
|
|
858
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-return-await
|
|
859
|
+
*/
|
|
860
|
+
"no-return-await": "error",
|
|
861
|
+
/**
|
|
862
|
+
* Disallow use of `javascript:` urls.
|
|
863
|
+
*
|
|
864
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url
|
|
865
|
+
*/
|
|
866
|
+
"no-script-url": "error",
|
|
867
|
+
/**
|
|
868
|
+
* Disallow comparisons where both sides are exactly the same.
|
|
869
|
+
*
|
|
870
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare
|
|
871
|
+
*/
|
|
872
|
+
"no-self-compare": "error",
|
|
873
|
+
/**
|
|
874
|
+
* Disallow use of comma operator.
|
|
875
|
+
*
|
|
876
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences
|
|
877
|
+
*/
|
|
878
|
+
"no-sequences": "error",
|
|
879
|
+
/**
|
|
880
|
+
* Disallow unnecessary `.call()` and `.apply()`.
|
|
881
|
+
*
|
|
882
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call
|
|
883
|
+
*/
|
|
884
|
+
"no-useless-call": "error",
|
|
885
|
+
/**
|
|
886
|
+
* Disallow unnecessary concatenation of strings.
|
|
887
|
+
*
|
|
888
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-concat
|
|
889
|
+
*/
|
|
890
|
+
"no-useless-concat": "error",
|
|
891
|
+
/**
|
|
892
|
+
* Disallow redundant return statements.
|
|
893
|
+
*
|
|
894
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/no-useless-return
|
|
895
|
+
*/
|
|
896
|
+
"no-useless-return": "warn",
|
|
897
|
+
/**
|
|
898
|
+
* Require using named capture groups in regular expressions.
|
|
899
|
+
*
|
|
900
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group
|
|
901
|
+
*/
|
|
902
|
+
"prefer-named-capture-group": "error",
|
|
903
|
+
/**
|
|
904
|
+
* Require using Error objects as Promise rejection reasons.
|
|
905
|
+
*
|
|
906
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-promise-reject-errors
|
|
907
|
+
*/
|
|
908
|
+
"prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
|
|
909
|
+
/**
|
|
910
|
+
* Disallow use of the RegExp constructor in favor of regular expression
|
|
911
|
+
* literals.
|
|
912
|
+
*
|
|
913
|
+
* 🚫 Not fixable - https://eslint.org/docs/rules/prefer-regex-literals
|
|
914
|
+
*/
|
|
915
|
+
"prefer-regex-literals": "error",
|
|
916
|
+
/**
|
|
917
|
+
* Disallow "Yoda conditions", ensuring the comparison.
|
|
918
|
+
*
|
|
919
|
+
* 🔧 Fixable - https://eslint.org/docs/rules/yoda
|
|
920
|
+
*/
|
|
921
|
+
yoda: "warn"
|
|
922
|
+
};
|
|
923
|
+
storm_default = config4;
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
// packages/eslint/src/rules/unicorn.ts
|
|
928
|
+
var config5, unicorn_default;
|
|
929
|
+
var init_unicorn = __esm({
|
|
930
|
+
"packages/eslint/src/rules/unicorn.ts"() {
|
|
931
|
+
config5 = {
|
|
932
|
+
/**
|
|
933
|
+
* Require consistent filename case for all linted files.
|
|
934
|
+
*
|
|
935
|
+
* 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
|
936
|
+
*/
|
|
937
|
+
"unicorn/filename-case": [
|
|
938
|
+
"error",
|
|
939
|
+
{
|
|
940
|
+
case: "kebabCase"
|
|
941
|
+
}
|
|
942
|
+
],
|
|
943
|
+
/**
|
|
944
|
+
* Require using the `node:` protocol when importing Node.js built-in modules.
|
|
945
|
+
*
|
|
946
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
947
|
+
*/
|
|
948
|
+
"unicorn/prefer-node-protocol": "warn"
|
|
949
|
+
};
|
|
950
|
+
unicorn_default = config5;
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
|
|
954
|
+
// packages/eslint/src/javascript.ts
|
|
955
|
+
var require_javascript = __commonJS({
|
|
956
|
+
"packages/eslint/src/javascript.ts"(exports2, module2) {
|
|
957
|
+
init_import();
|
|
958
|
+
init_storm();
|
|
959
|
+
init_unicorn();
|
|
960
|
+
module2.exports = {
|
|
961
|
+
overrides: [
|
|
962
|
+
{
|
|
963
|
+
files: ["*.js", "*.jsx"],
|
|
964
|
+
extends: ["plugin:@nx/javascript"],
|
|
965
|
+
plugins: ["unicorn", "import"],
|
|
966
|
+
rules: {
|
|
967
|
+
...import_default,
|
|
968
|
+
...unicorn_default,
|
|
969
|
+
...storm_default
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
]
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
// packages/eslint/src/typescript.ts
|
|
978
|
+
var require_typescript = __commonJS({
|
|
979
|
+
"packages/eslint/src/typescript.ts"(exports2, module2) {
|
|
980
|
+
init_constants();
|
|
981
|
+
init_import();
|
|
982
|
+
init_storm();
|
|
983
|
+
init_ts_docs();
|
|
984
|
+
init_unicorn();
|
|
985
|
+
module2.exports = {
|
|
986
|
+
root: true,
|
|
987
|
+
overrides: [
|
|
988
|
+
{
|
|
989
|
+
files: ["*.ts", "*.tsx"],
|
|
990
|
+
extends: ["plugin:@nx/typescript"],
|
|
991
|
+
rules: {}
|
|
992
|
+
}
|
|
993
|
+
],
|
|
994
|
+
parser: "@typescript-eslint/parser",
|
|
995
|
+
extends: [
|
|
996
|
+
"eslint:recommended",
|
|
997
|
+
"plugin:@typescript-eslint/recommended",
|
|
998
|
+
"prettier"
|
|
999
|
+
],
|
|
1000
|
+
plugins: ["sonarjs", "unicorn", "promise", "import", "eslint-plugin-tsdoc"],
|
|
1001
|
+
rules: {
|
|
1002
|
+
// Disallows if statements as the only statement in else blocks
|
|
1003
|
+
// https://eslint.org/docs/rules/no-lonely-if
|
|
1004
|
+
"no-lonely-if": "error",
|
|
1005
|
+
// Disallows the use of console
|
|
1006
|
+
// https://eslint.org/docs/rules/no-console
|
|
1007
|
+
"no-console": "error",
|
|
1008
|
+
// Requires method and property shorthand syntax for object literals
|
|
1009
|
+
// https://eslint.org/docs/rules/object-shorthand
|
|
1010
|
+
"object-shorthand": ["error", "always"],
|
|
1011
|
+
// Disallows loops with a body that allows only one iteration
|
|
1012
|
+
// https://eslint.org/docs/rules/no-unreachable-loop
|
|
1013
|
+
"no-unreachable-loop": "error",
|
|
1014
|
+
"sonarjs/no-one-iteration-loop": "off",
|
|
1015
|
+
// similar to 'no-unreachable-loop' but reports less cases
|
|
1016
|
+
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
|
|
1017
|
+
"sonarjs/no-unused-collection": "error",
|
|
1018
|
+
"sonarjs/no-identical-conditions": "error",
|
|
1019
|
+
"sonarjs/no-inverted-boolean-check": "error",
|
|
1020
|
+
"sonarjs/no-use-of-empty-return-value": "error",
|
|
1021
|
+
"sonarjs/no-gratuitous-expressions": "error",
|
|
1022
|
+
"sonarjs/no-nested-switch": "error",
|
|
1023
|
+
"unicorn/no-lonely-if": "error",
|
|
1024
|
+
"sonarjs/no-collapsible-if": "off",
|
|
1025
|
+
// same as 'unicorn/no-lonely-if'
|
|
1026
|
+
"unicorn/no-array-push-push": "error",
|
|
1027
|
+
"unicorn/no-instanceof-array": "error",
|
|
1028
|
+
"unicorn/no-empty-file": "error",
|
|
1029
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
1030
|
+
"unicorn/prefer-array-find": "error",
|
|
1031
|
+
"unicorn/no-useless-spread": "error",
|
|
1032
|
+
"unicorn/prefer-includes": "error",
|
|
1033
|
+
// Disallows specified syntax
|
|
1034
|
+
// https://eslint.org/docs/rules/no-restricted-syntax
|
|
1035
|
+
"no-restricted-syntax": ["error", ...RESTRICTED_SYNTAX],
|
|
1036
|
+
"no-else-return": ["error", { allowElseIf: false }],
|
|
1037
|
+
"promise/no-nesting": "error",
|
|
1038
|
+
"import/extensions": ["error", "ignorePackages"],
|
|
1039
|
+
// Bob when bundling requires to have `.js` extension
|
|
1040
|
+
"import/no-default-export": "error",
|
|
1041
|
+
"import/prefer-default-export": "off",
|
|
1042
|
+
// disable opposite of 'import/no-default-export'
|
|
1043
|
+
"unicorn/filename-case": "error",
|
|
1044
|
+
"@typescript-eslint/no-unused-vars": [
|
|
1045
|
+
"error",
|
|
1046
|
+
{
|
|
1047
|
+
argsIgnorePattern: "^_",
|
|
1048
|
+
varsIgnorePattern: "^_"
|
|
1049
|
+
// allow underscores in destructuring
|
|
1050
|
+
}
|
|
1051
|
+
],
|
|
1052
|
+
// Enforce the style of numeric separators by correctly grouping digits
|
|
1053
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
|
|
1054
|
+
"unicorn/numeric-separators-style": "error",
|
|
1055
|
+
// Prefer using the node: protocol when importing Node.js builtin modules
|
|
1056
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
1057
|
+
"unicorn/prefer-node-protocol": "error",
|
|
1058
|
+
// Reports any imports that come after non-import statements
|
|
1059
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
1060
|
+
"import/first": "error",
|
|
1061
|
+
// Disallow shorthand type conversions
|
|
1062
|
+
// https://eslint.org/docs/latest/rules/no-implicit-coercion
|
|
1063
|
+
"no-implicit-coercion": [
|
|
1064
|
+
"error",
|
|
1065
|
+
{
|
|
1066
|
+
disallowTemplateShorthand: true,
|
|
1067
|
+
// in TypeScript `!!` is preferable https://www.typescriptlang.org/docs/handbook/2/narrowing.html#truthiness-narrowing
|
|
1068
|
+
boolean: false
|
|
1069
|
+
}
|
|
1070
|
+
],
|
|
1071
|
+
// Disallow specified modules when loaded by `import` declarations
|
|
1072
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md
|
|
1073
|
+
"n/no-restricted-import": ["error", RESTRICTED_MODULES],
|
|
1074
|
+
// Disallow specified modules when loaded by require
|
|
1075
|
+
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-require.md
|
|
1076
|
+
"n/no-restricted-require": ["error", RESTRICTED_MODULES],
|
|
1077
|
+
"no-restricted-modules": "off",
|
|
1078
|
+
// deprecated in favor of corresponding rules from `eslint-plugin-n`
|
|
1079
|
+
// Disallow specified global variables
|
|
1080
|
+
// https://eslint.org/docs/latest/rules/no-restricted-globals
|
|
1081
|
+
"no-restricted-globals": ["error", ...RESTRICTED_GLOBALS],
|
|
1082
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
1083
|
+
"prefer-const": ["error", { destructuring: "all" }],
|
|
1084
|
+
"import/no-duplicates": "error",
|
|
1085
|
+
"import/newline-after-import": "off",
|
|
1086
|
+
// prettified by prettier-plugin-sort-imports
|
|
1087
|
+
"prefer-object-has-own": "error",
|
|
1088
|
+
"logical-assignment-operators": [
|
|
1089
|
+
"error",
|
|
1090
|
+
"always",
|
|
1091
|
+
{ enforceForIfStatements: true }
|
|
1092
|
+
],
|
|
1093
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
1094
|
+
yoda: "error",
|
|
1095
|
+
"unicorn/prefer-export-from": ["error", { ignoreUsedVariables: true }],
|
|
1096
|
+
"promise/no-multiple-resolved": "error",
|
|
1097
|
+
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
1098
|
+
"no-unused-expressions": "off",
|
|
1099
|
+
"@typescript-eslint/no-unused-expressions": "error",
|
|
1100
|
+
"no-negated-condition": "off",
|
|
1101
|
+
"unicorn/no-negated-condition": "error",
|
|
1102
|
+
"unicorn/no-array-for-each": "error",
|
|
1103
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
1104
|
+
"no-self-compare": "error",
|
|
1105
|
+
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
1106
|
+
"import/no-useless-path-segments": "error",
|
|
1107
|
+
"require-await": "off",
|
|
1108
|
+
"no-return-await": "off",
|
|
1109
|
+
...import_default,
|
|
1110
|
+
...unicorn_default,
|
|
1111
|
+
...ts_docs_default,
|
|
1112
|
+
...storm_default
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
// packages/eslint/src/yml.ts
|
|
1119
|
+
var require_yml = __commonJS({
|
|
1120
|
+
"packages/eslint/src/yml.ts"(exports2, module2) {
|
|
1121
|
+
init_constants();
|
|
1122
|
+
module2.exports = {
|
|
1123
|
+
ignorePatterns: ["pnpm-lock.yaml"],
|
|
1124
|
+
overrides: [
|
|
1125
|
+
{
|
|
1126
|
+
files: "*.y{,a}ml",
|
|
1127
|
+
excludedFiles: [CODE_BLOCK, ".github/FUNDING.yml"],
|
|
1128
|
+
extends: ["plugin:yml/standard", "plugin:yml/prettier"],
|
|
1129
|
+
plugins: ["unicorn"],
|
|
1130
|
+
rules: {
|
|
1131
|
+
"unicorn/filename-case": "error"
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
]
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
// packages/eslint/src/nx.ts
|
|
1140
|
+
var require_nx = __commonJS({
|
|
1141
|
+
"packages/eslint/src/nx.ts"(exports2, module2) {
|
|
1142
|
+
module2.exports = {
|
|
1143
|
+
plugins: ["@nx"],
|
|
1144
|
+
extends: [
|
|
1145
|
+
"plugin:@nx/eslint",
|
|
1146
|
+
"plugin:@nx/react",
|
|
1147
|
+
"plugin:@nx/next",
|
|
1148
|
+
"plugin:@nx/typescript",
|
|
1149
|
+
"plugin:@nx/javascript",
|
|
1150
|
+
"plugin:@nx/prettier"
|
|
1151
|
+
],
|
|
1152
|
+
"rules": {
|
|
1153
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
1154
|
+
"no-restricted-imports": ["error", "create-nx-workspace"],
|
|
1155
|
+
"@typescript-eslint/no-restricted-imports": [
|
|
1156
|
+
"error",
|
|
1157
|
+
{
|
|
1158
|
+
"patterns": [
|
|
1159
|
+
{
|
|
1160
|
+
"group": ["nx/src/plugins/js*"],
|
|
1161
|
+
"message": "Imports from 'nx/src/plugins/js' are not allowed. Use '@nx/js' instead"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
"group": ["**/native-bindings", "**/native-bindings.js", ""],
|
|
1165
|
+
"message": "Direct imports from native-bindings.js are not allowed. Import from index.js instead."
|
|
1166
|
+
}
|
|
1167
|
+
]
|
|
1168
|
+
}
|
|
1169
|
+
]
|
|
1170
|
+
},
|
|
1171
|
+
overrides: [
|
|
1172
|
+
{
|
|
1173
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
1174
|
+
"rules": {
|
|
1175
|
+
"@nx/enforce-module-boundaries": [
|
|
1176
|
+
"error",
|
|
1177
|
+
{
|
|
1178
|
+
"enforceBuildableLibDependency": true,
|
|
1179
|
+
"checkDynamicDependenciesExceptions": [".*"],
|
|
1180
|
+
"allow": [],
|
|
1181
|
+
"depConstraints": [
|
|
1182
|
+
{
|
|
1183
|
+
"sourceTag": "*",
|
|
1184
|
+
"onlyDependOnLibsWithTags": ["*"]
|
|
1185
|
+
}
|
|
1186
|
+
]
|
|
1187
|
+
}
|
|
1188
|
+
]
|
|
1189
|
+
}
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
"files": ["*.ts", "*.tsx"],
|
|
1193
|
+
"extends": ["plugin:@nx/typescript"],
|
|
1194
|
+
"rules": {}
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
"files": ["*.js", "*.jsx"],
|
|
1198
|
+
"extends": ["plugin:@nx/javascript"],
|
|
1199
|
+
"rules": {}
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
|
|
1203
|
+
"env": {
|
|
1204
|
+
"jest": true
|
|
1205
|
+
},
|
|
1206
|
+
"rules": {}
|
|
1207
|
+
}
|
|
1208
|
+
]
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
// packages/eslint/src/mdx.ts
|
|
1214
|
+
var require_mdx = __commonJS({
|
|
1215
|
+
"packages/eslint/src/mdx.ts"(exports2, module2) {
|
|
1216
|
+
init_constants();
|
|
1217
|
+
module2.exports = {
|
|
1218
|
+
overrides: [
|
|
1219
|
+
{
|
|
1220
|
+
files: "*.md{,x}",
|
|
1221
|
+
parser: "eslint-mdx",
|
|
1222
|
+
processor: "mdx/remark",
|
|
1223
|
+
plugins: ["mdx"],
|
|
1224
|
+
extends: ["./base", "./react-base"],
|
|
1225
|
+
parserOptions: {
|
|
1226
|
+
ecmaVersion: 13
|
|
1227
|
+
},
|
|
1228
|
+
rules: {
|
|
1229
|
+
"react/self-closing-comp": "off",
|
|
1230
|
+
// TODO: false positive https://github.com/mdx-js/eslint-mdx/issues/437
|
|
1231
|
+
"mdx/remark": "error",
|
|
1232
|
+
"import/no-default-export": "off",
|
|
1233
|
+
"@typescript-eslint/prefer-optional-chain": "off",
|
|
1234
|
+
// throws "parserOptions.project" error
|
|
1235
|
+
"react/jsx-filename-extension": "off"
|
|
1236
|
+
// fixes JSX not allowed in files with extension '.mdx'
|
|
1237
|
+
},
|
|
1238
|
+
settings: {
|
|
1239
|
+
"mdx/code-blocks": true
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
// Disable filename check
|
|
1243
|
+
{
|
|
1244
|
+
files: [
|
|
1245
|
+
CODE_BLOCK,
|
|
1246
|
+
".changeset/*.md",
|
|
1247
|
+
"CHANGELOG.md",
|
|
1248
|
+
".github/**/PULL_REQUEST_TEMPLATE.md",
|
|
1249
|
+
".github/ISSUE_TEMPLATE/bug_report.md",
|
|
1250
|
+
"SECURITY.md",
|
|
1251
|
+
"CODE_OF_CONDUCT.md",
|
|
1252
|
+
"README.md"
|
|
1253
|
+
],
|
|
1254
|
+
rules: {
|
|
1255
|
+
"unicorn/filename-case": "off"
|
|
1256
|
+
}
|
|
1257
|
+
},
|
|
1258
|
+
// Disable rules for code blocks
|
|
1259
|
+
{
|
|
1260
|
+
files: [CODE_BLOCK],
|
|
1261
|
+
rules: {
|
|
1262
|
+
"no-console": "off",
|
|
1263
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
1264
|
+
"no-undef": "off",
|
|
1265
|
+
"import/extensions": "off"
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1268
|
+
// Disable rules that requires types information
|
|
1269
|
+
{
|
|
1270
|
+
files: ["*.md{,x}", "**/*.md{,x}/*"],
|
|
1271
|
+
rules: {
|
|
1272
|
+
"@typescript-eslint/require-await": "off",
|
|
1273
|
+
"@typescript-eslint/return-await": "off"
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
]
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1281
|
+
// packages/eslint/src/graphql.ts
|
|
1282
|
+
var require_graphql = __commonJS({
|
|
1283
|
+
"packages/eslint/src/graphql.ts"(exports2, module2) {
|
|
1284
|
+
module2.exports = {
|
|
1285
|
+
overrides: [
|
|
1286
|
+
{
|
|
1287
|
+
files: ["*.js", "*.ts", "*.jsx", "*.tsx"],
|
|
1288
|
+
processor: "@graphql-eslint/graphql",
|
|
1289
|
+
extends: ["plugin:relay/recommended"],
|
|
1290
|
+
plugins: ["@graphql-eslint", "relay"],
|
|
1291
|
+
rules: {
|
|
1292
|
+
"@graphql-eslint/relay-arguments": "error",
|
|
1293
|
+
"@graphql-eslint/relay-connection-types": "error",
|
|
1294
|
+
"@graphql-eslint/relay-edge-types": "error",
|
|
1295
|
+
"@graphql-eslint/relay-page-info": "error",
|
|
1296
|
+
"@graphql-eslint/executable-definitions": "error",
|
|
1297
|
+
"@graphql-eslint/fields-on-correct-type": "error",
|
|
1298
|
+
"@graphql-eslint/fragments-on-composite-type": "error",
|
|
1299
|
+
"@graphql-eslint/known-argument-names": "error",
|
|
1300
|
+
"@graphql-eslint/known-directives": "error",
|
|
1301
|
+
"@graphql-eslint/known-fragment-names": "error",
|
|
1302
|
+
"@graphql-eslint/known-type-names": "error",
|
|
1303
|
+
"@graphql-eslint/lone-anonymous-operation": "error",
|
|
1304
|
+
"@graphql-eslint/naming-convention": [
|
|
1305
|
+
"error",
|
|
1306
|
+
{
|
|
1307
|
+
VariableDefinition: "camelCase",
|
|
1308
|
+
OperationDefinition: {
|
|
1309
|
+
style: "PascalCase",
|
|
1310
|
+
forbiddenPrefixes: ["Query", "Mutation", "Subscription", "Get"],
|
|
1311
|
+
forbiddenSuffixes: ["Query", "Mutation", "Subscription"]
|
|
1312
|
+
},
|
|
1313
|
+
FragmentDefinition: {
|
|
1314
|
+
style: "PascalCase",
|
|
1315
|
+
forbiddenPrefixes: ["Fragment"],
|
|
1316
|
+
forbiddenSuffixes: ["Fragment"]
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
],
|
|
1320
|
+
"@graphql-eslint/no-anonymous-operations": "error",
|
|
1321
|
+
"@graphql-eslint/no-deprecated": "error",
|
|
1322
|
+
"@graphql-eslint/no-duplicate-fields": "error",
|
|
1323
|
+
"@graphql-eslint/no-fragment-cycles": "error",
|
|
1324
|
+
"@graphql-eslint/no-undefined-variables": "error",
|
|
1325
|
+
"@graphql-eslint/no-unused-fragments": "error",
|
|
1326
|
+
"@graphql-eslint/no-unused-variables": "error",
|
|
1327
|
+
"@graphql-eslint/one-field-subscriptions": "error",
|
|
1328
|
+
"@graphql-eslint/overlapping-fields-can-be-merged": "error",
|
|
1329
|
+
"@graphql-eslint/possible-fragment-spread": "error",
|
|
1330
|
+
"@graphql-eslint/provided-required-arguments": "error",
|
|
1331
|
+
"@graphql-eslint/require-id-when-available": "error",
|
|
1332
|
+
"@graphql-eslint/scalar-leafs": "error",
|
|
1333
|
+
"@graphql-eslint/selection-set-depth": ["error", { maxDepth: 7 }],
|
|
1334
|
+
"@graphql-eslint/unique-argument-names": "error",
|
|
1335
|
+
"@graphql-eslint/unique-directive-names-per-location": "error",
|
|
1336
|
+
"@graphql-eslint/unique-input-field-names": "error",
|
|
1337
|
+
"@graphql-eslint/unique-variable-names": "error",
|
|
1338
|
+
"@graphql-eslint/value-literals-of-correct-type": "error",
|
|
1339
|
+
"@graphql-eslint/variables-are-input-types": "error",
|
|
1340
|
+
"@graphql-eslint/variables-in-allowed-position": "error",
|
|
1341
|
+
"relay/generated-flow-types": "off"
|
|
1342
|
+
}
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
files: ["*.graphql"],
|
|
1346
|
+
parser: "@graphql-eslint/eslint-plugin",
|
|
1347
|
+
extends: ["plugin:relay/recommended"],
|
|
1348
|
+
plugins: ["@graphql-eslint", "relay"],
|
|
1349
|
+
rules: {
|
|
1350
|
+
"@graphql-eslint/relay-arguments": "error",
|
|
1351
|
+
"@graphql-eslint/relay-connection-types": "error",
|
|
1352
|
+
"@graphql-eslint/relay-edge-types": "error",
|
|
1353
|
+
"@graphql-eslint/relay-page-info": "error",
|
|
1354
|
+
"@graphql-eslint/executable-definitions": "error",
|
|
1355
|
+
"@graphql-eslint/fields-on-correct-type": "error",
|
|
1356
|
+
"@graphql-eslint/fragments-on-composite-type": "error",
|
|
1357
|
+
"@graphql-eslint/known-argument-names": "error",
|
|
1358
|
+
"@graphql-eslint/known-directives": "error",
|
|
1359
|
+
"@graphql-eslint/known-fragment-names": "error",
|
|
1360
|
+
"@graphql-eslint/known-type-names": "error",
|
|
1361
|
+
"@graphql-eslint/lone-anonymous-operation": "error",
|
|
1362
|
+
"@graphql-eslint/naming-convention": [
|
|
1363
|
+
"error",
|
|
1364
|
+
{
|
|
1365
|
+
VariableDefinition: "camelCase",
|
|
1366
|
+
OperationDefinition: {
|
|
1367
|
+
style: "PascalCase",
|
|
1368
|
+
forbiddenPrefixes: ["Query", "Mutation", "Subscription", "Get"],
|
|
1369
|
+
forbiddenSuffixes: ["Query", "Mutation", "Subscription"]
|
|
1370
|
+
},
|
|
1371
|
+
FragmentDefinition: {
|
|
1372
|
+
style: "PascalCase",
|
|
1373
|
+
forbiddenPrefixes: ["Fragment"],
|
|
1374
|
+
forbiddenSuffixes: ["Fragment"]
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
],
|
|
1378
|
+
"@graphql-eslint/no-anonymous-operations": "error",
|
|
1379
|
+
"@graphql-eslint/no-deprecated": "error",
|
|
1380
|
+
"@graphql-eslint/no-duplicate-fields": "error",
|
|
1381
|
+
"@graphql-eslint/no-fragment-cycles": "error",
|
|
1382
|
+
"@graphql-eslint/no-undefined-variables": "error",
|
|
1383
|
+
"@graphql-eslint/no-unused-fragments": "error",
|
|
1384
|
+
"@graphql-eslint/no-unused-variables": "error",
|
|
1385
|
+
"@graphql-eslint/one-field-subscriptions": "error",
|
|
1386
|
+
"@graphql-eslint/overlapping-fields-can-be-merged": "error",
|
|
1387
|
+
"@graphql-eslint/possible-fragment-spread": "error",
|
|
1388
|
+
"@graphql-eslint/provided-required-arguments": "error",
|
|
1389
|
+
"@graphql-eslint/require-id-when-available": "error",
|
|
1390
|
+
"@graphql-eslint/scalar-leafs": "error",
|
|
1391
|
+
"@graphql-eslint/selection-set-depth": ["error", { maxDepth: 7 }],
|
|
1392
|
+
"@graphql-eslint/unique-argument-names": "error",
|
|
1393
|
+
"@graphql-eslint/unique-directive-names-per-location": "error",
|
|
1394
|
+
"@graphql-eslint/unique-input-field-names": "error",
|
|
1395
|
+
"@graphql-eslint/unique-variable-names": "error",
|
|
1396
|
+
"@graphql-eslint/value-literals-of-correct-type": "error",
|
|
1397
|
+
"@graphql-eslint/variables-are-input-types": "error",
|
|
1398
|
+
"@graphql-eslint/variables-in-allowed-position": "error",
|
|
1399
|
+
"relay/generated-flow-types": "off"
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
]
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
|
|
1407
|
+
// packages/eslint/src/jest.ts
|
|
1408
|
+
var require_jest = __commonJS({
|
|
1409
|
+
"packages/eslint/src/jest.ts"(exports2, module2) {
|
|
1410
|
+
module2.exports = {
|
|
1411
|
+
overrides: [
|
|
1412
|
+
{
|
|
1413
|
+
files: ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
|
|
1414
|
+
env: {
|
|
1415
|
+
jest: true
|
|
1416
|
+
},
|
|
1417
|
+
rules: {}
|
|
1418
|
+
}
|
|
1419
|
+
]
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
|
|
1424
|
+
// packages/eslint/src/index.ts
|
|
1425
|
+
var src_exports = {};
|
|
1426
|
+
__export(src_exports, {
|
|
1427
|
+
CODE_BLOCK: () => CODE_BLOCK,
|
|
1428
|
+
CODE_FILE: () => CODE_FILE,
|
|
1429
|
+
JS_FILES: () => JS_FILES,
|
|
1430
|
+
REACT_RESTRICTED_SYNTAX: () => REACT_RESTRICTED_SYNTAX,
|
|
1431
|
+
RESTRICTED_GLOBALS: () => RESTRICTED_GLOBALS,
|
|
1432
|
+
RESTRICTED_MODULES: () => RESTRICTED_MODULES,
|
|
1433
|
+
RESTRICTED_SYNTAX: () => RESTRICTED_SYNTAX,
|
|
1434
|
+
TS_FILE: () => TS_FILE
|
|
1435
|
+
});
|
|
1436
|
+
module.exports = __toCommonJS(src_exports);
|
|
1437
|
+
__reExport(src_exports, __toESM(require_base()), module.exports);
|
|
1438
|
+
init_constants();
|
|
1439
|
+
__reExport(src_exports, __toESM(require_json()), module.exports);
|
|
1440
|
+
__reExport(src_exports, __toESM(require_next()), module.exports);
|
|
1441
|
+
__reExport(src_exports, __toESM(require_recommended()), module.exports);
|
|
1442
|
+
__reExport(src_exports, __toESM(require_react()), module.exports);
|
|
1443
|
+
init_import();
|
|
1444
|
+
init_react();
|
|
1445
|
+
init_storm();
|
|
1446
|
+
init_ts_docs();
|
|
1447
|
+
init_unicorn();
|
|
1448
|
+
__reExport(src_exports, __toESM(require_javascript()), module.exports);
|
|
1449
|
+
__reExport(src_exports, __toESM(require_typescript()), module.exports);
|
|
1450
|
+
__reExport(src_exports, __toESM(require_yml()), module.exports);
|
|
1451
|
+
__reExport(src_exports, __toESM(require_nx()), module.exports);
|
|
1452
|
+
__reExport(src_exports, __toESM(require_mdx()), module.exports);
|
|
1453
|
+
__reExport(src_exports, __toESM(require_graphql()), module.exports);
|
|
1454
|
+
__reExport(src_exports, __toESM(require_jest()), module.exports);
|
|
1455
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1456
|
+
0 && (module.exports = {
|
|
1457
|
+
CODE_BLOCK,
|
|
1458
|
+
CODE_FILE,
|
|
1459
|
+
JS_FILES,
|
|
1460
|
+
REACT_RESTRICTED_SYNTAX,
|
|
1461
|
+
RESTRICTED_GLOBALS,
|
|
1462
|
+
RESTRICTED_MODULES,
|
|
1463
|
+
RESTRICTED_SYNTAX,
|
|
1464
|
+
TS_FILE
|
|
1465
|
+
});
|