js-style-kit 0.2.9 → 0.2.11
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/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-7ZDM3TOO.js +0 -141
- package/dist/chunk-7ZDM3TOO.js.map +0 -1
- package/dist/chunk-A6AJGHPQ.js +0 -20
- package/dist/chunk-A6AJGHPQ.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
|
@@ -1,8 +1,185 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// src/eslint/typescript/config.ts
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
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/typescript/rules.ts
|
|
27
|
+
var tseslintRules = {
|
|
28
|
+
"@typescript-eslint/adjacent-overload-signatures": "warn",
|
|
29
|
+
"@typescript-eslint/array-type": "warn",
|
|
30
|
+
"@typescript-eslint/await-thenable": "warn",
|
|
31
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
32
|
+
"warn",
|
|
33
|
+
{ minimumDescriptionLength: 10 }
|
|
34
|
+
],
|
|
35
|
+
"@typescript-eslint/ban-tslint-comment": "warn",
|
|
36
|
+
"@typescript-eslint/class-literal-property-style": "warn",
|
|
37
|
+
"@typescript-eslint/consistent-generic-constructors": "warn",
|
|
38
|
+
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
39
|
+
"@typescript-eslint/consistent-type-assertions": "warn",
|
|
40
|
+
"@typescript-eslint/consistent-type-definitions": "warn",
|
|
41
|
+
"@typescript-eslint/consistent-type-exports": [
|
|
42
|
+
"warn",
|
|
43
|
+
{ fixMixedExportsWithInlineTypeSpecifier: true }
|
|
44
|
+
],
|
|
45
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
46
|
+
"warn",
|
|
47
|
+
{
|
|
48
|
+
fixStyle: "inline-type-imports",
|
|
49
|
+
prefer: "type-imports"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"@typescript-eslint/dot-notation": "warn",
|
|
53
|
+
"@typescript-eslint/no-array-constructor": "warn",
|
|
54
|
+
"@typescript-eslint/no-array-delete": "warn",
|
|
55
|
+
"@typescript-eslint/no-base-to-string": "warn",
|
|
56
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
|
|
57
|
+
"@typescript-eslint/no-confusing-void-expression": "warn",
|
|
58
|
+
"@typescript-eslint/no-deprecated": "warn",
|
|
59
|
+
"@typescript-eslint/no-duplicate-enum-values": "warn",
|
|
60
|
+
"@typescript-eslint/no-duplicate-type-constituents": "warn",
|
|
61
|
+
"@typescript-eslint/no-dynamic-delete": "warn",
|
|
62
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
63
|
+
"@typescript-eslint/no-empty-object-type": "warn",
|
|
64
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
65
|
+
"@typescript-eslint/no-extra-non-null-assertion": "warn",
|
|
66
|
+
"@typescript-eslint/no-extraneous-class": "warn",
|
|
67
|
+
"@typescript-eslint/no-floating-promises": "warn",
|
|
68
|
+
"@typescript-eslint/no-for-in-array": "warn",
|
|
69
|
+
"@typescript-eslint/no-implied-eval": "warn",
|
|
70
|
+
"@typescript-eslint/no-import-type-side-effects": "warn",
|
|
71
|
+
"@typescript-eslint/no-inferrable-types": "warn",
|
|
72
|
+
"@typescript-eslint/no-invalid-void-type": "warn",
|
|
73
|
+
"@typescript-eslint/no-meaningless-void-operator": "warn",
|
|
74
|
+
"@typescript-eslint/no-misused-new": "warn",
|
|
75
|
+
"@typescript-eslint/no-misused-promises": "warn",
|
|
76
|
+
"@typescript-eslint/no-mixed-enums": "warn",
|
|
77
|
+
"@typescript-eslint/no-namespace": "warn",
|
|
78
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn",
|
|
79
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
|
|
80
|
+
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
81
|
+
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
|
82
|
+
"@typescript-eslint/no-require-imports": "warn",
|
|
83
|
+
"@typescript-eslint/no-this-alias": "warn",
|
|
84
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
|
|
85
|
+
"@typescript-eslint/no-unnecessary-condition": "warn",
|
|
86
|
+
"@typescript-eslint/no-unnecessary-template-expression": "warn",
|
|
87
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
|
|
88
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
|
|
89
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
90
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "warn",
|
|
91
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
|
|
92
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
|
|
93
|
+
"@typescript-eslint/no-unsafe-function-type": "warn",
|
|
94
|
+
"@typescript-eslint/no-unsafe-unary-minus": "warn",
|
|
95
|
+
"@typescript-eslint/no-unused-expressions": "warn",
|
|
96
|
+
"@typescript-eslint/no-unused-vars": [
|
|
97
|
+
"warn",
|
|
98
|
+
{
|
|
99
|
+
args: "after-used",
|
|
100
|
+
argsIgnorePattern: "^_",
|
|
101
|
+
ignoreRestSiblings: false,
|
|
102
|
+
vars: "all",
|
|
103
|
+
varsIgnorePattern: "^_"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"@typescript-eslint/no-useless-constructor": "warn",
|
|
107
|
+
"@typescript-eslint/no-wrapper-object-types": "warn",
|
|
108
|
+
// TODO: Investiate non-null vs type-cast rules
|
|
109
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "off",
|
|
110
|
+
"@typescript-eslint/only-throw-error": "warn",
|
|
111
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
112
|
+
"@typescript-eslint/prefer-find": "warn",
|
|
113
|
+
"@typescript-eslint/prefer-for-of": "warn",
|
|
114
|
+
"@typescript-eslint/prefer-function-type": "warn",
|
|
115
|
+
"@typescript-eslint/prefer-includes": "warn",
|
|
116
|
+
"@typescript-eslint/prefer-literal-enum-member": "warn",
|
|
117
|
+
"@typescript-eslint/prefer-namespace-keyword": "warn",
|
|
118
|
+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
|
|
119
|
+
"@typescript-eslint/prefer-optional-chain": "warn",
|
|
120
|
+
"@typescript-eslint/prefer-promise-reject-errors": "warn",
|
|
121
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
|
|
122
|
+
"@typescript-eslint/prefer-regexp-exec": "warn",
|
|
123
|
+
"@typescript-eslint/prefer-return-this-type": "warn",
|
|
124
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
|
|
125
|
+
"@typescript-eslint/related-getter-setter-pairs": "warn",
|
|
126
|
+
"@typescript-eslint/require-await": "warn",
|
|
127
|
+
"@typescript-eslint/restrict-plus-operands": [
|
|
128
|
+
"warn",
|
|
129
|
+
{
|
|
130
|
+
allowAny: false,
|
|
131
|
+
allowBoolean: false,
|
|
132
|
+
allowNullish: false,
|
|
133
|
+
allowNumberAndString: false,
|
|
134
|
+
allowRegExp: false
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
138
|
+
"warn",
|
|
139
|
+
{
|
|
140
|
+
allow: [{ from: "lib", name: ["Error", "URL", "URLSearchParams"] }],
|
|
141
|
+
allowAny: true,
|
|
142
|
+
allowBoolean: true,
|
|
143
|
+
allowNullish: true,
|
|
144
|
+
allowNumber: true,
|
|
145
|
+
allowRegExp: true
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"@typescript-eslint/return-await": [
|
|
149
|
+
"warn",
|
|
150
|
+
"error-handling-correctness-only"
|
|
151
|
+
],
|
|
152
|
+
"@typescript-eslint/triple-slash-reference": "warn",
|
|
153
|
+
"@typescript-eslint/unbound-method": "warn",
|
|
154
|
+
"@typescript-eslint/unified-signatures": "warn",
|
|
155
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "warn"
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/eslint/typescript/config.ts
|
|
159
|
+
var tseslintConfig = (tsconfigPath) => {
|
|
160
|
+
const userCwd = process.cwd();
|
|
161
|
+
return tseslint.config(
|
|
162
|
+
{
|
|
163
|
+
files: ["**/*.{js,cjs,mjs,ts,jsx,tsx}"],
|
|
164
|
+
languageOptions: {
|
|
165
|
+
parser: tseslint.parser,
|
|
166
|
+
parserOptions: {
|
|
167
|
+
...tsconfigPath ? { project: tsconfigPath, tsconfigRootDir: userCwd } : { projectService: true, tsconfigRootDir: import.meta.dirname }
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
name: configNames.typescript,
|
|
171
|
+
plugins: {
|
|
172
|
+
"@typescript-eslint": tseslint.plugin
|
|
173
|
+
},
|
|
174
|
+
rules: tseslintRules
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
// disable type-aware linting on JS files
|
|
178
|
+
extends: [tseslint.configs.disableTypeChecked],
|
|
179
|
+
files: ["**/*.js"]
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
};
|
|
6
183
|
export {
|
|
7
184
|
tseslintConfig
|
|
8
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/typescript/config.ts","../../../src/eslint/constants.ts","../../../src/eslint/typescript/rules.ts"],"sourcesContent":["import tseslint, { type Config } from \"typescript-eslint\";\n\nimport { configNames } from \"../constants.js\";\nimport { tseslintRules } from \"./rules.js\";\n\n/**\n * Creates a TypeScript ESLint configuration object.\n *\n * @param tsconfigPath - Path to the TypeScript configuration file\n * @returns TypeScript ESLint configuration object\n */\nexport const tseslintConfig = (tsconfigPath?: string): Config => {\n const userCwd = process.cwd();\n\n return tseslint.config(\n {\n files: [\"**/*.{js,cjs,mjs,ts,jsx,tsx}\"],\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n ...(tsconfigPath ?\n { project: tsconfigPath, tsconfigRootDir: userCwd }\n : { projectService: true, tsconfigRootDir: import.meta.dirname }),\n },\n },\n name: configNames.typescript,\n plugins: {\n \"@typescript-eslint\": tseslint.plugin,\n },\n rules: tseslintRules,\n },\n {\n // disable type-aware linting on JS files\n extends: [tseslint.configs.disableTypeChecked],\n files: [\"**/*.js\"],\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 { TypescriptRules } from \"./types.js\";\n\nexport const tseslintRules: TypescriptRules = {\n \"@typescript-eslint/adjacent-overload-signatures\": \"warn\",\n \"@typescript-eslint/array-type\": \"warn\",\n \"@typescript-eslint/await-thenable\": \"warn\",\n \"@typescript-eslint/ban-ts-comment\": [\n \"warn\",\n { minimumDescriptionLength: 10 },\n ],\n \"@typescript-eslint/ban-tslint-comment\": \"warn\",\n \"@typescript-eslint/class-literal-property-style\": \"warn\",\n \"@typescript-eslint/consistent-generic-constructors\": \"warn\",\n \"@typescript-eslint/consistent-indexed-object-style\": \"warn\",\n \"@typescript-eslint/consistent-type-assertions\": \"warn\",\n \"@typescript-eslint/consistent-type-definitions\": \"warn\",\n \"@typescript-eslint/consistent-type-exports\": [\n \"warn\",\n { fixMixedExportsWithInlineTypeSpecifier: true },\n ],\n \"@typescript-eslint/consistent-type-imports\": [\n \"warn\",\n {\n fixStyle: \"inline-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"@typescript-eslint/dot-notation\": \"warn\",\n \"@typescript-eslint/no-array-constructor\": \"warn\",\n \"@typescript-eslint/no-array-delete\": \"warn\",\n \"@typescript-eslint/no-base-to-string\": \"warn\",\n \"@typescript-eslint/no-confusing-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-confusing-void-expression\": \"warn\",\n \"@typescript-eslint/no-deprecated\": \"warn\",\n \"@typescript-eslint/no-duplicate-enum-values\": \"warn\",\n \"@typescript-eslint/no-duplicate-type-constituents\": \"warn\",\n \"@typescript-eslint/no-dynamic-delete\": \"warn\",\n \"@typescript-eslint/no-empty-function\": \"warn\",\n \"@typescript-eslint/no-empty-object-type\": \"warn\",\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n \"@typescript-eslint/no-extra-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-extraneous-class\": \"warn\",\n \"@typescript-eslint/no-floating-promises\": \"warn\",\n \"@typescript-eslint/no-for-in-array\": \"warn\",\n \"@typescript-eslint/no-implied-eval\": \"warn\",\n \"@typescript-eslint/no-import-type-side-effects\": \"warn\",\n \"@typescript-eslint/no-inferrable-types\": \"warn\",\n \"@typescript-eslint/no-invalid-void-type\": \"warn\",\n \"@typescript-eslint/no-meaningless-void-operator\": \"warn\",\n \"@typescript-eslint/no-misused-new\": \"warn\",\n \"@typescript-eslint/no-misused-promises\": \"warn\",\n \"@typescript-eslint/no-mixed-enums\": \"warn\",\n \"@typescript-eslint/no-namespace\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-optional-chain\": \"warn\",\n \"@typescript-eslint/no-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-redundant-type-constituents\": \"warn\",\n \"@typescript-eslint/no-require-imports\": \"warn\",\n \"@typescript-eslint/no-this-alias\": \"warn\",\n \"@typescript-eslint/no-unnecessary-boolean-literal-compare\": \"warn\",\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n \"@typescript-eslint/no-unnecessary-template-expression\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-constraint\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-parameters\": \"warn\",\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"warn\",\n \"@typescript-eslint/no-unsafe-enum-comparison\": \"warn\",\n \"@typescript-eslint/no-unsafe-function-type\": \"warn\",\n \"@typescript-eslint/no-unsafe-unary-minus\": \"warn\",\n \"@typescript-eslint/no-unused-expressions\": \"warn\",\n \"@typescript-eslint/no-unused-vars\": [\n \"warn\",\n {\n args: \"after-used\",\n argsIgnorePattern: \"^_\",\n ignoreRestSiblings: false,\n vars: \"all\",\n varsIgnorePattern: \"^_\",\n },\n ],\n \"@typescript-eslint/no-useless-constructor\": \"warn\",\n \"@typescript-eslint/no-wrapper-object-types\": \"warn\",\n // TODO: Investiate non-null vs type-cast rules\n \"@typescript-eslint/non-nullable-type-assertion-style\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"warn\",\n \"@typescript-eslint/prefer-as-const\": \"warn\",\n \"@typescript-eslint/prefer-find\": \"warn\",\n \"@typescript-eslint/prefer-for-of\": \"warn\",\n \"@typescript-eslint/prefer-function-type\": \"warn\",\n \"@typescript-eslint/prefer-includes\": \"warn\",\n \"@typescript-eslint/prefer-literal-enum-member\": \"warn\",\n \"@typescript-eslint/prefer-namespace-keyword\": \"warn\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/prefer-optional-chain\": \"warn\",\n \"@typescript-eslint/prefer-promise-reject-errors\": \"warn\",\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"warn\",\n \"@typescript-eslint/prefer-regexp-exec\": \"warn\",\n \"@typescript-eslint/prefer-return-this-type\": \"warn\",\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"warn\",\n \"@typescript-eslint/related-getter-setter-pairs\": \"warn\",\n \"@typescript-eslint/require-await\": \"warn\",\n \"@typescript-eslint/restrict-plus-operands\": [\n \"warn\",\n {\n allowAny: false,\n allowBoolean: false,\n allowNullish: false,\n allowNumberAndString: false,\n allowRegExp: false,\n },\n ],\n \"@typescript-eslint/restrict-template-expressions\": [\n \"warn\",\n {\n allow: [{ from: \"lib\", name: [\"Error\", \"URL\", \"URLSearchParams\"] }],\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumber: true,\n allowRegExp: true,\n },\n ],\n \"@typescript-eslint/return-await\": [\n \"warn\",\n \"error-handling-correctness-only\",\n ],\n \"@typescript-eslint/triple-slash-reference\": \"warn\",\n \"@typescript-eslint/unbound-method\": \"warn\",\n \"@typescript-eslint/unified-signatures\": \"warn\",\n \"@typescript-eslint/use-unknown-in-catch-callback-variable\": \"warn\",\n};\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,134 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/eslint/typescript/rules.ts
|
|
2
|
+
var tseslintRules = {
|
|
3
|
+
"@typescript-eslint/adjacent-overload-signatures": "warn",
|
|
4
|
+
"@typescript-eslint/array-type": "warn",
|
|
5
|
+
"@typescript-eslint/await-thenable": "warn",
|
|
6
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
7
|
+
"warn",
|
|
8
|
+
{ minimumDescriptionLength: 10 }
|
|
9
|
+
],
|
|
10
|
+
"@typescript-eslint/ban-tslint-comment": "warn",
|
|
11
|
+
"@typescript-eslint/class-literal-property-style": "warn",
|
|
12
|
+
"@typescript-eslint/consistent-generic-constructors": "warn",
|
|
13
|
+
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
14
|
+
"@typescript-eslint/consistent-type-assertions": "warn",
|
|
15
|
+
"@typescript-eslint/consistent-type-definitions": "warn",
|
|
16
|
+
"@typescript-eslint/consistent-type-exports": [
|
|
17
|
+
"warn",
|
|
18
|
+
{ fixMixedExportsWithInlineTypeSpecifier: true }
|
|
19
|
+
],
|
|
20
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
21
|
+
"warn",
|
|
22
|
+
{
|
|
23
|
+
fixStyle: "inline-type-imports",
|
|
24
|
+
prefer: "type-imports"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"@typescript-eslint/dot-notation": "warn",
|
|
28
|
+
"@typescript-eslint/no-array-constructor": "warn",
|
|
29
|
+
"@typescript-eslint/no-array-delete": "warn",
|
|
30
|
+
"@typescript-eslint/no-base-to-string": "warn",
|
|
31
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
|
|
32
|
+
"@typescript-eslint/no-confusing-void-expression": "warn",
|
|
33
|
+
"@typescript-eslint/no-deprecated": "warn",
|
|
34
|
+
"@typescript-eslint/no-duplicate-enum-values": "warn",
|
|
35
|
+
"@typescript-eslint/no-duplicate-type-constituents": "warn",
|
|
36
|
+
"@typescript-eslint/no-dynamic-delete": "warn",
|
|
37
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
38
|
+
"@typescript-eslint/no-empty-object-type": "warn",
|
|
39
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
40
|
+
"@typescript-eslint/no-extra-non-null-assertion": "warn",
|
|
41
|
+
"@typescript-eslint/no-extraneous-class": "warn",
|
|
42
|
+
"@typescript-eslint/no-floating-promises": "warn",
|
|
43
|
+
"@typescript-eslint/no-for-in-array": "warn",
|
|
44
|
+
"@typescript-eslint/no-implied-eval": "warn",
|
|
45
|
+
"@typescript-eslint/no-import-type-side-effects": "warn",
|
|
46
|
+
"@typescript-eslint/no-inferrable-types": "warn",
|
|
47
|
+
"@typescript-eslint/no-invalid-void-type": "warn",
|
|
48
|
+
"@typescript-eslint/no-meaningless-void-operator": "warn",
|
|
49
|
+
"@typescript-eslint/no-misused-new": "warn",
|
|
50
|
+
"@typescript-eslint/no-misused-promises": "warn",
|
|
51
|
+
"@typescript-eslint/no-mixed-enums": "warn",
|
|
52
|
+
"@typescript-eslint/no-namespace": "warn",
|
|
53
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn",
|
|
54
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
|
|
55
|
+
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
56
|
+
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
|
57
|
+
"@typescript-eslint/no-require-imports": "warn",
|
|
58
|
+
"@typescript-eslint/no-this-alias": "warn",
|
|
59
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
|
|
60
|
+
"@typescript-eslint/no-unnecessary-condition": "warn",
|
|
61
|
+
"@typescript-eslint/no-unnecessary-template-expression": "warn",
|
|
62
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
|
|
63
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
|
|
64
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
65
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "warn",
|
|
66
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
|
|
67
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
|
|
68
|
+
"@typescript-eslint/no-unsafe-function-type": "warn",
|
|
69
|
+
"@typescript-eslint/no-unsafe-unary-minus": "warn",
|
|
70
|
+
"@typescript-eslint/no-unused-expressions": "warn",
|
|
71
|
+
"@typescript-eslint/no-unused-vars": [
|
|
72
|
+
"warn",
|
|
73
|
+
{
|
|
74
|
+
args: "after-used",
|
|
75
|
+
argsIgnorePattern: "^_",
|
|
76
|
+
ignoreRestSiblings: false,
|
|
77
|
+
vars: "all",
|
|
78
|
+
varsIgnorePattern: "^_"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"@typescript-eslint/no-useless-constructor": "warn",
|
|
82
|
+
"@typescript-eslint/no-wrapper-object-types": "warn",
|
|
83
|
+
// TODO: Investiate non-null vs type-cast rules
|
|
84
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "off",
|
|
85
|
+
"@typescript-eslint/only-throw-error": "warn",
|
|
86
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
87
|
+
"@typescript-eslint/prefer-find": "warn",
|
|
88
|
+
"@typescript-eslint/prefer-for-of": "warn",
|
|
89
|
+
"@typescript-eslint/prefer-function-type": "warn",
|
|
90
|
+
"@typescript-eslint/prefer-includes": "warn",
|
|
91
|
+
"@typescript-eslint/prefer-literal-enum-member": "warn",
|
|
92
|
+
"@typescript-eslint/prefer-namespace-keyword": "warn",
|
|
93
|
+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
|
|
94
|
+
"@typescript-eslint/prefer-optional-chain": "warn",
|
|
95
|
+
"@typescript-eslint/prefer-promise-reject-errors": "warn",
|
|
96
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
|
|
97
|
+
"@typescript-eslint/prefer-regexp-exec": "warn",
|
|
98
|
+
"@typescript-eslint/prefer-return-this-type": "warn",
|
|
99
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
|
|
100
|
+
"@typescript-eslint/related-getter-setter-pairs": "warn",
|
|
101
|
+
"@typescript-eslint/require-await": "warn",
|
|
102
|
+
"@typescript-eslint/restrict-plus-operands": [
|
|
103
|
+
"warn",
|
|
104
|
+
{
|
|
105
|
+
allowAny: false,
|
|
106
|
+
allowBoolean: false,
|
|
107
|
+
allowNullish: false,
|
|
108
|
+
allowNumberAndString: false,
|
|
109
|
+
allowRegExp: false
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
113
|
+
"warn",
|
|
114
|
+
{
|
|
115
|
+
allow: [{ from: "lib", name: ["Error", "URL", "URLSearchParams"] }],
|
|
116
|
+
allowAny: true,
|
|
117
|
+
allowBoolean: true,
|
|
118
|
+
allowNullish: true,
|
|
119
|
+
allowNumber: true,
|
|
120
|
+
allowRegExp: true
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"@typescript-eslint/return-await": [
|
|
124
|
+
"warn",
|
|
125
|
+
"error-handling-correctness-only"
|
|
126
|
+
],
|
|
127
|
+
"@typescript-eslint/triple-slash-reference": "warn",
|
|
128
|
+
"@typescript-eslint/unbound-method": "warn",
|
|
129
|
+
"@typescript-eslint/unified-signatures": "warn",
|
|
130
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "warn"
|
|
131
|
+
};
|
|
4
132
|
export {
|
|
5
133
|
tseslintRules
|
|
6
134
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/typescript/rules.ts"],"sourcesContent":["import type { TypescriptRules } from \"./types.js\";\n\nexport const tseslintRules: TypescriptRules = {\n \"@typescript-eslint/adjacent-overload-signatures\": \"warn\",\n \"@typescript-eslint/array-type\": \"warn\",\n \"@typescript-eslint/await-thenable\": \"warn\",\n \"@typescript-eslint/ban-ts-comment\": [\n \"warn\",\n { minimumDescriptionLength: 10 },\n ],\n \"@typescript-eslint/ban-tslint-comment\": \"warn\",\n \"@typescript-eslint/class-literal-property-style\": \"warn\",\n \"@typescript-eslint/consistent-generic-constructors\": \"warn\",\n \"@typescript-eslint/consistent-indexed-object-style\": \"warn\",\n \"@typescript-eslint/consistent-type-assertions\": \"warn\",\n \"@typescript-eslint/consistent-type-definitions\": \"warn\",\n \"@typescript-eslint/consistent-type-exports\": [\n \"warn\",\n { fixMixedExportsWithInlineTypeSpecifier: true },\n ],\n \"@typescript-eslint/consistent-type-imports\": [\n \"warn\",\n {\n fixStyle: \"inline-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"@typescript-eslint/dot-notation\": \"warn\",\n \"@typescript-eslint/no-array-constructor\": \"warn\",\n \"@typescript-eslint/no-array-delete\": \"warn\",\n \"@typescript-eslint/no-base-to-string\": \"warn\",\n \"@typescript-eslint/no-confusing-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-confusing-void-expression\": \"warn\",\n \"@typescript-eslint/no-deprecated\": \"warn\",\n \"@typescript-eslint/no-duplicate-enum-values\": \"warn\",\n \"@typescript-eslint/no-duplicate-type-constituents\": \"warn\",\n \"@typescript-eslint/no-dynamic-delete\": \"warn\",\n \"@typescript-eslint/no-empty-function\": \"warn\",\n \"@typescript-eslint/no-empty-object-type\": \"warn\",\n \"@typescript-eslint/no-explicit-any\": \"warn\",\n \"@typescript-eslint/no-extra-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-extraneous-class\": \"warn\",\n \"@typescript-eslint/no-floating-promises\": \"warn\",\n \"@typescript-eslint/no-for-in-array\": \"warn\",\n \"@typescript-eslint/no-implied-eval\": \"warn\",\n \"@typescript-eslint/no-import-type-side-effects\": \"warn\",\n \"@typescript-eslint/no-inferrable-types\": \"warn\",\n \"@typescript-eslint/no-invalid-void-type\": \"warn\",\n \"@typescript-eslint/no-meaningless-void-operator\": \"warn\",\n \"@typescript-eslint/no-misused-new\": \"warn\",\n \"@typescript-eslint/no-misused-promises\": \"warn\",\n \"@typescript-eslint/no-mixed-enums\": \"warn\",\n \"@typescript-eslint/no-namespace\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/no-non-null-asserted-optional-chain\": \"warn\",\n \"@typescript-eslint/no-non-null-assertion\": \"warn\",\n \"@typescript-eslint/no-redundant-type-constituents\": \"warn\",\n \"@typescript-eslint/no-require-imports\": \"warn\",\n \"@typescript-eslint/no-this-alias\": \"warn\",\n \"@typescript-eslint/no-unnecessary-boolean-literal-compare\": \"warn\",\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\n \"@typescript-eslint/no-unnecessary-template-expression\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-arguments\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-constraint\": \"warn\",\n \"@typescript-eslint/no-unnecessary-type-parameters\": \"warn\",\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"warn\",\n \"@typescript-eslint/no-unsafe-enum-comparison\": \"warn\",\n \"@typescript-eslint/no-unsafe-function-type\": \"warn\",\n \"@typescript-eslint/no-unsafe-unary-minus\": \"warn\",\n \"@typescript-eslint/no-unused-expressions\": \"warn\",\n \"@typescript-eslint/no-unused-vars\": [\n \"warn\",\n {\n args: \"after-used\",\n argsIgnorePattern: \"^_\",\n ignoreRestSiblings: false,\n vars: \"all\",\n varsIgnorePattern: \"^_\",\n },\n ],\n \"@typescript-eslint/no-useless-constructor\": \"warn\",\n \"@typescript-eslint/no-wrapper-object-types\": \"warn\",\n // TODO: Investiate non-null vs type-cast rules\n \"@typescript-eslint/non-nullable-type-assertion-style\": \"off\",\n \"@typescript-eslint/only-throw-error\": \"warn\",\n \"@typescript-eslint/prefer-as-const\": \"warn\",\n \"@typescript-eslint/prefer-find\": \"warn\",\n \"@typescript-eslint/prefer-for-of\": \"warn\",\n \"@typescript-eslint/prefer-function-type\": \"warn\",\n \"@typescript-eslint/prefer-includes\": \"warn\",\n \"@typescript-eslint/prefer-literal-enum-member\": \"warn\",\n \"@typescript-eslint/prefer-namespace-keyword\": \"warn\",\n \"@typescript-eslint/prefer-nullish-coalescing\": \"warn\",\n \"@typescript-eslint/prefer-optional-chain\": \"warn\",\n \"@typescript-eslint/prefer-promise-reject-errors\": \"warn\",\n \"@typescript-eslint/prefer-reduce-type-parameter\": \"warn\",\n \"@typescript-eslint/prefer-regexp-exec\": \"warn\",\n \"@typescript-eslint/prefer-return-this-type\": \"warn\",\n \"@typescript-eslint/prefer-string-starts-ends-with\": \"warn\",\n \"@typescript-eslint/related-getter-setter-pairs\": \"warn\",\n \"@typescript-eslint/require-await\": \"warn\",\n \"@typescript-eslint/restrict-plus-operands\": [\n \"warn\",\n {\n allowAny: false,\n allowBoolean: false,\n allowNullish: false,\n allowNumberAndString: false,\n allowRegExp: false,\n },\n ],\n \"@typescript-eslint/restrict-template-expressions\": [\n \"warn\",\n {\n allow: [{ from: \"lib\", name: [\"Error\", \"URL\", \"URLSearchParams\"] }],\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumber: true,\n allowRegExp: true,\n },\n ],\n \"@typescript-eslint/return-await\": [\n \"warn\",\n \"error-handling-correctness-only\",\n ],\n \"@typescript-eslint/triple-slash-reference\": \"warn\",\n \"@typescript-eslint/unbound-method\": \"warn\",\n \"@typescript-eslint/unified-signatures\": \"warn\",\n \"@typescript-eslint/use-unknown-in-catch-callback-variable\": \"warn\",\n};\n"],"mappings":"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","names":[]}
|
|
@@ -1,8 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// src/eslint/unicorn/config.ts
|
|
2
|
+
import unicorn from "eslint-plugin-unicorn";
|
|
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/unicorn/rules.ts
|
|
27
|
+
var rules = {
|
|
28
|
+
/**
|
|
29
|
+
* Enforce better string content.
|
|
30
|
+
*
|
|
31
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
|
|
32
|
+
*/
|
|
33
|
+
"unicorn/better-regex": "warn",
|
|
34
|
+
/**
|
|
35
|
+
* Enforce passing a message value when creating a built-in error.
|
|
36
|
+
*
|
|
37
|
+
* 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
|
|
38
|
+
*/
|
|
39
|
+
"unicorn/error-message": "warn",
|
|
40
|
+
/**
|
|
41
|
+
* Require consistent filename case for all linted files.
|
|
42
|
+
*
|
|
43
|
+
* 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
|
44
|
+
*/
|
|
45
|
+
"unicorn/filename-case": [
|
|
46
|
+
"warn",
|
|
47
|
+
{
|
|
48
|
+
case: "kebabCase"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
/**
|
|
52
|
+
* Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.
|
|
53
|
+
*
|
|
54
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
|
|
55
|
+
*/
|
|
56
|
+
"unicorn/new-for-builtins": "warn",
|
|
57
|
+
"unicorn/no-console-spaces": "warn",
|
|
58
|
+
/**
|
|
59
|
+
* Enforce using for-loop instead of while-loop.
|
|
60
|
+
*
|
|
61
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
|
|
62
|
+
*/
|
|
63
|
+
"unicorn/no-for-loop": "warn",
|
|
64
|
+
/**
|
|
65
|
+
* Enforce the use of addEventListener and removeEventListener over on-functions.
|
|
66
|
+
*
|
|
67
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
|
|
68
|
+
*/
|
|
69
|
+
"unicorn/prefer-add-event-listener": "warn",
|
|
70
|
+
/**
|
|
71
|
+
* Require using the `node:` protocol when importing Node.js built-in modules.
|
|
72
|
+
*
|
|
73
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
74
|
+
*/
|
|
75
|
+
"unicorn/prefer-node-protocol": "warn",
|
|
76
|
+
/**
|
|
77
|
+
* Prefer String#replaceAll() over String#replace() with a global regExp.
|
|
78
|
+
*
|
|
79
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
|
|
80
|
+
*/
|
|
81
|
+
"unicorn/prefer-string-replace-all": "warn",
|
|
82
|
+
/**
|
|
83
|
+
* Enforce throwing TypeError in type checking conditions.
|
|
84
|
+
*
|
|
85
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
|
|
86
|
+
*/
|
|
87
|
+
"unicorn/prefer-type-error": "warn",
|
|
88
|
+
/**
|
|
89
|
+
* Enforce consistent brace style for case clauses.
|
|
90
|
+
*
|
|
91
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md
|
|
92
|
+
*/
|
|
93
|
+
"unicorn/switch-case-braces": ["warn", "always"],
|
|
94
|
+
/**
|
|
95
|
+
* Enforce consistent case for text encoding identifiers.
|
|
96
|
+
*
|
|
97
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
|
|
98
|
+
*/
|
|
99
|
+
"unicorn/text-encoding-identifier-case": "warn"
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// src/eslint/unicorn/config.ts
|
|
103
|
+
var unicornConfig = {
|
|
104
|
+
name: configNames.unicorn,
|
|
105
|
+
plugins: {
|
|
106
|
+
unicorn
|
|
107
|
+
},
|
|
108
|
+
rules
|
|
109
|
+
};
|
|
6
110
|
export {
|
|
7
111
|
unicornConfig
|
|
8
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/unicorn/config.ts","../../../src/eslint/constants.ts","../../../src/eslint/unicorn/rules.ts"],"sourcesContent":["import unicorn from \"eslint-plugin-unicorn\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { rules } from \"./rules.js\";\n\n/**\n * ESLint configuration for unicorn plugin.\n * This plugin provides a set of rules to enforce consistent code style and catch common errors.\n */\nexport const unicornConfig: EslintConfigObject = {\n name: configNames.unicorn,\n plugins: {\n unicorn,\n },\n rules,\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\ntype UnicornRules = Record<`unicorn/${string}`, EslintRuleConfig>;\n\nexport const rules: UnicornRules = {\n /**\n * Enforce better string content.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md\n */\n \"unicorn/better-regex\": \"warn\",\n /**\n * Enforce passing a message value when creating a built-in error.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md\n */\n \"unicorn/error-message\": \"warn\",\n /**\n * Require consistent filename case for all linted files.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md\n */\n \"unicorn/filename-case\": [\n \"warn\",\n {\n case: \"kebabCase\",\n },\n ],\n /**\n * Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md\n */\n \"unicorn/new-for-builtins\": \"warn\",\n \"unicorn/no-console-spaces\": \"warn\",\n /**\n * Enforce using for-loop instead of while-loop.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md\n */\n \"unicorn/no-for-loop\": \"warn\",\n /**\n * Enforce the use of addEventListener and removeEventListener over on-functions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md\n */\n \"unicorn/prefer-add-event-listener\": \"warn\",\n /**\n * Require using the `node:` protocol when importing Node.js built-in modules.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md\n */\n \"unicorn/prefer-node-protocol\": \"warn\",\n /**\n * Prefer String#replaceAll() over String#replace() with a global regExp.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md\n */\n \"unicorn/prefer-string-replace-all\": \"warn\",\n /**\n * Enforce throwing TypeError in type checking conditions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md\n */\n \"unicorn/prefer-type-error\": \"warn\",\n /**\n * Enforce consistent brace style for case clauses.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md\n */\n \"unicorn/switch-case-braces\": [\"warn\", \"always\"],\n /**\n * Enforce consistent case for text encoding identifiers.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md\n */\n \"unicorn/text-encoding-identifier-case\": \"warn\",\n};\n"],"mappings":";AAAA,OAAO,aAAa;;;ACKb,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;;;ACpBO,IAAM,QAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjC,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxB,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzB,yBAAyB;AAAA,IACvB;AAAA,IACA;AAAA,MACE,MAAM;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,4BAA4B;AAAA,EAC5B,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7B,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvB,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMhC,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7B,8BAA8B,CAAC,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM/C,yCAAyC;AAC3C;;;AFlEO,IAAM,gBAAoC;AAAA,EAC/C,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP;AAAA,EACF;AAAA,EACA;AACF;","names":[]}
|
|
@@ -1,6 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/eslint/unicorn/rules.ts
|
|
2
|
+
var rules = {
|
|
3
|
+
/**
|
|
4
|
+
* Enforce better string content.
|
|
5
|
+
*
|
|
6
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
|
|
7
|
+
*/
|
|
8
|
+
"unicorn/better-regex": "warn",
|
|
9
|
+
/**
|
|
10
|
+
* Enforce passing a message value when creating a built-in error.
|
|
11
|
+
*
|
|
12
|
+
* 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
|
|
13
|
+
*/
|
|
14
|
+
"unicorn/error-message": "warn",
|
|
15
|
+
/**
|
|
16
|
+
* Require consistent filename case for all linted files.
|
|
17
|
+
*
|
|
18
|
+
* 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
|
19
|
+
*/
|
|
20
|
+
"unicorn/filename-case": [
|
|
21
|
+
"warn",
|
|
22
|
+
{
|
|
23
|
+
case: "kebabCase"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
/**
|
|
27
|
+
* Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.
|
|
28
|
+
*
|
|
29
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
|
|
30
|
+
*/
|
|
31
|
+
"unicorn/new-for-builtins": "warn",
|
|
32
|
+
"unicorn/no-console-spaces": "warn",
|
|
33
|
+
/**
|
|
34
|
+
* Enforce using for-loop instead of while-loop.
|
|
35
|
+
*
|
|
36
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
|
|
37
|
+
*/
|
|
38
|
+
"unicorn/no-for-loop": "warn",
|
|
39
|
+
/**
|
|
40
|
+
* Enforce the use of addEventListener and removeEventListener over on-functions.
|
|
41
|
+
*
|
|
42
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
|
|
43
|
+
*/
|
|
44
|
+
"unicorn/prefer-add-event-listener": "warn",
|
|
45
|
+
/**
|
|
46
|
+
* Require using the `node:` protocol when importing Node.js built-in modules.
|
|
47
|
+
*
|
|
48
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
49
|
+
*/
|
|
50
|
+
"unicorn/prefer-node-protocol": "warn",
|
|
51
|
+
/**
|
|
52
|
+
* Prefer String#replaceAll() over String#replace() with a global regExp.
|
|
53
|
+
*
|
|
54
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
|
|
55
|
+
*/
|
|
56
|
+
"unicorn/prefer-string-replace-all": "warn",
|
|
57
|
+
/**
|
|
58
|
+
* Enforce throwing TypeError in type checking conditions.
|
|
59
|
+
*
|
|
60
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
|
|
61
|
+
*/
|
|
62
|
+
"unicorn/prefer-type-error": "warn",
|
|
63
|
+
/**
|
|
64
|
+
* Enforce consistent brace style for case clauses.
|
|
65
|
+
*
|
|
66
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md
|
|
67
|
+
*/
|
|
68
|
+
"unicorn/switch-case-braces": ["warn", "always"],
|
|
69
|
+
/**
|
|
70
|
+
* Enforce consistent case for text encoding identifiers.
|
|
71
|
+
*
|
|
72
|
+
* 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
|
|
73
|
+
*/
|
|
74
|
+
"unicorn/text-encoding-identifier-case": "warn"
|
|
75
|
+
};
|
|
4
76
|
export {
|
|
5
77
|
rules
|
|
6
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/eslint/unicorn/rules.ts"],"sourcesContent":["import type { EslintRuleConfig } from \"../types.js\";\n\ntype UnicornRules = Record<`unicorn/${string}`, EslintRuleConfig>;\n\nexport const rules: UnicornRules = {\n /**\n * Enforce better string content.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md\n */\n \"unicorn/better-regex\": \"warn\",\n /**\n * Enforce passing a message value when creating a built-in error.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md\n */\n \"unicorn/error-message\": \"warn\",\n /**\n * Require consistent filename case for all linted files.\n *\n * 🚫 Not fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md\n */\n \"unicorn/filename-case\": [\n \"warn\",\n {\n case: \"kebabCase\",\n },\n ],\n /**\n * Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md\n */\n \"unicorn/new-for-builtins\": \"warn\",\n \"unicorn/no-console-spaces\": \"warn\",\n /**\n * Enforce using for-loop instead of while-loop.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md\n */\n \"unicorn/no-for-loop\": \"warn\",\n /**\n * Enforce the use of addEventListener and removeEventListener over on-functions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md\n */\n \"unicorn/prefer-add-event-listener\": \"warn\",\n /**\n * Require using the `node:` protocol when importing Node.js built-in modules.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md\n */\n \"unicorn/prefer-node-protocol\": \"warn\",\n /**\n * Prefer String#replaceAll() over String#replace() with a global regExp.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md\n */\n \"unicorn/prefer-string-replace-all\": \"warn\",\n /**\n * Enforce throwing TypeError in type checking conditions.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md\n */\n \"unicorn/prefer-type-error\": \"warn\",\n /**\n * Enforce consistent brace style for case clauses.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md\n */\n \"unicorn/switch-case-braces\": [\"warn\", \"always\"],\n /**\n * Enforce consistent case for text encoding identifiers.\n *\n * 🔧 Fixable - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md\n */\n \"unicorn/text-encoding-identifier-case\": \"warn\",\n};\n"],"mappings":";AAIO,IAAM,QAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjC,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxB,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzB,yBAAyB;AAAA,IACvB;AAAA,IACA;AAAA,MACE,MAAM;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,4BAA4B;AAAA,EAC5B,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7B,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvB,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMhC,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrC,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7B,8BAA8B,CAAC,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM/C,yCAAyC;AAC3C;","names":[]}
|