js-style-kit 0.2.8 → 0.2.10
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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/eslint/base/config.js +453 -5
- package/dist/eslint/base/config.js.map +1 -1
- package/dist/eslint/base/rules.js +421 -3
- package/dist/eslint/base/rules.js.map +1 -1
- package/dist/eslint/constants.d.ts +15 -14
- package/dist/eslint/constants.js +21 -3
- package/dist/eslint/constants.js.map +1 -1
- package/dist/eslint/ignores.js +38 -4
- package/dist/eslint/ignores.js.map +1 -1
- package/dist/eslint/index.d.ts +5 -0
- package/dist/eslint/index.js +1406 -27
- package/dist/eslint/index.js.map +1 -1
- package/dist/eslint/jsdoc/config.js +105 -5
- package/dist/eslint/jsdoc/config.js.map +1 -1
- package/dist/eslint/jsdoc/rules.js +69 -3
- package/dist/eslint/jsdoc/rules.js.map +1 -1
- package/dist/eslint/nextjs/config.d.ts +12 -0
- package/dist/eslint/nextjs/config.js +62 -0
- package/dist/eslint/nextjs/config.js.map +1 -0
- package/dist/eslint/nextjs/rules.d.ts +8 -0
- package/dist/eslint/nextjs/rules.js +28 -0
- package/dist/eslint/nextjs/rules.js.map +1 -0
- package/dist/eslint/nextjs/types.d.ts +29 -0
- package/dist/eslint/nextjs/types.js +1 -0
- package/dist/eslint/nextjs/types.js.map +1 -0
- package/dist/eslint/perfectionist/config.js +61 -5
- package/dist/eslint/perfectionist/config.js.map +1 -1
- package/dist/eslint/perfectionist/rules.js +27 -3
- package/dist/eslint/perfectionist/rules.js.map +1 -1
- package/dist/eslint/prefer-arrow-function/config.js +41 -4
- package/dist/eslint/prefer-arrow-function/config.js.map +1 -1
- package/dist/eslint/react/config.js +182 -5
- package/dist/eslint/react/config.js.map +1 -1
- package/dist/eslint/react/rules.js +128 -3
- package/dist/eslint/react/rules.js.map +1 -1
- package/dist/eslint/react-compiler/config.js +35 -4
- package/dist/eslint/react-compiler/config.js.map +1 -1
- package/dist/eslint/react-refresh/config.js +51 -5
- package/dist/eslint/react-refresh/config.js.map +1 -1
- package/dist/eslint/react-refresh/rules.js +15 -3
- package/dist/eslint/react-refresh/rules.js.map +1 -1
- package/dist/eslint/storybook/config.js +63 -4
- package/dist/eslint/storybook/config.js.map +1 -1
- package/dist/eslint/testing/config.js +165 -6
- package/dist/eslint/testing/config.js.map +1 -1
- package/dist/eslint/testing/jest-rules.js +40 -3
- package/dist/eslint/testing/jest-rules.js.map +1 -1
- package/dist/eslint/testing/vitest-rules.js +46 -3
- package/dist/eslint/testing/vitest-rules.js.map +1 -1
- package/dist/eslint/turbo/config.js +35 -4
- package/dist/eslint/turbo/config.js.map +1 -1
- package/dist/eslint/types.d.ts +1 -1
- package/dist/eslint/typescript/config.js +182 -5
- package/dist/eslint/typescript/config.js.map +1 -1
- package/dist/eslint/typescript/rules.js +131 -3
- package/dist/eslint/typescript/rules.js.map +1 -1
- package/dist/eslint/unicorn/config.js +109 -5
- package/dist/eslint/unicorn/config.js.map +1 -1
- package/dist/eslint/unicorn/rules.js +75 -3
- package/dist/eslint/unicorn/rules.js.map +1 -1
- package/dist/index.js +1527 -31
- package/dist/index.js.map +1 -1
- package/dist/prettier/index.js +128 -5
- package/dist/prettier/index.js.map +1 -1
- package/dist/prettier/patch-tailwind-plugin.js +68 -3
- package/dist/prettier/patch-tailwind-plugin.js.map +1 -1
- package/dist/utils/is-type.js +19 -8
- package/dist/utils/is-type.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-26SVGV32.js +0 -133
- package/dist/chunk-26SVGV32.js.map +0 -1
- package/dist/chunk-2PDDRRZG.js +0 -21
- package/dist/chunk-2PDDRRZG.js.map +0 -1
- package/dist/chunk-3SHRYTUT.js +0 -32
- package/dist/chunk-3SHRYTUT.js.map +0 -1
- package/dist/chunk-6L7EDNAG.js +0 -20
- package/dist/chunk-6L7EDNAG.js.map +0 -1
- package/dist/chunk-76XASR6Z.js +0 -25
- package/dist/chunk-76XASR6Z.js.map +0 -1
- package/dist/chunk-7FTTMVPP.js +0 -20
- package/dist/chunk-7FTTMVPP.js.map +0 -1
- package/dist/chunk-7OLD3L3V.js +0 -64
- package/dist/chunk-7OLD3L3V.js.map +0 -1
- package/dist/chunk-A6AJGHPQ.js +0 -20
- package/dist/chunk-A6AJGHPQ.js.map +0 -1
- package/dist/chunk-AV6CI5A5.js +0 -141
- package/dist/chunk-AV6CI5A5.js.map +0 -1
- package/dist/chunk-CNYUGKH5.js +0 -38
- package/dist/chunk-CNYUGKH5.js.map +0 -1
- package/dist/chunk-HLIJN23S.js +0 -23
- package/dist/chunk-HLIJN23S.js.map +0 -1
- package/dist/chunk-HMC2O35U.js +0 -25
- package/dist/chunk-HMC2O35U.js.map +0 -1
- package/dist/chunk-HOZDQJWG.js +0 -51
- package/dist/chunk-HOZDQJWG.js.map +0 -1
- package/dist/chunk-LITSWCYQ.js +0 -135
- package/dist/chunk-LITSWCYQ.js.map +0 -1
- package/dist/chunk-N7AG2EKX.js +0 -48
- package/dist/chunk-N7AG2EKX.js.map +0 -1
- package/dist/chunk-PSSB4TGO.js +0 -29
- package/dist/chunk-PSSB4TGO.js.map +0 -1
- package/dist/chunk-SWT2QOL3.js +0 -21
- package/dist/chunk-SWT2QOL3.js.map +0 -1
- package/dist/chunk-U7AFEGMK.js +0 -23
- package/dist/chunk-U7AFEGMK.js.map +0 -1
- package/dist/chunk-UHCQX54J.js +0 -68
- package/dist/chunk-UHCQX54J.js.map +0 -1
- package/dist/chunk-UV6CA4PE.js +0 -45
- package/dist/chunk-UV6CA4PE.js.map +0 -1
- package/dist/chunk-X7JRY6MS.js +0 -41
- package/dist/chunk-X7JRY6MS.js.map +0 -1
- package/dist/chunk-XBITZIAZ.js +0 -21
- package/dist/chunk-XBITZIAZ.js.map +0 -1
- package/dist/chunk-XCPOAYGQ.js +0 -80
- package/dist/chunk-XCPOAYGQ.js.map +0 -1
- package/dist/chunk-XICOWKSV.js +0 -426
- package/dist/chunk-XICOWKSV.js.map +0 -1
- package/dist/chunk-YFJ363HR.js +0 -26
- package/dist/chunk-YFJ363HR.js.map +0 -1
- package/dist/chunk-YZG34ZNI.js +0 -80
- package/dist/chunk-YZG34ZNI.js.map +0 -1
- package/dist/chunk-ZED5DLW7.js +0 -73
- package/dist/chunk-ZED5DLW7.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,8 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// src/eslint/perfectionist/config.ts
|
|
2
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
3
|
+
|
|
4
|
+
// src/eslint/constants.ts
|
|
5
|
+
var configNames = {
|
|
6
|
+
base: "base",
|
|
7
|
+
disableTypeChecked: "typescript-eslint/disable-type-checked",
|
|
8
|
+
ignores: "ignores",
|
|
9
|
+
jsdoc: "jsdoc",
|
|
10
|
+
markdown: "markdown",
|
|
11
|
+
nextjs: "nextjs",
|
|
12
|
+
perfectionist: "perfectionist",
|
|
13
|
+
preferArrowFunction: "prefer-arrow-function",
|
|
14
|
+
react: "react",
|
|
15
|
+
reactCompiler: "react-compiler",
|
|
16
|
+
reactRefresh: "react-refresh",
|
|
17
|
+
storybook: "storybook:stories",
|
|
18
|
+
storybookConfig: "storybook:config",
|
|
19
|
+
testing: "testing",
|
|
20
|
+
turbo: "turbo",
|
|
21
|
+
typescript: "tseslint",
|
|
22
|
+
typescriptTesting: "tseslint-testing",
|
|
23
|
+
unicorn: "unicorn"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/eslint/perfectionist/rules.ts
|
|
27
|
+
var defaultOptions = {
|
|
28
|
+
order: "asc",
|
|
29
|
+
type: "natural"
|
|
30
|
+
};
|
|
31
|
+
var perfectionistRules = {
|
|
32
|
+
"perfectionist/sort-array-includes": ["warn", defaultOptions],
|
|
33
|
+
"perfectionist/sort-classes": ["warn", defaultOptions],
|
|
34
|
+
"perfectionist/sort-decorators": ["warn", defaultOptions],
|
|
35
|
+
"perfectionist/sort-enums": ["warn", defaultOptions],
|
|
36
|
+
"perfectionist/sort-exports": ["warn", defaultOptions],
|
|
37
|
+
"perfectionist/sort-heritage-clauses": ["warn", defaultOptions],
|
|
38
|
+
"perfectionist/sort-imports": ["warn", defaultOptions],
|
|
39
|
+
"perfectionist/sort-interfaces": ["warn", defaultOptions],
|
|
40
|
+
"perfectionist/sort-intersection-types": ["warn", defaultOptions],
|
|
41
|
+
"perfectionist/sort-jsx-props": ["warn", defaultOptions],
|
|
42
|
+
"perfectionist/sort-maps": ["warn", defaultOptions],
|
|
43
|
+
"perfectionist/sort-modules": ["off", defaultOptions],
|
|
44
|
+
"perfectionist/sort-named-exports": ["warn", defaultOptions],
|
|
45
|
+
"perfectionist/sort-named-imports": ["warn", defaultOptions],
|
|
46
|
+
"perfectionist/sort-object-types": ["warn", defaultOptions],
|
|
47
|
+
"perfectionist/sort-objects": ["warn", defaultOptions],
|
|
48
|
+
"perfectionist/sort-sets": ["warn", defaultOptions],
|
|
49
|
+
"perfectionist/sort-switch-case": ["warn", defaultOptions],
|
|
50
|
+
"perfectionist/sort-union-types": ["warn", defaultOptions],
|
|
51
|
+
"perfectionist/sort-variable-declarations": ["warn", defaultOptions]
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// src/eslint/perfectionist/config.ts
|
|
55
|
+
var perfectionistConfig = {
|
|
56
|
+
name: configNames.perfectionist,
|
|
57
|
+
plugins: {
|
|
58
|
+
perfectionist
|
|
59
|
+
},
|
|
60
|
+
rules: perfectionistRules
|
|
61
|
+
};
|
|
6
62
|
export {
|
|
7
63
|
perfectionistConfig
|
|
8
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/perfectionist/config.ts","../../../src/eslint/constants.ts","../../../src/eslint/perfectionist/rules.ts"],"sourcesContent":["import perfectionist from \"eslint-plugin-perfectionist\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { perfectionistRules } from \"./rules.js\";\n\nexport const perfectionistConfig: EslintConfigObject = {\n name: configNames.perfectionist,\n plugins: {\n perfectionist,\n },\n rules: perfectionistRules,\n};\n","/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n","import type { EslintRuleConfig } from \"../types.js\";\n\ninterface PerfectionistRuleOptions {\n order: \"asc\" | \"desc\";\n type: \"alphabetical\" | \"custom\" | \"line-length\" | \"natural\";\n}\n\nconst defaultOptions: PerfectionistRuleOptions = {\n order: \"asc\",\n type: \"natural\",\n};\n\ntype PerfectionRules = Record<\n `perfectionist/${string}`,\n EslintRuleConfig<PerfectionistRuleOptions>\n>;\n\nexport const perfectionistRules: PerfectionRules = {\n \"perfectionist/sort-array-includes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-classes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-decorators\": [\"warn\", defaultOptions],\n \"perfectionist/sort-enums\": [\"warn\", defaultOptions],\n \"perfectionist/sort-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-heritage-clauses\": [\"warn\", defaultOptions],\n \"perfectionist/sort-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-interfaces\": [\"warn\", defaultOptions],\n \"perfectionist/sort-intersection-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-jsx-props\": [\"warn\", defaultOptions],\n \"perfectionist/sort-maps\": [\"warn\", defaultOptions],\n \"perfectionist/sort-modules\": [\"off\", defaultOptions],\n \"perfectionist/sort-named-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-named-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-object-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-objects\": [\"warn\", defaultOptions],\n \"perfectionist/sort-sets\": [\"warn\", defaultOptions],\n \"perfectionist/sort-switch-case\": [\"warn\", defaultOptions],\n \"perfectionist/sort-union-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-variable-declarations\": [\"warn\", defaultOptions],\n};\n"],"mappings":";AAAA,OAAO,mBAAmB;;;ACKnB,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;;;ACjBA,IAAM,iBAA2C;AAAA,EAC/C,OAAO;AAAA,EACP,MAAM;AACR;AAOO,IAAM,qBAAsC;AAAA,EACjD,qCAAqC,CAAC,QAAQ,cAAc;AAAA,EAC5D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,4BAA4B,CAAC,QAAQ,cAAc;AAAA,EACnD,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,uCAAuC,CAAC,QAAQ,cAAc;AAAA,EAC9D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,yCAAyC,CAAC,QAAQ,cAAc;AAAA,EAChE,gCAAgC,CAAC,QAAQ,cAAc;AAAA,EACvD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,8BAA8B,CAAC,OAAO,cAAc;AAAA,EACpD,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,mCAAmC,CAAC,QAAQ,cAAc;AAAA,EAC1D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,4CAA4C,CAAC,QAAQ,cAAc;AACrE;;;AF/BO,IAAM,sBAA0C;AAAA,EACrD,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA,OAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/eslint/perfectionist/rules.ts
|
|
2
|
+
var defaultOptions = {
|
|
3
|
+
order: "asc",
|
|
4
|
+
type: "natural"
|
|
5
|
+
};
|
|
6
|
+
var perfectionistRules = {
|
|
7
|
+
"perfectionist/sort-array-includes": ["warn", defaultOptions],
|
|
8
|
+
"perfectionist/sort-classes": ["warn", defaultOptions],
|
|
9
|
+
"perfectionist/sort-decorators": ["warn", defaultOptions],
|
|
10
|
+
"perfectionist/sort-enums": ["warn", defaultOptions],
|
|
11
|
+
"perfectionist/sort-exports": ["warn", defaultOptions],
|
|
12
|
+
"perfectionist/sort-heritage-clauses": ["warn", defaultOptions],
|
|
13
|
+
"perfectionist/sort-imports": ["warn", defaultOptions],
|
|
14
|
+
"perfectionist/sort-interfaces": ["warn", defaultOptions],
|
|
15
|
+
"perfectionist/sort-intersection-types": ["warn", defaultOptions],
|
|
16
|
+
"perfectionist/sort-jsx-props": ["warn", defaultOptions],
|
|
17
|
+
"perfectionist/sort-maps": ["warn", defaultOptions],
|
|
18
|
+
"perfectionist/sort-modules": ["off", defaultOptions],
|
|
19
|
+
"perfectionist/sort-named-exports": ["warn", defaultOptions],
|
|
20
|
+
"perfectionist/sort-named-imports": ["warn", defaultOptions],
|
|
21
|
+
"perfectionist/sort-object-types": ["warn", defaultOptions],
|
|
22
|
+
"perfectionist/sort-objects": ["warn", defaultOptions],
|
|
23
|
+
"perfectionist/sort-sets": ["warn", defaultOptions],
|
|
24
|
+
"perfectionist/sort-switch-case": ["warn", defaultOptions],
|
|
25
|
+
"perfectionist/sort-union-types": ["warn", defaultOptions],
|
|
26
|
+
"perfectionist/sort-variable-declarations": ["warn", defaultOptions]
|
|
27
|
+
};
|
|
4
28
|
export {
|
|
5
29
|
perfectionistRules
|
|
6
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/perfectionist/rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ninterface PerfectionistRuleOptions {\n order: \"asc\" | \"desc\";\n type: \"alphabetical\" | \"custom\" | \"line-length\" | \"natural\";\n}\n\nconst defaultOptions: PerfectionistRuleOptions = {\n order: \"asc\",\n type: \"natural\",\n};\n\ntype PerfectionRules = Record<\n `perfectionist/${string}`,\n EslintRuleConfig<PerfectionistRuleOptions>\n>;\n\nexport const perfectionistRules: PerfectionRules = {\n \"perfectionist/sort-array-includes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-classes\": [\"warn\", defaultOptions],\n \"perfectionist/sort-decorators\": [\"warn\", defaultOptions],\n \"perfectionist/sort-enums\": [\"warn\", defaultOptions],\n \"perfectionist/sort-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-heritage-clauses\": [\"warn\", defaultOptions],\n \"perfectionist/sort-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-interfaces\": [\"warn\", defaultOptions],\n \"perfectionist/sort-intersection-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-jsx-props\": [\"warn\", defaultOptions],\n \"perfectionist/sort-maps\": [\"warn\", defaultOptions],\n \"perfectionist/sort-modules\": [\"off\", defaultOptions],\n \"perfectionist/sort-named-exports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-named-imports\": [\"warn\", defaultOptions],\n \"perfectionist/sort-object-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-objects\": [\"warn\", defaultOptions],\n \"perfectionist/sort-sets\": [\"warn\", defaultOptions],\n \"perfectionist/sort-switch-case\": [\"warn\", defaultOptions],\n \"perfectionist/sort-union-types\": [\"warn\", defaultOptions],\n \"perfectionist/sort-variable-declarations\": [\"warn\", defaultOptions],\n};\n"],"mappings":";AAOA,IAAM,iBAA2C;AAAA,EAC/C,OAAO;AAAA,EACP,MAAM;AACR;AAOO,IAAM,qBAAsC;AAAA,EACjD,qCAAqC,CAAC,QAAQ,cAAc;AAAA,EAC5D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,4BAA4B,CAAC,QAAQ,cAAc;AAAA,EACnD,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,uCAAuC,CAAC,QAAQ,cAAc;AAAA,EAC9D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,iCAAiC,CAAC,QAAQ,cAAc;AAAA,EACxD,yCAAyC,CAAC,QAAQ,cAAc;AAAA,EAChE,gCAAgC,CAAC,QAAQ,cAAc;AAAA,EACvD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,8BAA8B,CAAC,OAAO,cAAc;AAAA,EACpD,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,oCAAoC,CAAC,QAAQ,cAAc;AAAA,EAC3D,mCAAmC,CAAC,QAAQ,cAAc;AAAA,EAC1D,8BAA8B,CAAC,QAAQ,cAAc;AAAA,EACrD,2BAA2B,CAAC,QAAQ,cAAc;AAAA,EAClD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,kCAAkC,CAAC,QAAQ,cAAc;AAAA,EACzD,4CAA4C,CAAC,QAAQ,cAAc;AACrE;","names":[]}
|
|
@@ -1,7 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// src/eslint/prefer-arrow-function/config.ts
|
|
2
|
+
import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
|
|
3
|
+
|
|
4
|
+
// src/eslint/constants.ts
|
|
5
|
+
var configNames = {
|
|
6
|
+
base: "base",
|
|
7
|
+
disableTypeChecked: "typescript-eslint/disable-type-checked",
|
|
8
|
+
ignores: "ignores",
|
|
9
|
+
jsdoc: "jsdoc",
|
|
10
|
+
markdown: "markdown",
|
|
11
|
+
nextjs: "nextjs",
|
|
12
|
+
perfectionist: "perfectionist",
|
|
13
|
+
preferArrowFunction: "prefer-arrow-function",
|
|
14
|
+
react: "react",
|
|
15
|
+
reactCompiler: "react-compiler",
|
|
16
|
+
reactRefresh: "react-refresh",
|
|
17
|
+
storybook: "storybook:stories",
|
|
18
|
+
storybookConfig: "storybook:config",
|
|
19
|
+
testing: "testing",
|
|
20
|
+
turbo: "turbo",
|
|
21
|
+
typescript: "tseslint",
|
|
22
|
+
typescriptTesting: "tseslint-testing",
|
|
23
|
+
unicorn: "unicorn"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/eslint/prefer-arrow-function/config.ts
|
|
27
|
+
var preferArrowFunctionConfig = () => ({
|
|
28
|
+
name: configNames.preferArrowFunction,
|
|
29
|
+
plugins: {
|
|
30
|
+
"prefer-arrow-functions": preferArrowFunctions
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
"prefer-arrow-functions/prefer-arrow-functions": [
|
|
34
|
+
"warn",
|
|
35
|
+
{
|
|
36
|
+
returnStyle: "unchanged",
|
|
37
|
+
singleReturnOnly: false
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
});
|
|
5
42
|
export {
|
|
6
43
|
preferArrowFunctionConfig
|
|
7
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/prefer-arrow-function/config.ts","../../../src/eslint/constants.ts"],"sourcesContent":["import type { ESLint } from \"eslint\";\n\nimport preferArrowFunctions from \"eslint-plugin-prefer-arrow-functions\";\n\nimport type { EslintConfigObject } from \"../types.js\";\nimport type { PreferArrowFunctionsRules } from \"./types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for Prefer Arrow Functions.\n *\n * @returns ESLint configuration object for Prefer Arrow Functions\n */\nexport const preferArrowFunctionConfig = (): EslintConfigObject => ({\n name: configNames.preferArrowFunction,\n plugins: {\n \"prefer-arrow-functions\": preferArrowFunctions as ESLint.Plugin,\n },\n rules: {\n \"prefer-arrow-functions/prefer-arrow-functions\": [\n \"warn\",\n {\n returnStyle: \"unchanged\",\n singleReturnOnly: false,\n },\n ],\n } satisfies PreferArrowFunctionsRules,\n});\n","/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAEA,OAAO,0BAA0B;;;ACG1B,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;;;ADVO,IAAM,4BAA4B,OAA2B;AAAA,EAClE,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP,0BAA0B;AAAA,EAC5B;AAAA,EACA,OAAO;AAAA,IACL,iDAAiD;AAAA,MAC/C;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,kBAAkB;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,8 +1,185 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "
|
|
5
|
-
|
|
1
|
+
// src/eslint/react/config.ts
|
|
2
|
+
import react from "eslint-plugin-react";
|
|
3
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
4
|
+
import globals from "globals";
|
|
5
|
+
|
|
6
|
+
// src/eslint/constants.ts
|
|
7
|
+
var configNames = {
|
|
8
|
+
base: "base",
|
|
9
|
+
disableTypeChecked: "typescript-eslint/disable-type-checked",
|
|
10
|
+
ignores: "ignores",
|
|
11
|
+
jsdoc: "jsdoc",
|
|
12
|
+
markdown: "markdown",
|
|
13
|
+
nextjs: "nextjs",
|
|
14
|
+
perfectionist: "perfectionist",
|
|
15
|
+
preferArrowFunction: "prefer-arrow-function",
|
|
16
|
+
react: "react",
|
|
17
|
+
reactCompiler: "react-compiler",
|
|
18
|
+
reactRefresh: "react-refresh",
|
|
19
|
+
storybook: "storybook:stories",
|
|
20
|
+
storybookConfig: "storybook:config",
|
|
21
|
+
testing: "testing",
|
|
22
|
+
turbo: "turbo",
|
|
23
|
+
typescript: "tseslint",
|
|
24
|
+
typescriptTesting: "tseslint-testing",
|
|
25
|
+
unicorn: "unicorn"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/eslint/react/rules.ts
|
|
29
|
+
var reactRules = (functionStyle, typescript) => {
|
|
30
|
+
const functionStyleMap = {
|
|
31
|
+
arrow: "arrow-function",
|
|
32
|
+
declaration: "function-declaration",
|
|
33
|
+
expression: "function-expression"
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
/**
|
|
37
|
+
* Disabled in favor of TypeScript for type checking
|
|
38
|
+
*/
|
|
39
|
+
...typescript ? {} : { "react/prop-types": "warn" },
|
|
40
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
41
|
+
"react-hooks/rules-of-hooks": "warn",
|
|
42
|
+
/**
|
|
43
|
+
* Require an explicit type when using button elements.
|
|
44
|
+
*
|
|
45
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
|
|
46
|
+
*/
|
|
47
|
+
"react/button-has-type": "warn",
|
|
48
|
+
"react/destructuring-assignment": ["warn", "always"],
|
|
49
|
+
"react/display-name": "warn",
|
|
50
|
+
/**
|
|
51
|
+
* Require consistent function type for function components.
|
|
52
|
+
*
|
|
53
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md
|
|
54
|
+
*/
|
|
55
|
+
"react/function-component-definition": functionStyle === "off" ? "off" : [
|
|
56
|
+
"warn",
|
|
57
|
+
{
|
|
58
|
+
namedComponents: functionStyleMap[functionStyle],
|
|
59
|
+
unnamedComponents: functionStyle === "arrow" ? "arrow-function" : "function-expression"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
/**
|
|
63
|
+
* Require destructuring and symmetric naming of `useState` hook value and setter variables.
|
|
64
|
+
*
|
|
65
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
|
|
66
|
+
*/
|
|
67
|
+
"react/hook-use-state": "warn",
|
|
68
|
+
/**
|
|
69
|
+
* Require consistent boolean attributes notation in JSX.
|
|
70
|
+
*
|
|
71
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
|
|
72
|
+
*/
|
|
73
|
+
"react/jsx-boolean-value": "warn",
|
|
74
|
+
/**
|
|
75
|
+
* Disallow unnecessary curly braces in JSX props and children.
|
|
76
|
+
*
|
|
77
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
|
|
78
|
+
*/
|
|
79
|
+
"react/jsx-curly-brace-presence": "warn",
|
|
80
|
+
/**
|
|
81
|
+
* Require using shorthand form for React fragments, unless required.
|
|
82
|
+
*
|
|
83
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
|
|
84
|
+
*/
|
|
85
|
+
"react/jsx-fragments": "warn",
|
|
86
|
+
"react/jsx-key": "warn",
|
|
87
|
+
"react/jsx-no-comment-textnodes": "warn",
|
|
88
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
89
|
+
/**
|
|
90
|
+
* Prevent problematic leaked values from being rendered.
|
|
91
|
+
*
|
|
92
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
|
|
93
|
+
*/
|
|
94
|
+
"react/jsx-no-leaked-render": "warn",
|
|
95
|
+
/**
|
|
96
|
+
* Prevents usage of unsafe `target='_blank'`.
|
|
97
|
+
*
|
|
98
|
+
* This rule is a part of `react/recommended`, but we've modified it to
|
|
99
|
+
* allow referrer.
|
|
100
|
+
*
|
|
101
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
|
|
102
|
+
*/
|
|
103
|
+
"react/jsx-no-target-blank": [
|
|
104
|
+
"warn",
|
|
105
|
+
{
|
|
106
|
+
allowReferrer: true
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"react/jsx-no-undef": "warn",
|
|
110
|
+
/**
|
|
111
|
+
* Disallow empty React fragments.
|
|
112
|
+
*
|
|
113
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
|
|
114
|
+
*/
|
|
115
|
+
"react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
|
|
116
|
+
/**
|
|
117
|
+
* Require the use of PascalCase for user-defined JSX components.
|
|
118
|
+
*
|
|
119
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
|
|
120
|
+
*/
|
|
121
|
+
"react/jsx-pascal-case": "warn",
|
|
122
|
+
"react/jsx-uses-react": "warn",
|
|
123
|
+
"react/jsx-uses-vars": "warn",
|
|
124
|
+
/**
|
|
125
|
+
* Disallow usage of Array index in keys.
|
|
126
|
+
*
|
|
127
|
+
* � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
|
|
128
|
+
*/
|
|
129
|
+
"react/no-array-index-key": "warn",
|
|
130
|
+
"react/no-children-prop": "warn",
|
|
131
|
+
"react/no-danger-with-children": "warn",
|
|
132
|
+
"react/no-deprecated": "warn",
|
|
133
|
+
"react/no-direct-mutation-state": "warn",
|
|
134
|
+
"react/no-find-dom-node": "warn",
|
|
135
|
+
"react/no-is-mounted": "warn",
|
|
136
|
+
"react/no-render-return-value": "warn",
|
|
137
|
+
"react/no-string-refs": "warn",
|
|
138
|
+
"react/no-unescaped-entities": "warn",
|
|
139
|
+
"react/no-unknown-property": "warn",
|
|
140
|
+
"react/no-unsafe": "warn",
|
|
141
|
+
/**
|
|
142
|
+
* Disallow creating unstable components inside components.
|
|
143
|
+
*
|
|
144
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
|
|
145
|
+
*/
|
|
146
|
+
"react/no-unstable-nested-components": "warn",
|
|
147
|
+
"react/require-render-return": "warn",
|
|
148
|
+
/**
|
|
149
|
+
* Disallow closing tags for components without children.
|
|
150
|
+
*
|
|
151
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
|
|
152
|
+
*/
|
|
153
|
+
"react/self-closing-comp": "warn"
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/eslint/react/config.ts
|
|
158
|
+
var reactEslintConfig = (functionStyle, typescript) => {
|
|
159
|
+
return {
|
|
160
|
+
languageOptions: {
|
|
161
|
+
globals: {
|
|
162
|
+
...globals.browser
|
|
163
|
+
},
|
|
164
|
+
parserOptions: {
|
|
165
|
+
ecmaFeatures: {
|
|
166
|
+
jsx: true
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
name: configNames.react,
|
|
171
|
+
plugins: {
|
|
172
|
+
react,
|
|
173
|
+
"react-hooks": pluginReactHooks
|
|
174
|
+
},
|
|
175
|
+
rules: reactRules(functionStyle, typescript),
|
|
176
|
+
settings: {
|
|
177
|
+
react: {
|
|
178
|
+
version: "detect"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
};
|
|
6
183
|
export {
|
|
7
184
|
reactEslintConfig
|
|
8
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/react/config.ts","../../../src/eslint/constants.ts","../../../src/eslint/react/rules.ts"],"sourcesContent":["import react from \"eslint-plugin-react\";\nimport pluginReactHooks from \"eslint-plugin-react-hooks\";\nimport globals from \"globals\";\n\nimport type { EslintConfigObject, FunctionStyle } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { reactRules } from \"./rules.js\";\n\n/**\n * Generates ESLint configuration for React.\n *\n * @param functionStyle - Controls how functions (components) should be written. Can be:\n * - \"off\": Disables function style enforcement\n * - \"arrow\": Enforces arrow function expressions\n * - \"declaration\": Enforces function declarations\n * - \"expression\": Enforces function expressions\n * @param typescript - Whether TypeScript is being used in the project. When true, some rules are adjusted to be more TypeScript-friendly. Defaults to true.\n * @returns An ESLint configuration object for React.\n */\nexport const reactEslintConfig = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n): EslintConfigObject => {\n return {\n languageOptions: {\n globals: {\n ...globals.browser,\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n name: configNames.react,\n plugins: {\n react,\n \"react-hooks\": pluginReactHooks,\n },\n rules: reactRules(functionStyle, typescript),\n settings: {\n react: {\n version: \"detect\",\n },\n },\n };\n};\n","/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n","import type { EslintRuleConfig, FunctionStyle } from \"../types.js\";\n\ntype ReactFunctionDefinitions =\n | \"arrow-function\"\n | \"function-declaration\"\n | \"function-expression\";\n\ntype ReactRules = Record<\n `${\"react\" | \"react-hooks\"}/${string}`,\n EslintRuleConfig\n> & {\n \"react/destructuring-assignment\"?: EslintRuleConfig<\n \"always\" | \"never\",\n {\n destructureInSignature?: \"always\" | \"ignore\";\n ignoreClassFields?: boolean;\n }\n >;\n \"react/function-component-definition\"?: EslintRuleConfig<{\n namedComponents?: ReactFunctionDefinitions | ReactFunctionDefinitions[];\n unnamedComponents?:\n | \"arrow-function\"\n | \"function-expression\"\n | (\"arrow-function\" | \"function-expression\")[];\n }>;\n};\n\n/**\n * Generates ESLint rules configuration for React and React Hooks.\n * Includes settings for function component style enforcement and TypeScript-specific rules.\n *\n * @param functionStyle - The preferred style for React function components: 'arrow' for arrow functions, 'declaration' for function declarations, 'expression' for function expressions, or 'off' to disable style enforcement\n * @param typescript - Whether TypeScript-specific React rules should be enabled\n * @returns Configuration object containing ESLint rules for React and React Hooks\n */\nexport const reactRules = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n): ReactRules => {\n const functionStyleMap: Record<FunctionStyle, ReactFunctionDefinitions> = {\n arrow: \"arrow-function\",\n declaration: \"function-declaration\",\n expression: \"function-expression\",\n };\n\n return {\n /**\n * Disabled in favor of TypeScript for type checking\n */\n ...(typescript ? {} : { \"react/prop-types\": \"warn\" }),\n \"react-hooks/exhaustive-deps\": \"warn\",\n \"react-hooks/rules-of-hooks\": \"warn\",\n /**\n * Require an explicit type when using button elements.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md\n */\n \"react/button-has-type\": \"warn\",\n \"react/destructuring-assignment\": [\"warn\", \"always\"],\n \"react/display-name\": \"warn\",\n /**\n * Require consistent function type for function components.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md\n */\n \"react/function-component-definition\":\n functionStyle === \"off\" ? \"off\" : (\n [\n \"warn\",\n {\n namedComponents: functionStyleMap[functionStyle],\n unnamedComponents:\n functionStyle === \"arrow\" ? \"arrow-function\" : (\n \"function-expression\"\n ),\n },\n ]\n ),\n /**\n * Require destructuring and symmetric naming of `useState` hook value and setter variables.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md\n */\n \"react/hook-use-state\": \"warn\",\n /**\n * Require consistent boolean attributes notation in JSX.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n */\n \"react/jsx-boolean-value\": \"warn\",\n /**\n * Disallow unnecessary curly braces in JSX props and children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n */\n \"react/jsx-curly-brace-presence\": \"warn\",\n /**\n * Require using shorthand form for React fragments, unless required.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md\n */\n \"react/jsx-fragments\": \"warn\",\n \"react/jsx-key\": \"warn\",\n \"react/jsx-no-comment-textnodes\": \"warn\",\n \"react/jsx-no-duplicate-props\": \"warn\",\n /**\n * Prevent problematic leaked values from being rendered.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md\n */\n \"react/jsx-no-leaked-render\": \"warn\",\n /**\n * Prevents usage of unsafe `target='_blank'`.\n *\n * This rule is a part of `react/recommended`, but we've modified it to\n * allow referrer.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md\n */\n \"react/jsx-no-target-blank\": [\n \"warn\",\n {\n allowReferrer: true,\n },\n ],\n \"react/jsx-no-undef\": \"warn\",\n /**\n * Disallow empty React fragments.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n */\n \"react/jsx-no-useless-fragment\": [\"warn\", { allowExpressions: true }],\n /**\n * Require the use of PascalCase for user-defined JSX components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n */\n \"react/jsx-pascal-case\": \"warn\",\n \"react/jsx-uses-react\": \"warn\",\n \"react/jsx-uses-vars\": \"warn\",\n /**\n * Disallow usage of Array index in keys.\n *\n * � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n */\n \"react/no-array-index-key\": \"warn\",\n \"react/no-children-prop\": \"warn\",\n \"react/no-danger-with-children\": \"warn\",\n \"react/no-deprecated\": \"warn\",\n \"react/no-direct-mutation-state\": \"warn\",\n \"react/no-find-dom-node\": \"warn\",\n \"react/no-is-mounted\": \"warn\",\n \"react/no-render-return-value\": \"warn\",\n \"react/no-string-refs\": \"warn\",\n \"react/no-unescaped-entities\": \"warn\",\n \"react/no-unknown-property\": \"warn\",\n \"react/no-unsafe\": \"warn\",\n /**\n * Disallow creating unstable components inside components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md\n */\n \"react/no-unstable-nested-components\": \"warn\",\n \"react/require-render-return\": \"warn\",\n /**\n * Disallow closing tags for components without children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n */\n \"react/self-closing-comp\": \"warn\",\n };\n};\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,OAAO,sBAAsB;AAC7B,OAAO,aAAa;;;ACGb,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;;;ACWO,IAAM,aAAa,CACxB,eACA,eACe;AACf,QAAM,mBAAoE;AAAA,IACxE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,YAAY;AAAA,EACd;AAEA,SAAO;AAAA;AAAA;AAAA;AAAA,IAIL,GAAI,aAAa,CAAC,IAAI,EAAE,oBAAoB,OAAO;AAAA,IACnD,+BAA+B;AAAA,IAC/B,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM9B,yBAAyB;AAAA,IACzB,kCAAkC,CAAC,QAAQ,QAAQ;AAAA,IACnD,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMtB,uCACE,kBAAkB,QAAQ,QACxB;AAAA,MACE;AAAA,MACA;AAAA,QACE,iBAAiB,iBAAiB,aAAa;AAAA,QAC/C,mBACE,kBAAkB,UAAU,mBAC1B;AAAA,MAEN;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOJ,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMxB,2BAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM3B,kCAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlC,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,kCAAkC;AAAA,IAClC,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMhC,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS9B,6BAA6B;AAAA,MAC3B;AAAA,MACA;AAAA,QACE,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMtB,iCAAiC,CAAC,QAAQ,EAAE,kBAAkB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMpE,yBAAyB;AAAA,IACzB,wBAAwB;AAAA,IACxB,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMvB,4BAA4B;AAAA,IAC5B,0BAA0B;AAAA,IAC1B,iCAAiC;AAAA,IACjC,uBAAuB;AAAA,IACvB,kCAAkC;AAAA,IAClC,0BAA0B;AAAA,IAC1B,uBAAuB;AAAA,IACvB,gCAAgC;AAAA,IAChC,wBAAwB;AAAA,IACxB,+BAA+B;AAAA,IAC/B,6BAA6B;AAAA,IAC7B,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnB,uCAAuC;AAAA,IACvC,+BAA+B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B,2BAA2B;AAAA,EAC7B;AACF;;;AFvJO,IAAM,oBAAoB,CAC/B,eACA,eACuB;AACvB,SAAO;AAAA,IACL,iBAAiB;AAAA,MACf,SAAS;AAAA,QACP,GAAG,QAAQ;AAAA,MACb;AAAA,MACA,eAAe;AAAA,QACb,cAAc;AAAA,UACZ,KAAK;AAAA,QACP;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM,YAAY;AAAA,IAClB,SAAS;AAAA,MACP;AAAA,MACA,eAAe;AAAA,IACjB;AAAA,IACA,OAAO,WAAW,eAAe,UAAU;AAAA,IAC3C,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/eslint/react/rules.ts
|
|
2
|
+
var reactRules = (functionStyle, typescript) => {
|
|
3
|
+
const functionStyleMap = {
|
|
4
|
+
arrow: "arrow-function",
|
|
5
|
+
declaration: "function-declaration",
|
|
6
|
+
expression: "function-expression"
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
/**
|
|
10
|
+
* Disabled in favor of TypeScript for type checking
|
|
11
|
+
*/
|
|
12
|
+
...typescript ? {} : { "react/prop-types": "warn" },
|
|
13
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
14
|
+
"react-hooks/rules-of-hooks": "warn",
|
|
15
|
+
/**
|
|
16
|
+
* Require an explicit type when using button elements.
|
|
17
|
+
*
|
|
18
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
|
|
19
|
+
*/
|
|
20
|
+
"react/button-has-type": "warn",
|
|
21
|
+
"react/destructuring-assignment": ["warn", "always"],
|
|
22
|
+
"react/display-name": "warn",
|
|
23
|
+
/**
|
|
24
|
+
* Require consistent function type for function components.
|
|
25
|
+
*
|
|
26
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md
|
|
27
|
+
*/
|
|
28
|
+
"react/function-component-definition": functionStyle === "off" ? "off" : [
|
|
29
|
+
"warn",
|
|
30
|
+
{
|
|
31
|
+
namedComponents: functionStyleMap[functionStyle],
|
|
32
|
+
unnamedComponents: functionStyle === "arrow" ? "arrow-function" : "function-expression"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
/**
|
|
36
|
+
* Require destructuring and symmetric naming of `useState` hook value and setter variables.
|
|
37
|
+
*
|
|
38
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
|
|
39
|
+
*/
|
|
40
|
+
"react/hook-use-state": "warn",
|
|
41
|
+
/**
|
|
42
|
+
* Require consistent boolean attributes notation in JSX.
|
|
43
|
+
*
|
|
44
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
|
|
45
|
+
*/
|
|
46
|
+
"react/jsx-boolean-value": "warn",
|
|
47
|
+
/**
|
|
48
|
+
* Disallow unnecessary curly braces in JSX props and children.
|
|
49
|
+
*
|
|
50
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
|
|
51
|
+
*/
|
|
52
|
+
"react/jsx-curly-brace-presence": "warn",
|
|
53
|
+
/**
|
|
54
|
+
* Require using shorthand form for React fragments, unless required.
|
|
55
|
+
*
|
|
56
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
|
|
57
|
+
*/
|
|
58
|
+
"react/jsx-fragments": "warn",
|
|
59
|
+
"react/jsx-key": "warn",
|
|
60
|
+
"react/jsx-no-comment-textnodes": "warn",
|
|
61
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
62
|
+
/**
|
|
63
|
+
* Prevent problematic leaked values from being rendered.
|
|
64
|
+
*
|
|
65
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
|
|
66
|
+
*/
|
|
67
|
+
"react/jsx-no-leaked-render": "warn",
|
|
68
|
+
/**
|
|
69
|
+
* Prevents usage of unsafe `target='_blank'`.
|
|
70
|
+
*
|
|
71
|
+
* This rule is a part of `react/recommended`, but we've modified it to
|
|
72
|
+
* allow referrer.
|
|
73
|
+
*
|
|
74
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
|
|
75
|
+
*/
|
|
76
|
+
"react/jsx-no-target-blank": [
|
|
77
|
+
"warn",
|
|
78
|
+
{
|
|
79
|
+
allowReferrer: true
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"react/jsx-no-undef": "warn",
|
|
83
|
+
/**
|
|
84
|
+
* Disallow empty React fragments.
|
|
85
|
+
*
|
|
86
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
|
|
87
|
+
*/
|
|
88
|
+
"react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
|
|
89
|
+
/**
|
|
90
|
+
* Require the use of PascalCase for user-defined JSX components.
|
|
91
|
+
*
|
|
92
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
|
|
93
|
+
*/
|
|
94
|
+
"react/jsx-pascal-case": "warn",
|
|
95
|
+
"react/jsx-uses-react": "warn",
|
|
96
|
+
"react/jsx-uses-vars": "warn",
|
|
97
|
+
/**
|
|
98
|
+
* Disallow usage of Array index in keys.
|
|
99
|
+
*
|
|
100
|
+
* � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
|
|
101
|
+
*/
|
|
102
|
+
"react/no-array-index-key": "warn",
|
|
103
|
+
"react/no-children-prop": "warn",
|
|
104
|
+
"react/no-danger-with-children": "warn",
|
|
105
|
+
"react/no-deprecated": "warn",
|
|
106
|
+
"react/no-direct-mutation-state": "warn",
|
|
107
|
+
"react/no-find-dom-node": "warn",
|
|
108
|
+
"react/no-is-mounted": "warn",
|
|
109
|
+
"react/no-render-return-value": "warn",
|
|
110
|
+
"react/no-string-refs": "warn",
|
|
111
|
+
"react/no-unescaped-entities": "warn",
|
|
112
|
+
"react/no-unknown-property": "warn",
|
|
113
|
+
"react/no-unsafe": "warn",
|
|
114
|
+
/**
|
|
115
|
+
* Disallow creating unstable components inside components.
|
|
116
|
+
*
|
|
117
|
+
* 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
|
|
118
|
+
*/
|
|
119
|
+
"react/no-unstable-nested-components": "warn",
|
|
120
|
+
"react/require-render-return": "warn",
|
|
121
|
+
/**
|
|
122
|
+
* Disallow closing tags for components without children.
|
|
123
|
+
*
|
|
124
|
+
* 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
|
|
125
|
+
*/
|
|
126
|
+
"react/self-closing-comp": "warn"
|
|
127
|
+
};
|
|
128
|
+
};
|
|
4
129
|
export {
|
|
5
130
|
reactRules
|
|
6
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/react/rules.ts"],"sourcesContent":["import type { EslintRuleConfig, FunctionStyle } from \"../types.js\";\n\ntype ReactFunctionDefinitions =\n | \"arrow-function\"\n | \"function-declaration\"\n | \"function-expression\";\n\ntype ReactRules = Record<\n `${\"react\" | \"react-hooks\"}/${string}`,\n EslintRuleConfig\n> & {\n \"react/destructuring-assignment\"?: EslintRuleConfig<\n \"always\" | \"never\",\n {\n destructureInSignature?: \"always\" | \"ignore\";\n ignoreClassFields?: boolean;\n }\n >;\n \"react/function-component-definition\"?: EslintRuleConfig<{\n namedComponents?: ReactFunctionDefinitions | ReactFunctionDefinitions[];\n unnamedComponents?:\n | \"arrow-function\"\n | \"function-expression\"\n | (\"arrow-function\" | \"function-expression\")[];\n }>;\n};\n\n/**\n * Generates ESLint rules configuration for React and React Hooks.\n * Includes settings for function component style enforcement and TypeScript-specific rules.\n *\n * @param functionStyle - The preferred style for React function components: 'arrow' for arrow functions, 'declaration' for function declarations, 'expression' for function expressions, or 'off' to disable style enforcement\n * @param typescript - Whether TypeScript-specific React rules should be enabled\n * @returns Configuration object containing ESLint rules for React and React Hooks\n */\nexport const reactRules = (\n functionStyle: \"off\" | FunctionStyle,\n typescript: boolean,\n): ReactRules => {\n const functionStyleMap: Record<FunctionStyle, ReactFunctionDefinitions> = {\n arrow: \"arrow-function\",\n declaration: \"function-declaration\",\n expression: \"function-expression\",\n };\n\n return {\n /**\n * Disabled in favor of TypeScript for type checking\n */\n ...(typescript ? {} : { \"react/prop-types\": \"warn\" }),\n \"react-hooks/exhaustive-deps\": \"warn\",\n \"react-hooks/rules-of-hooks\": \"warn\",\n /**\n * Require an explicit type when using button elements.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md\n */\n \"react/button-has-type\": \"warn\",\n \"react/destructuring-assignment\": [\"warn\", \"always\"],\n \"react/display-name\": \"warn\",\n /**\n * Require consistent function type for function components.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md\n */\n \"react/function-component-definition\":\n functionStyle === \"off\" ? \"off\" : (\n [\n \"warn\",\n {\n namedComponents: functionStyleMap[functionStyle],\n unnamedComponents:\n functionStyle === \"arrow\" ? \"arrow-function\" : (\n \"function-expression\"\n ),\n },\n ]\n ),\n /**\n * Require destructuring and symmetric naming of `useState` hook value and setter variables.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md\n */\n \"react/hook-use-state\": \"warn\",\n /**\n * Require consistent boolean attributes notation in JSX.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md\n */\n \"react/jsx-boolean-value\": \"warn\",\n /**\n * Disallow unnecessary curly braces in JSX props and children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md\n */\n \"react/jsx-curly-brace-presence\": \"warn\",\n /**\n * Require using shorthand form for React fragments, unless required.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md\n */\n \"react/jsx-fragments\": \"warn\",\n \"react/jsx-key\": \"warn\",\n \"react/jsx-no-comment-textnodes\": \"warn\",\n \"react/jsx-no-duplicate-props\": \"warn\",\n /**\n * Prevent problematic leaked values from being rendered.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md\n */\n \"react/jsx-no-leaked-render\": \"warn\",\n /**\n * Prevents usage of unsafe `target='_blank'`.\n *\n * This rule is a part of `react/recommended`, but we've modified it to\n * allow referrer.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md\n */\n \"react/jsx-no-target-blank\": [\n \"warn\",\n {\n allowReferrer: true,\n },\n ],\n \"react/jsx-no-undef\": \"warn\",\n /**\n * Disallow empty React fragments.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md\n */\n \"react/jsx-no-useless-fragment\": [\"warn\", { allowExpressions: true }],\n /**\n * Require the use of PascalCase for user-defined JSX components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md\n */\n \"react/jsx-pascal-case\": \"warn\",\n \"react/jsx-uses-react\": \"warn\",\n \"react/jsx-uses-vars\": \"warn\",\n /**\n * Disallow usage of Array index in keys.\n *\n * � Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md\n */\n \"react/no-array-index-key\": \"warn\",\n \"react/no-children-prop\": \"warn\",\n \"react/no-danger-with-children\": \"warn\",\n \"react/no-deprecated\": \"warn\",\n \"react/no-direct-mutation-state\": \"warn\",\n \"react/no-find-dom-node\": \"warn\",\n \"react/no-is-mounted\": \"warn\",\n \"react/no-render-return-value\": \"warn\",\n \"react/no-string-refs\": \"warn\",\n \"react/no-unescaped-entities\": \"warn\",\n \"react/no-unknown-property\": \"warn\",\n \"react/no-unsafe\": \"warn\",\n /**\n * Disallow creating unstable components inside components.\n *\n * 🚫 Not fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md\n */\n \"react/no-unstable-nested-components\": \"warn\",\n \"react/require-render-return\": \"warn\",\n /**\n * Disallow closing tags for components without children.\n *\n * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md\n */\n \"react/self-closing-comp\": \"warn\",\n };\n};\n"],"mappings":";AAmCO,IAAM,aAAa,CACxB,eACA,eACe;AACf,QAAM,mBAAoE;AAAA,IACxE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,YAAY;AAAA,EACd;AAEA,SAAO;AAAA;AAAA;AAAA;AAAA,IAIL,GAAI,aAAa,CAAC,IAAI,EAAE,oBAAoB,OAAO;AAAA,IACnD,+BAA+B;AAAA,IAC/B,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM9B,yBAAyB;AAAA,IACzB,kCAAkC,CAAC,QAAQ,QAAQ;AAAA,IACnD,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMtB,uCACE,kBAAkB,QAAQ,QACxB;AAAA,MACE;AAAA,MACA;AAAA,QACE,iBAAiB,iBAAiB,aAAa;AAAA,QAC/C,mBACE,kBAAkB,UAAU,mBAC1B;AAAA,MAEN;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOJ,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMxB,2BAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM3B,kCAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMlC,uBAAuB;AAAA,IACvB,iBAAiB;AAAA,IACjB,kCAAkC;AAAA,IAClC,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMhC,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAS9B,6BAA6B;AAAA,MAC3B;AAAA,MACA;AAAA,QACE,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMtB,iCAAiC,CAAC,QAAQ,EAAE,kBAAkB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMpE,yBAAyB;AAAA,IACzB,wBAAwB;AAAA,IACxB,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMvB,4BAA4B;AAAA,IAC5B,0BAA0B;AAAA,IAC1B,iCAAiC;AAAA,IACjC,uBAAuB;AAAA,IACvB,kCAAkC;AAAA,IAClC,0BAA0B;AAAA,IAC1B,uBAAuB;AAAA,IACvB,gCAAgC;AAAA,IAChC,wBAAwB;AAAA,IACxB,+BAA+B;AAAA,IAC/B,6BAA6B;AAAA,IAC7B,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnB,uCAAuC;AAAA,IACvC,+BAA+B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B,2BAA2B;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -1,7 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// src/eslint/react-compiler/config.ts
|
|
2
|
+
import reactCompiler from "eslint-plugin-react-compiler";
|
|
3
|
+
|
|
4
|
+
// src/eslint/constants.ts
|
|
5
|
+
var configNames = {
|
|
6
|
+
base: "base",
|
|
7
|
+
disableTypeChecked: "typescript-eslint/disable-type-checked",
|
|
8
|
+
ignores: "ignores",
|
|
9
|
+
jsdoc: "jsdoc",
|
|
10
|
+
markdown: "markdown",
|
|
11
|
+
nextjs: "nextjs",
|
|
12
|
+
perfectionist: "perfectionist",
|
|
13
|
+
preferArrowFunction: "prefer-arrow-function",
|
|
14
|
+
react: "react",
|
|
15
|
+
reactCompiler: "react-compiler",
|
|
16
|
+
reactRefresh: "react-refresh",
|
|
17
|
+
storybook: "storybook:stories",
|
|
18
|
+
storybookConfig: "storybook:config",
|
|
19
|
+
testing: "testing",
|
|
20
|
+
turbo: "turbo",
|
|
21
|
+
typescript: "tseslint",
|
|
22
|
+
typescriptTesting: "tseslint-testing",
|
|
23
|
+
unicorn: "unicorn"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/eslint/react-compiler/config.ts
|
|
27
|
+
var reactCompilerEslintConfig = {
|
|
28
|
+
name: configNames.reactCompiler,
|
|
29
|
+
plugins: {
|
|
30
|
+
"react-compiler": reactCompiler
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
"react-compiler/react-compiler": "warn"
|
|
34
|
+
}
|
|
35
|
+
};
|
|
5
36
|
export {
|
|
6
37
|
reactCompilerEslintConfig
|
|
7
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/react-compiler/config.ts","../../../src/eslint/constants.ts"],"sourcesContent":["import reactCompiler from \"eslint-plugin-react-compiler\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * Creates an ESLint configuration for React Compiler.\n *\n * @returns ESLint configuration object for React Compiler\n */\nexport const reactCompilerEslintConfig: EslintConfigObject = {\n name: configNames.reactCompiler,\n plugins: {\n \"react-compiler\": reactCompiler,\n },\n rules: {\n \"react-compiler/react-compiler\": \"warn\",\n },\n};\n","/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores\",\n jsdoc: \"jsdoc\",\n markdown: \"markdown\",\n nextjs: \"nextjs\",\n perfectionist: \"perfectionist\",\n preferArrowFunction: \"prefer-arrow-function\",\n react: \"react\",\n reactCompiler: \"react-compiler\",\n reactRefresh: \"react-refresh\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing\",\n turbo: \"turbo\",\n typescript: \"tseslint\",\n typescriptTesting: \"tseslint-testing\",\n unicorn: \"unicorn\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAAA,OAAO,mBAAmB;;;ACKnB,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,SAAS;AACX;;;ADbO,IAAM,4BAAgD;AAAA,EAC3D,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP,kBAAkB;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,IACL,iCAAiC;AAAA,EACnC;AACF;","names":[]}
|