@ethang/eslint-config 21.2.4 → 21.4.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/build.ts +34 -0
- package/{README.md → dist/README.md} +2 -2
- package/dist/config.react.js +2 -0
- package/dist/config.react.js.map +1 -0
- package/dist/eslint.config.js +2 -0
- package/dist/package.json +68 -0
- package/eslint.config.js +26 -2
- package/package.json +7 -7
- package/src/README.md +100 -0
- package/src/build/create-config-file.ts +57 -0
- package/src/build/create-config.ts +96 -0
- package/src/build/get-react-version.ts +19 -0
- package/src/build/list-utilities.ts +124 -0
- package/src/build/rule-list.ts +284 -0
- package/src/build/update-readme.ts +195 -0
- package/src/build/update-rules.ts +124 -0
- package/src/config.angular.js +107 -0
- package/src/config.astro.js +68 -0
- package/src/config.react.js +117 -0
- package/src/config.solid.js +34 -0
- package/src/constants.js +16 -0
- package/src/eslint.config.js +1051 -0
- package/src/setup/a11y.ts +19 -0
- package/src/setup/angular.ts +40 -0
- package/src/setup/astro.ts +14 -0
- package/src/setup/barrel.ts +17 -0
- package/src/setup/compat.ts +13 -0
- package/src/setup/cspell.ts +83 -0
- package/src/setup/css.ts +12 -0
- package/src/setup/depend.ts +14 -0
- package/src/setup/eslint.ts +246 -0
- package/src/setup/gen-rules.ts +75 -0
- package/src/setup/json.ts +17 -0
- package/src/setup/lodash.ts +58 -0
- package/src/setup/markdown.ts +16 -0
- package/src/setup/n.ts +86 -0
- package/src/setup/perfectionist.ts +68 -0
- package/src/setup/react.ts +82 -0
- package/src/setup/solid.ts +21 -0
- package/src/setup/sonar.ts +39 -0
- package/src/setup/tailwind.ts +10 -0
- package/src/setup/tanstack-query.ts +9 -0
- package/src/setup/tanstack-router.ts +9 -0
- package/src/setup/typescript-eslint.ts +118 -0
- package/src/setup/unicorn.ts +38 -0
- package/tsconfig.json +5 -0
- package/config.react.js +0 -2
- package/config.react.js.map +0 -1
- /package/{chunk-WK3YS7OG.js → dist/chunk-WK3YS7OG.js} +0 -0
- /package/{chunk-WK3YS7OG.js.map → dist/chunk-WK3YS7OG.js.map} +0 -0
- /package/{config.angular.d.ts → dist/config.angular.d.ts} +0 -0
- /package/{config.angular.js → dist/config.angular.js} +0 -0
- /package/{config.angular.js.map → dist/config.angular.js.map} +0 -0
- /package/{config.astro.d.ts → dist/config.astro.d.ts} +0 -0
- /package/{config.astro.js → dist/config.astro.js} +0 -0
- /package/{config.astro.js.map → dist/config.astro.js.map} +0 -0
- /package/{config.react.d.ts → dist/config.react.d.ts} +0 -0
- /package/{config.solid.d.ts → dist/config.solid.d.ts} +0 -0
- /package/{config.solid.js → dist/config.solid.js} +0 -0
- /package/{config.solid.js.map → dist/config.solid.js.map} +0 -0
- /package/{constants.js → dist/constants.js} +0 -0
- /package/{constants.js.map → dist/constants.js.map} +0 -0
- /package/{eslint.config.d.ts → dist/eslint.config.d.ts} +0 -0
- /package/{eslint.config.js.map → dist/eslint.config.js.map} +0 -0
package/src/setup/n.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import n from "eslint-plugin-n";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
|
|
5
|
+
|
|
6
|
+
const ruleNames = keys(getNonDeprecatedRules(n.rules ?? {}));
|
|
7
|
+
const changedRules = [
|
|
8
|
+
{
|
|
9
|
+
name: "callback-return",
|
|
10
|
+
rule: "off",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "exports-style",
|
|
14
|
+
rule: ["error", "exports"],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "file-extension-in-import",
|
|
18
|
+
rule: "off",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "global-require",
|
|
22
|
+
rule: "off",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "no-callback-literal",
|
|
26
|
+
rule: "off",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "no-missing-import",
|
|
30
|
+
rule: "off",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "no-mixed-requires",
|
|
34
|
+
rule: "off",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "no-new-require",
|
|
38
|
+
rule: "off",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "no-process-env",
|
|
42
|
+
rule: "off",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "no-process-exit",
|
|
46
|
+
rule: "off",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "no-restricted-import",
|
|
50
|
+
rule: "off",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "no-restricted-require",
|
|
54
|
+
rule: "off",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "no-sync",
|
|
58
|
+
rule: "off",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "no-unpublished-import",
|
|
62
|
+
rule: "off",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "no-unpublished-require",
|
|
66
|
+
rule: "off",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "prefer-promises/dns",
|
|
70
|
+
rule: "off",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "prefer-promises/fs",
|
|
74
|
+
rule: "off",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "process-exit-as-throw",
|
|
78
|
+
rule: "off",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "hashbang",
|
|
82
|
+
rule: "off",
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
export const nRules = genRules(ruleNames, changedRules, "n");
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
type EsLintRules,
|
|
6
|
+
genRules,
|
|
7
|
+
getNonDeprecatedRules,
|
|
8
|
+
} from "./gen-rules.ts";
|
|
9
|
+
|
|
10
|
+
const ruleNames = keys(
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
12
|
+
getNonDeprecatedRules(perfectionist.rules as unknown as EsLintRules),
|
|
13
|
+
);
|
|
14
|
+
const customRules = [
|
|
15
|
+
{
|
|
16
|
+
name: "sort-imports",
|
|
17
|
+
rule: [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
groups: [
|
|
21
|
+
"type",
|
|
22
|
+
["builtin", "external"],
|
|
23
|
+
"internal-type",
|
|
24
|
+
"internal",
|
|
25
|
+
["parent-type", "sibling-type", "index-type"],
|
|
26
|
+
["parent", "sibling", "index"],
|
|
27
|
+
"object",
|
|
28
|
+
"unknown",
|
|
29
|
+
],
|
|
30
|
+
newlinesBetween: "always",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "sort-jsx-props",
|
|
36
|
+
rule: ["error", { groups: ["shorthand", "multiline"] }],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "sort-objects",
|
|
40
|
+
rule: ["error", { partitionByComment: true }],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "sort-switch-case",
|
|
44
|
+
rule: [
|
|
45
|
+
"error",
|
|
46
|
+
{
|
|
47
|
+
order: "asc",
|
|
48
|
+
type: "alphabetical",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "sort-variable-declarations",
|
|
54
|
+
rule: [
|
|
55
|
+
"error",
|
|
56
|
+
{
|
|
57
|
+
order: "asc",
|
|
58
|
+
type: "alphabetical",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const perfectionistRules = genRules(
|
|
65
|
+
ruleNames,
|
|
66
|
+
customRules,
|
|
67
|
+
"perfectionist",
|
|
68
|
+
);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import react from "@eslint-react/eslint-plugin";
|
|
2
|
+
// @ts-expect-error no types
|
|
3
|
+
import compiler from "eslint-plugin-react-compiler";
|
|
4
|
+
// @ts-expect-error no types
|
|
5
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
6
|
+
import keys from "lodash/keys.js";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type EsLintRules,
|
|
10
|
+
genRules,
|
|
11
|
+
getNonDeprecatedRules,
|
|
12
|
+
} from "./gen-rules.ts";
|
|
13
|
+
|
|
14
|
+
const reactRuleNames = keys(
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
16
|
+
getNonDeprecatedRules(react.rules as unknown as EsLintRules),
|
|
17
|
+
);
|
|
18
|
+
const customReactRules = [
|
|
19
|
+
{
|
|
20
|
+
name: "avoid-shorthand-boolean",
|
|
21
|
+
rule: "off",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "avoid-shorthand-fragment",
|
|
25
|
+
rule: "off",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "debug/class-component",
|
|
29
|
+
rule: "off",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "debug/function-component",
|
|
33
|
+
rule: "off",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "debug/hook",
|
|
37
|
+
rule: "off",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "debug/is-from-react",
|
|
41
|
+
rule: "off",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "debug/react-hooks",
|
|
45
|
+
rule: "off",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "naming-convention/filename",
|
|
49
|
+
rule: ["error", { rule: "kebab-case" }],
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
const reactGen = genRules(reactRuleNames, customReactRules, "react");
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion,@typescript-eslint/no-unsafe-member-access
|
|
55
|
+
const reactHookRuleNames = keys(reactHooks.rules as unknown as EsLintRules);
|
|
56
|
+
const customHookRules = [
|
|
57
|
+
{
|
|
58
|
+
name: "exhaustive-deps",
|
|
59
|
+
rule: "error",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "rules-of-hooks",
|
|
63
|
+
rule: "error",
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
const hookGen = genRules(reactHookRuleNames, customHookRules, "react-hooks");
|
|
67
|
+
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
69
|
+
const reactCompilerRuleNames = keys(compiler.rules);
|
|
70
|
+
const compilerGen = genRules(reactCompilerRuleNames, [], "react-compiler");
|
|
71
|
+
|
|
72
|
+
export const reactRules = {
|
|
73
|
+
...reactGen,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const reactHookRules = {
|
|
77
|
+
...hookGen,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const reactCompilerRules = {
|
|
81
|
+
...compilerGen,
|
|
82
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import solid from "eslint-plugin-solid";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
type EsLintRules,
|
|
6
|
+
genRules,
|
|
7
|
+
getNonDeprecatedRules,
|
|
8
|
+
} from "./gen-rules.ts";
|
|
9
|
+
|
|
10
|
+
const ruleNames = keys(
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
12
|
+
getNonDeprecatedRules(solid.rules as unknown as EsLintRules),
|
|
13
|
+
);
|
|
14
|
+
const customRules = [
|
|
15
|
+
{
|
|
16
|
+
name: "no-proxy-apis",
|
|
17
|
+
rule: "off",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export const solidRules = genRules(ruleNames, customRules, "solid");
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import sonar from "eslint-plugin-sonarjs";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
|
|
5
|
+
|
|
6
|
+
const ruleNames = keys(getNonDeprecatedRules(sonar.rules));
|
|
7
|
+
const customRules = [
|
|
8
|
+
{ name: "arrow-function-convention", rule: "off" },
|
|
9
|
+
{ name: "comment-regex", rule: "off" },
|
|
10
|
+
{ name: "cyclomatic-complexity", rule: "off" },
|
|
11
|
+
{ name: "file-header", rule: "off" },
|
|
12
|
+
{
|
|
13
|
+
name: "function-name",
|
|
14
|
+
rule: [
|
|
15
|
+
"error",
|
|
16
|
+
{
|
|
17
|
+
format: "^(?:[a-z][a-zA-Z0-9]*|[A-Z][A-Z0-9]*)$",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{ name: "function-return-type", rule: "off" },
|
|
22
|
+
{ name: "max-union-size", rule: "off" },
|
|
23
|
+
{ name: "no-implicit-dependencies", rule: "off" },
|
|
24
|
+
{ name: "no-inconsistent-returns", rule: "off" },
|
|
25
|
+
{ name: "no-undefined-assignment", rule: "off" },
|
|
26
|
+
{ name: "shorthand-property-grouping", rule: "off" }, // Conflicts with perfectionist sorting
|
|
27
|
+
{ name: "todo-tag", rule: "off" },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const rules = genRules(ruleNames, customRules, "sonar");
|
|
31
|
+
|
|
32
|
+
// Turn off duplicate S# rules
|
|
33
|
+
for (const key of keys(rules)) {
|
|
34
|
+
if (/^sonar\/S\d+/u.test(key)) {
|
|
35
|
+
rules[key] = "off";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const sonarRules = rules;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import tailwind from "eslint-plugin-tailwindcss";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
|
|
5
|
+
|
|
6
|
+
// @ts-expect-error ignore
|
|
7
|
+
const ruleNames = keys(getNonDeprecatedRules(tailwind.rules ?? {}));
|
|
8
|
+
const customRules = [{ name: "no-custom-classname", rule: "off" }];
|
|
9
|
+
|
|
10
|
+
export const tailwindRules = genRules(ruleNames, customRules, "tailwind");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import tanstack from "@tanstack/eslint-plugin-query";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
|
|
5
|
+
|
|
6
|
+
// @ts-expect-error it's fine
|
|
7
|
+
const ruleNames = keys(getNonDeprecatedRules(tanstack.rules));
|
|
8
|
+
|
|
9
|
+
export const tanstackQueryRules = genRules(ruleNames, [], "@tanstack/query");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import tanstack from "@tanstack/eslint-plugin-router";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import { genRules, getNonDeprecatedRules } from "./gen-rules.js";
|
|
5
|
+
|
|
6
|
+
// @ts-expect-error it's fine
|
|
7
|
+
const ruleNames = keys(getNonDeprecatedRules(tanstack.rules));
|
|
8
|
+
|
|
9
|
+
export const tanstackRouterRules = genRules(ruleNames, [], "@tanstack/router");
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import keys from "lodash/keys.js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
type EsLintRules,
|
|
6
|
+
genRules,
|
|
7
|
+
getNonDeprecatedRules,
|
|
8
|
+
} from "./gen-rules.ts";
|
|
9
|
+
|
|
10
|
+
const ruleNames = keys(
|
|
11
|
+
getNonDeprecatedRules(
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
13
|
+
(tseslint.plugin.rules ?? {}) as unknown as EsLintRules,
|
|
14
|
+
),
|
|
15
|
+
);
|
|
16
|
+
const customRules = [
|
|
17
|
+
{
|
|
18
|
+
name: "adjacent-overload-signatures",
|
|
19
|
+
rule: "off",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "class-methods-use-this",
|
|
23
|
+
rule: "off",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "consistent-return",
|
|
27
|
+
rule: "off",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "consistent-type-definitions",
|
|
31
|
+
rule: ["error", "type"],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "consistent-type-imports",
|
|
35
|
+
rule: ["error", { fixStyle: "inline-type-imports" }],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "explicit-function-return-type",
|
|
39
|
+
rule: "off",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "explicit-module-boundary-types",
|
|
43
|
+
rule: "off",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "init-declarations",
|
|
47
|
+
rule: "off",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "member-ordering",
|
|
51
|
+
rule: "off",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "naming-convention",
|
|
55
|
+
rule: "off",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "no-dupe-class-members",
|
|
59
|
+
rule: "off",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "no-invalid-this",
|
|
63
|
+
rule: "off",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "no-magic-numbers",
|
|
67
|
+
rule: "off",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "no-redeclare",
|
|
71
|
+
rule: "off",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "no-unnecessary-type-parameters",
|
|
75
|
+
rule: "off",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "no-use-before-define",
|
|
79
|
+
rule: "off",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "parameter-properties",
|
|
83
|
+
rule: "off",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "prefer-readonly-parameter-types",
|
|
87
|
+
rule: "off",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "typedef",
|
|
91
|
+
rule: "off",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "max-params",
|
|
95
|
+
rule: "off",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "no-unused-vars",
|
|
99
|
+
rule: [
|
|
100
|
+
"error",
|
|
101
|
+
{
|
|
102
|
+
args: "all",
|
|
103
|
+
argsIgnorePattern: "^_",
|
|
104
|
+
caughtErrors: "all",
|
|
105
|
+
caughtErrorsIgnorePattern: "^_",
|
|
106
|
+
destructuredArrayIgnorePattern: "^_",
|
|
107
|
+
ignoreRestSiblings: true,
|
|
108
|
+
varsIgnorePattern: "^_",
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
export const typescriptRules = genRules(
|
|
115
|
+
ruleNames,
|
|
116
|
+
customRules,
|
|
117
|
+
"@typescript-eslint",
|
|
118
|
+
);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import unicorn from "eslint-plugin-unicorn";
|
|
2
|
+
import keys from "lodash/keys.js";
|
|
3
|
+
|
|
4
|
+
import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
|
|
5
|
+
|
|
6
|
+
const ruleNames = keys(getNonDeprecatedRules(unicorn.rules ?? {}));
|
|
7
|
+
const customRules = [
|
|
8
|
+
{
|
|
9
|
+
name: "empty-brace-spaces",
|
|
10
|
+
rule: "off",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "explicit-length-check",
|
|
14
|
+
rule: "off",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "no-keyword-prefix",
|
|
18
|
+
rule: "off",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "no-nested-ternary",
|
|
22
|
+
rule: "off",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "no-null",
|
|
26
|
+
rule: "off",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "number-literal-case",
|
|
30
|
+
rule: "off",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "template-indent",
|
|
34
|
+
rule: "off",
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export const unicornRules = genRules(ruleNames, customRules, "unicorn");
|
package/tsconfig.json
ADDED
package/config.react.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r,b as e}from"./chunk-WK3YS7OG.js";import o from"@eslint-react/eslint-plugin";import t from"eslint-plugin-react-compiler";import n from"eslint-plugin-react-hooks";import a from"typescript-eslint";var l=a.config({files:["**/*.{jsx,tsx}"],ignores:r,languageOptions:e,settings:{react:{version:"19.0.0"}},plugins:{react:o,"react-hooks":n,"react-compiler":t},rules:{"react/avoid-shorthand-boolean":"off","react/avoid-shorthand-fragment":"off","react/debug/class-component":"off","react/debug/function-component":"off","react/debug/hook":"off","react/debug/is-from-react":"off","react/debug/react-hooks":"off","react/dom/no-children-in-void-dom-elements":"error","react/dom/no-dangerously-set-innerhtml":"error","react/dom/no-dangerously-set-innerhtml-with-children":"error","react/dom/no-find-dom-node":"error","react/dom/no-missing-button-type":"error","react/dom/no-missing-iframe-sandbox":"error","react/dom/no-namespace":"error","react/dom/no-render-return-value":"error","react/dom/no-script-url":"error","react/dom/no-unknown-property":"error","react/dom/no-unsafe-iframe-sandbox":"error","react/dom/no-unsafe-target-blank":"error","react/dom/no-void-elements-with-children":"error","react/ensure-forward-ref-using-ref":"error","react/hooks-extra/ensure-custom-hooks-using-other-hooks":"error","react/hooks-extra/ensure-use-callback-has-non-empty-deps":"error","react/hooks-extra/ensure-use-memo-has-non-empty-deps":"error","react/hooks-extra/no-direct-set-state-in-use-effect":"error","react/hooks-extra/no-direct-set-state-in-use-layout-effect":"error","react/hooks-extra/no-redundant-custom-hook":"error","react/hooks-extra/no-unnecessary-use-callback":"error","react/hooks-extra/no-unnecessary-use-memo":"error","react/hooks-extra/no-useless-custom-hooks":"error","react/hooks-extra/prefer-use-state-lazy-initialization":"error","react/jsx-no-duplicate-props":"error","react/jsx-uses-vars":"error","react/naming-convention/component-name":"error","react/naming-convention/filename":["error",{rule:"kebab-case"}],"react/naming-convention/filename-extension":"error","react/naming-convention/use-state":"error","react/no-access-state-in-setstate":"error","react/no-array-index-key":"error","react/no-children-count":"error","react/no-children-for-each":"error","react/no-children-map":"error","react/no-children-only":"error","react/no-children-prop":"error","react/no-children-to-array":"error","react/no-class-component":"error","react/no-clone-element":"error","react/no-comment-textnodes":"error","react/no-complex-conditional-rendering":"error","react/no-complicated-conditional-rendering":"error","react/no-component-will-mount":"error","react/no-component-will-receive-props":"error","react/no-component-will-update":"error","react/no-context-provider":"error","react/no-create-ref":"error","react/no-default-props":"error","react/no-direct-mutation-state":"error","react/no-duplicate-jsx-props":"error","react/no-duplicate-key":"error","react/no-forward-ref":"error","react/no-implicit-key":"error","react/no-leaked-conditional-rendering":"error","react/no-missing-component-display-name":"error","react/no-missing-context-display-name":"error","react/no-missing-key":"error","react/no-nested-components":"error","react/no-prop-types":"error","react/no-redundant-should-component-update":"error","react/no-set-state-in-component-did-mount":"error","react/no-set-state-in-component-did-update":"error","react/no-set-state-in-component-will-update":"error","react/no-string-refs":"error","react/no-unsafe-component-will-mount":"error","react/no-unsafe-component-will-receive-props":"error","react/no-unsafe-component-will-update":"error","react/no-unstable-context-value":"error","react/no-unstable-default-props":"error","react/no-unused-class-component-members":"error","react/no-unused-state":"error","react/no-use-context":"error","react/no-useless-fragment":"error","react/prefer-destructuring-assignment":"error","react/prefer-react-namespace-import":"error","react/prefer-read-only-props":"error","react/prefer-shorthand-boolean":"error","react/prefer-shorthand-fragment":"error","react/use-jsx-vars":"error","react/web-api/no-leaked-event-listener":"error","react/web-api/no-leaked-interval":"error","react/web-api/no-leaked-resize-observer":"error","react/web-api/no-leaked-timeout":"error","react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react-compiler/react-compiler":"error"}});export{l as default};
|
|
2
|
-
//# sourceMappingURL=config.react.js.map
|
package/config.react.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.react.js"],"sourcesContent":["// @ts-nocheck\nimport { ignores, languageOptions } from \"./constants.js\";\nimport react from \"@eslint-react/eslint-plugin\";\nimport reactCompiler from \"eslint-plugin-react-compiler\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport tseslint from \"typescript-eslint\";\n\nexport default tseslint.config(\n {\n files: [\"**/*.{jsx,tsx}\"],\nignores,\nlanguageOptions,\nsettings: {\n \"react\":{\"version\":\"19.0.0\"}\n},\n plugins: {\n \"react\": react,\"react-hooks\": reactHooks,\"react-compiler\": reactCompiler,\n },\n rules: {\n \"react/avoid-shorthand-boolean\":\"off\",\"react/avoid-shorthand-fragment\":\"off\",\"react/debug/class-component\":\"off\",\"react/debug/function-component\":\"off\",\"react/debug/hook\":\"off\",\"react/debug/is-from-react\":\"off\",\"react/debug/react-hooks\":\"off\",\"react/dom/no-children-in-void-dom-elements\":\"error\",\"react/dom/no-dangerously-set-innerhtml\":\"error\",\"react/dom/no-dangerously-set-innerhtml-with-children\":\"error\",\"react/dom/no-find-dom-node\":\"error\",\"react/dom/no-missing-button-type\":\"error\",\"react/dom/no-missing-iframe-sandbox\":\"error\",\"react/dom/no-namespace\":\"error\",\"react/dom/no-render-return-value\":\"error\",\"react/dom/no-script-url\":\"error\",\"react/dom/no-unknown-property\":\"error\",\"react/dom/no-unsafe-iframe-sandbox\":\"error\",\"react/dom/no-unsafe-target-blank\":\"error\",\"react/dom/no-void-elements-with-children\":\"error\",\"react/ensure-forward-ref-using-ref\":\"error\",\"react/hooks-extra/ensure-custom-hooks-using-other-hooks\":\"error\",\"react/hooks-extra/ensure-use-callback-has-non-empty-deps\":\"error\",\"react/hooks-extra/ensure-use-memo-has-non-empty-deps\":\"error\",\"react/hooks-extra/no-direct-set-state-in-use-effect\":\"error\",\"react/hooks-extra/no-direct-set-state-in-use-layout-effect\":\"error\",\"react/hooks-extra/no-redundant-custom-hook\":\"error\",\"react/hooks-extra/no-unnecessary-use-callback\":\"error\",\"react/hooks-extra/no-unnecessary-use-memo\":\"error\",\"react/hooks-extra/no-useless-custom-hooks\":\"error\",\"react/hooks-extra/prefer-use-state-lazy-initialization\":\"error\",\"react/jsx-no-duplicate-props\":\"error\",\"react/jsx-uses-vars\":\"error\",\"react/naming-convention/component-name\":\"error\",\"react/naming-convention/filename\":[\"error\",{\"rule\":\"kebab-case\"}],\"react/naming-convention/filename-extension\":\"error\",\"react/naming-convention/use-state\":\"error\",\"react/no-access-state-in-setstate\":\"error\",\"react/no-array-index-key\":\"error\",\"react/no-children-count\":\"error\",\"react/no-children-for-each\":\"error\",\"react/no-children-map\":\"error\",\"react/no-children-only\":\"error\",\"react/no-children-prop\":\"error\",\"react/no-children-to-array\":\"error\",\"react/no-class-component\":\"error\",\"react/no-clone-element\":\"error\",\"react/no-comment-textnodes\":\"error\",\"react/no-complex-conditional-rendering\":\"error\",\"react/no-complicated-conditional-rendering\":\"error\",\"react/no-component-will-mount\":\"error\",\"react/no-component-will-receive-props\":\"error\",\"react/no-component-will-update\":\"error\",\"react/no-context-provider\":\"error\",\"react/no-create-ref\":\"error\",\"react/no-default-props\":\"error\",\"react/no-direct-mutation-state\":\"error\",\"react/no-duplicate-jsx-props\":\"error\",\"react/no-duplicate-key\":\"error\",\"react/no-forward-ref\":\"error\",\"react/no-implicit-key\":\"error\",\"react/no-leaked-conditional-rendering\":\"error\",\"react/no-missing-component-display-name\":\"error\",\"react/no-missing-context-display-name\":\"error\",\"react/no-missing-key\":\"error\",\"react/no-nested-components\":\"error\",\"react/no-prop-types\":\"error\",\"react/no-redundant-should-component-update\":\"error\",\"react/no-set-state-in-component-did-mount\":\"error\",\"react/no-set-state-in-component-did-update\":\"error\",\"react/no-set-state-in-component-will-update\":\"error\",\"react/no-string-refs\":\"error\",\"react/no-unsafe-component-will-mount\":\"error\",\"react/no-unsafe-component-will-receive-props\":\"error\",\"react/no-unsafe-component-will-update\":\"error\",\"react/no-unstable-context-value\":\"error\",\"react/no-unstable-default-props\":\"error\",\"react/no-unused-class-component-members\":\"error\",\"react/no-unused-state\":\"error\",\"react/no-use-context\":\"error\",\"react/no-useless-fragment\":\"error\",\"react/prefer-destructuring-assignment\":\"error\",\"react/prefer-react-namespace-import\":\"error\",\"react/prefer-read-only-props\":\"error\",\"react/prefer-shorthand-boolean\":\"error\",\"react/prefer-shorthand-fragment\":\"error\",\"react/use-jsx-vars\":\"error\",\"react/web-api/no-leaked-event-listener\":\"error\",\"react/web-api/no-leaked-interval\":\"error\",\"react/web-api/no-leaked-resize-observer\":\"error\",\"react/web-api/no-leaked-timeout\":\"error\",\"react-hooks/exhaustive-deps\":\"error\",\"react-hooks/rules-of-hooks\":\"error\",\"react-compiler/react-compiler\":\"error\"\n },\n },\n \n \n );\n"],"mappings":"+CAEA,OAAOA,MAAW,8BAClB,OAAOC,MAAmB,+BAC1B,OAAOC,MAAgB,4BACvB,OAAOC,MAAc,oBAErB,IAAOC,EAAQD,EAAS,OACpB,CACA,MAAO,CAAC,gBAAgB,EAC5B,QAAAE,EACA,gBAAAC,EACA,SAAU,CACR,MAAQ,CAAC,QAAU,QAAQ,CAC7B,EACI,QAAS,CACP,MAASN,EAAM,cAAeE,EAAW,iBAAkBD,CAC7D,EACA,MAAO,CACL,gCAAgC,MAAM,iCAAiC,MAAM,8BAA8B,MAAM,iCAAiC,MAAM,mBAAmB,MAAM,4BAA4B,MAAM,0BAA0B,MAAM,6CAA6C,QAAQ,yCAAyC,QAAQ,uDAAuD,QAAQ,6BAA6B,QAAQ,mCAAmC,QAAQ,sCAAsC,QAAQ,yBAAyB,QAAQ,mCAAmC,QAAQ,0BAA0B,QAAQ,gCAAgC,QAAQ,qCAAqC,QAAQ,mCAAmC,QAAQ,2CAA2C,QAAQ,qCAAqC,QAAQ,0DAA0D,QAAQ,2DAA2D,QAAQ,uDAAuD,QAAQ,sDAAsD,QAAQ,6DAA6D,QAAQ,6CAA6C,QAAQ,gDAAgD,QAAQ,4CAA4C,QAAQ,4CAA4C,QAAQ,yDAAyD,QAAQ,+BAA+B,QAAQ,sBAAsB,QAAQ,yCAAyC,QAAQ,mCAAmC,CAAC,QAAQ,CAAC,KAAO,YAAY,CAAC,EAAE,6CAA6C,QAAQ,oCAAoC,QAAQ,oCAAoC,QAAQ,2BAA2B,QAAQ,0BAA0B,QAAQ,6BAA6B,QAAQ,wBAAwB,QAAQ,yBAAyB,QAAQ,yBAAyB,QAAQ,6BAA6B,QAAQ,2BAA2B,QAAQ,yBAAyB,QAAQ,6BAA6B,QAAQ,yCAAyC,QAAQ,6CAA6C,QAAQ,gCAAgC,QAAQ,wCAAwC,QAAQ,iCAAiC,QAAQ,4BAA4B,QAAQ,sBAAsB,QAAQ,yBAAyB,QAAQ,iCAAiC,QAAQ,+BAA+B,QAAQ,yBAAyB,QAAQ,uBAAuB,QAAQ,wBAAwB,QAAQ,wCAAwC,QAAQ,0CAA0C,QAAQ,wCAAwC,QAAQ,uBAAuB,QAAQ,6BAA6B,QAAQ,sBAAsB,QAAQ,6CAA6C,QAAQ,4CAA4C,QAAQ,6CAA6C,QAAQ,8CAA8C,QAAQ,uBAAuB,QAAQ,uCAAuC,QAAQ,+CAA+C,QAAQ,wCAAwC,QAAQ,kCAAkC,QAAQ,kCAAkC,QAAQ,0CAA0C,QAAQ,wBAAwB,QAAQ,uBAAuB,QAAQ,4BAA4B,QAAQ,wCAAwC,QAAQ,sCAAsC,QAAQ,+BAA+B,QAAQ,iCAAiC,QAAQ,kCAAkC,QAAQ,qBAAqB,QAAQ,yCAAyC,QAAQ,mCAAmC,QAAQ,0CAA0C,QAAQ,kCAAkC,QAAQ,8BAA8B,QAAQ,6BAA6B,QAAQ,gCAAgC,OAC39H,CACF,CAGA","names":["react","reactCompiler","reactHooks","tseslint","config_react_default","ignores","languageOptions"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|