js-style-kit 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -12
- package/dist/{chunk-HHSPUTJX.js → chunk-246GSZSY.js} +1 -1
- package/dist/chunk-246GSZSY.js.map +1 -0
- package/dist/{chunk-SKA72A2W.js → chunk-24D5VXCF.js} +3 -3
- package/dist/chunk-24D5VXCF.js.map +1 -0
- package/dist/{chunk-FKPZBDM2.js → chunk-26SVGV32.js} +2 -2
- package/dist/chunk-26SVGV32.js.map +1 -0
- package/dist/{chunk-V6X244X5.js → chunk-2F7EYOEC.js} +2 -2
- package/dist/chunk-2F7EYOEC.js.map +1 -0
- package/dist/{chunk-VPM23SRN.js → chunk-3OHUY7NC.js} +2 -1
- package/dist/chunk-3OHUY7NC.js.map +1 -0
- package/dist/{chunk-XYU7AG7R.js → chunk-ATE34YNW.js} +656 -326
- package/dist/chunk-ATE34YNW.js.map +1 -0
- package/dist/{chunk-I5KJFBUR.js → chunk-E5VWJJPO.js} +3 -3
- package/dist/chunk-E5VWJJPO.js.map +1 -0
- package/dist/{chunk-HCYPJVMS.js → chunk-FFDZIX5V.js} +2 -2
- package/dist/chunk-FFDZIX5V.js.map +1 -0
- package/dist/chunk-FKHL7GEP.js +21 -0
- package/dist/chunk-FKHL7GEP.js.map +1 -0
- package/dist/{chunk-USZK5FQ5.js → chunk-FZZIRGNP.js} +2 -2
- package/dist/{chunk-6RMH52MN.js → chunk-NBIRBRD5.js} +15 -16
- package/dist/chunk-NBIRBRD5.js.map +1 -0
- package/dist/{chunk-YPJZJ56S.js → chunk-UWPH7ZM3.js} +2 -2
- package/dist/chunk-UWPH7ZM3.js.map +1 -0
- package/dist/{chunk-GGJAIVFW.js → chunk-XCPOAYGQ.js} +29 -20
- package/dist/chunk-XCPOAYGQ.js.map +1 -0
- package/dist/{chunk-UTXH73LC.js → chunk-XLCCYRR6.js} +9 -4
- package/dist/chunk-XLCCYRR6.js.map +1 -0
- package/dist/eslint/constants.d.ts +6 -0
- package/dist/eslint/constants.js +1 -1
- package/dist/eslint/ignores.d.ts +7 -0
- package/dist/eslint/ignores.js +2 -2
- package/dist/eslint/index.d.ts +3 -1
- package/dist/eslint/index.js +12 -12
- package/dist/eslint/index.test.js +140 -14
- package/dist/eslint/index.test.js.map +1 -1
- package/dist/eslint/javascript/config.d.ts +10 -0
- package/dist/eslint/javascript/config.js +3 -3
- package/dist/eslint/javascript/rules.d.ts +10 -0
- package/dist/eslint/javascript/rules.js +1 -1
- package/dist/eslint/jsdoc/config.d.ts +8 -1
- package/dist/eslint/jsdoc/config.js +3 -3
- package/dist/eslint/jsdoc/rules.d.ts +10 -14
- package/dist/eslint/jsdoc/rules.js +1 -1
- package/dist/eslint/jsdoc/types.d.ts +52 -0
- package/dist/eslint/jsdoc/types.js +1 -0
- package/dist/eslint/jsdoc/types.js.map +1 -0
- package/dist/eslint/perfectionist/config.js +2 -2
- package/dist/eslint/react/config.d.ts +11 -0
- package/dist/eslint/react/config.js +3 -3
- package/dist/eslint/react/rules.d.ts +8 -0
- package/dist/eslint/react/rules.js +1 -1
- package/dist/eslint/react-compiler/config.d.ts +5 -0
- package/dist/eslint/react-compiler/config.js +2 -2
- package/dist/eslint/typescript/config.d.ts +6 -0
- package/dist/eslint/typescript/config.js +2 -2
- package/dist/index.js +13 -13
- package/dist/prettier/index.d.ts +1 -0
- package/dist/prettier/index.js +1 -1
- package/dist/prettier/index.test.js +80 -14
- package/dist/prettier/index.test.js.map +1 -1
- package/package.json +11 -11
- package/dist/chunk-6RMH52MN.js.map +0 -1
- package/dist/chunk-FKPZBDM2.js.map +0 -1
- package/dist/chunk-GGJAIVFW.js.map +0 -1
- package/dist/chunk-HCYPJVMS.js.map +0 -1
- package/dist/chunk-HHSPUTJX.js.map +0 -1
- package/dist/chunk-I5KJFBUR.js.map +0 -1
- package/dist/chunk-SKA72A2W.js.map +0 -1
- package/dist/chunk-UTXH73LC.js.map +0 -1
- package/dist/chunk-UUHSXW3X.js +0 -21
- package/dist/chunk-UUHSXW3X.js.map +0 -1
- package/dist/chunk-V6X244X5.js.map +0 -1
- package/dist/chunk-VPM23SRN.js.map +0 -1
- package/dist/chunk-XYU7AG7R.js.map +0 -1
- package/dist/chunk-YPJZJ56S.js.map +0 -1
- /package/dist/{chunk-USZK5FQ5.js.map → chunk-FZZIRGNP.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,33 +1,313 @@
|
|
|
1
1
|
# `js-style-kit`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A zero-configuration style guide for ESLint and Prettier that provides sensible default settings and flexible configuration options.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- ✅ All dependencies included (ESLint, Prettier, plugins) - no need to install extras
|
|
8
|
+
- ✅ TypeScript support out of the box
|
|
9
|
+
- ✅ Optional React and React Compiler support
|
|
10
|
+
- ✅ JSDoc validation with configurable requirements
|
|
11
|
+
- ✅ Automatic import, prop, and object sorting with Perfectionist
|
|
12
|
+
- ✅ Tailwind CSS support for Prettier
|
|
13
|
+
- ✅ Modern ESM-only package
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
## Requirements
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
- Node.js v20.11.0 or higher
|
|
18
|
+
- TypeScript (for TypeScript projects, not bundled)
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
## Installation
|
|
14
21
|
|
|
15
|
-
|
|
22
|
+
```bash
|
|
23
|
+
npm install js-style-kit --save-dev
|
|
24
|
+
# or
|
|
25
|
+
yarn add js-style-kit --dev
|
|
26
|
+
# or
|
|
27
|
+
pnpm add js-style-kit --save-dev
|
|
28
|
+
# or
|
|
29
|
+
bun add js-style-kit --dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## ESLint Configuration
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
Create an `eslint.config.js` file in your project root:
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
import { eslintConfig } from "js-style-kit";
|
|
40
|
+
|
|
41
|
+
export default eslintConfig();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Note:** If you're not using `"type": "module"` in your package.json, name your file `eslint.config.mjs` instead.
|
|
45
|
+
|
|
46
|
+
Setup your `package.json` commands:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"scripts": {
|
|
51
|
+
"lint": "eslint . --max-warnings 0",
|
|
52
|
+
"lint:fix": "eslint . --fix --max-warnings 0"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> **Note:** The `--max-warnings 0` option is important because all rules are set to warning by default.
|
|
58
|
+
|
|
59
|
+
### Configuration Options
|
|
60
|
+
|
|
61
|
+
The `eslintConfig()` function accepts a configuration object with the following options:
|
|
16
62
|
|
|
17
63
|
```js
|
|
18
64
|
import { eslintConfig } from "js-style-kit";
|
|
19
65
|
|
|
20
|
-
export default eslintConfig({
|
|
66
|
+
export default eslintConfig({
|
|
67
|
+
// All options shown with their default values
|
|
68
|
+
functionStyle: "arrow", // Controls function style: "arrow", "declaration", "expression", or "off"
|
|
69
|
+
ignores: [], // Additional paths to ignore (node_modules and dist already excluded)
|
|
70
|
+
jsdoc: { requireJsdoc: false }, // JSDoc configuration or false to disable
|
|
71
|
+
react: false, // Whether to include React rules
|
|
72
|
+
reactCompiler: undefined, // When react is true, controls React compiler rules
|
|
73
|
+
sorting: true, // Whether to include sorting rules from Perfectionist
|
|
74
|
+
typescript: true, // Boolean or string path to tsconfig.json
|
|
75
|
+
});
|
|
21
76
|
```
|
|
22
77
|
|
|
23
|
-
|
|
78
|
+
#### Function Style Configuration
|
|
24
79
|
|
|
25
|
-
|
|
80
|
+
Controls how functions should be written:
|
|
26
81
|
|
|
27
|
-
|
|
82
|
+
```js
|
|
83
|
+
// Enforce arrow functions (default)
|
|
84
|
+
functionStyle: "arrow";
|
|
85
|
+
|
|
86
|
+
// Enforce function declarations
|
|
87
|
+
functionStyle: "declaration";
|
|
88
|
+
|
|
89
|
+
// Enforce function expressions
|
|
90
|
+
functionStyle: "expression";
|
|
91
|
+
|
|
92
|
+
// Disable function style enforcement
|
|
93
|
+
functionStyle: "off";
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### TypeScript Configuration
|
|
97
|
+
|
|
98
|
+
TypeScript support is enabled by default. You can:
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
// Enable with automatic project detection
|
|
102
|
+
typescript: true;
|
|
103
|
+
|
|
104
|
+
// Disable TypeScript rules
|
|
105
|
+
typescript: false;
|
|
106
|
+
|
|
107
|
+
// Specify path to your tsconfig.json
|
|
108
|
+
typescript: "./tsconfig.json";
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### React Configuration
|
|
112
|
+
|
|
113
|
+
React support is disabled by default:
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
// Enable React support
|
|
117
|
+
react: true
|
|
118
|
+
|
|
119
|
+
// With React enabled, React Compiler is automatically included
|
|
120
|
+
// Disable React Compiler explicitly:
|
|
121
|
+
react: true,
|
|
122
|
+
reactCompiler: false
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### JSDoc Configuration
|
|
126
|
+
|
|
127
|
+
JSDoc validation is enabled by default, but requirement rules are off:
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
// Disable JSDoc validation completely
|
|
131
|
+
jsdoc: false;
|
|
132
|
+
|
|
133
|
+
// Enable JSDoc with requirement rules, ideal for libraries
|
|
134
|
+
jsdoc: {
|
|
135
|
+
requireJsdoc: true;
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### Perfectionist (Code Organization)
|
|
140
|
+
|
|
141
|
+
Sorting/organization rules from the Perfectionist plugin are enabled by default:
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
// Disable sorting rules
|
|
145
|
+
sorting: false;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Adding Custom ESLint Configurations
|
|
149
|
+
|
|
150
|
+
You can extend the base configuration by providing additional ESLint config objects as rest parameters:
|
|
151
|
+
|
|
152
|
+
```js
|
|
153
|
+
import { eslintConfig } from "js-style-kit";
|
|
154
|
+
|
|
155
|
+
export default eslintConfig(
|
|
156
|
+
{
|
|
157
|
+
// Base configuration options
|
|
158
|
+
typescript: "./tsconfig.json",
|
|
159
|
+
react: true,
|
|
160
|
+
},
|
|
161
|
+
// Additional custom ESLint configuration objects
|
|
162
|
+
{
|
|
163
|
+
name: "custom-globals",
|
|
164
|
+
languageOptions: {
|
|
165
|
+
globals: {
|
|
166
|
+
process: "readonly",
|
|
167
|
+
__dirname: "readonly",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "custom-rules",
|
|
173
|
+
rules: {
|
|
174
|
+
// Override or add specific rules
|
|
175
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
176
|
+
"max-len": ["warn", { code: 100 }],
|
|
177
|
+
quotes: ["error", "single"],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
// Add as many additional configs as needed
|
|
181
|
+
);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Prettier Configuration
|
|
185
|
+
|
|
186
|
+
### Basic Usage
|
|
187
|
+
|
|
188
|
+
Create a `prettier.config.js` file in your project root:
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
import { prettierConfig } from "js-style-kit";
|
|
192
|
+
|
|
193
|
+
export default prettierConfig();
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
> **Note:** If you're not using `"type": "module"` in your package.json, name your file `prettier.config.mjs` instead.
|
|
197
|
+
|
|
198
|
+
### Configuration Options
|
|
199
|
+
|
|
200
|
+
The `prettierConfig()` function accepts a configuration object with the following options:
|
|
201
|
+
|
|
202
|
+
```js
|
|
203
|
+
import { prettierConfig } from "js-style-kit";
|
|
204
|
+
|
|
205
|
+
export default prettierConfig({
|
|
206
|
+
// All options shown with their default values
|
|
207
|
+
jsonSortPlugin: true, // Enable JSON sorting plugin
|
|
208
|
+
packageJsonPlugin: true, // Enable package.json sorting plugin
|
|
209
|
+
tailwindPlugin: false, // Enable Tailwind CSS plugin (boolean, string[], or options object)
|
|
210
|
+
|
|
211
|
+
// You can also pass any standard Prettier options
|
|
212
|
+
printWidth: 80,
|
|
213
|
+
tabWidth: 2,
|
|
214
|
+
// etc.
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### Tailwind CSS Support
|
|
219
|
+
|
|
220
|
+
Tailwind CSS formatting is disabled by default. You can enable it in different ways:
|
|
221
|
+
|
|
222
|
+
```js
|
|
223
|
+
// Enable Tailwind with default utility functions (clsx, cva, cn)
|
|
224
|
+
tailwindPlugin: true
|
|
225
|
+
|
|
226
|
+
// Enable Tailwind with custom utility functions
|
|
227
|
+
tailwindPlugin: ["clsx", "cva", "cn", "myCustomFunction"]
|
|
228
|
+
|
|
229
|
+
// Enable Tailwind with custom options
|
|
230
|
+
tailwindPlugin: {
|
|
231
|
+
tailwindFunctions: ["clsx", "cva", "myCustomFunction"],
|
|
232
|
+
tailwindAttributes: ["tw"]
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### JSON Sorting
|
|
237
|
+
|
|
238
|
+
The JSON sorting plugin is enabled by default. You can disable it or configure it:
|
|
239
|
+
|
|
240
|
+
```js
|
|
241
|
+
// Disable JSON sorting
|
|
242
|
+
jsonSortPlugin: false;
|
|
243
|
+
|
|
244
|
+
// Configure JSON sorting
|
|
245
|
+
jsonSortPlugin: {
|
|
246
|
+
jsonRecursiveSort: true;
|
|
247
|
+
// other plugin options...
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
#### Standard Prettier Options
|
|
252
|
+
|
|
253
|
+
You can pass any standard Prettier options directly:
|
|
28
254
|
|
|
29
255
|
```js
|
|
30
256
|
import { prettierConfig } from "js-style-kit";
|
|
31
257
|
|
|
32
|
-
export default prettierConfig({
|
|
258
|
+
export default prettierConfig({
|
|
259
|
+
// Enable Tailwind
|
|
260
|
+
tailwindPlugin: true,
|
|
261
|
+
|
|
262
|
+
// Standard Prettier options
|
|
263
|
+
printWidth: 100,
|
|
264
|
+
tabWidth: 2,
|
|
265
|
+
useTabs: false,
|
|
266
|
+
semi: true,
|
|
267
|
+
singleQuote: false,
|
|
268
|
+
trailingComma: "all",
|
|
269
|
+
bracketSpacing: true,
|
|
270
|
+
endOfLine: "lf",
|
|
271
|
+
});
|
|
33
272
|
```
|
|
273
|
+
|
|
274
|
+
## Complete Example
|
|
275
|
+
|
|
276
|
+
Here's a complete example with both ESLint and Prettier configurations:
|
|
277
|
+
|
|
278
|
+
### eslint.config.js
|
|
279
|
+
|
|
280
|
+
```js
|
|
281
|
+
import { eslintConfig } from "js-style-kit";
|
|
282
|
+
|
|
283
|
+
export default eslintConfig(
|
|
284
|
+
{
|
|
285
|
+
typescript: "./tsconfig.json",
|
|
286
|
+
react: true,
|
|
287
|
+
jsdoc: { requireJsdoc: true },
|
|
288
|
+
functionStyle: "arrow",
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "project-specific-rules",
|
|
292
|
+
rules: {
|
|
293
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
);
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### prettier.config.js
|
|
300
|
+
|
|
301
|
+
```js
|
|
302
|
+
import { prettierConfig } from "js-style-kit";
|
|
303
|
+
|
|
304
|
+
export default prettierConfig({
|
|
305
|
+
tailwindPlugin: true,
|
|
306
|
+
printWidth: 100,
|
|
307
|
+
singleQuote: true,
|
|
308
|
+
});
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## License
|
|
312
|
+
|
|
313
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/javascript/rules.ts"],"sourcesContent":["import type { EslintRuleConfig, FunctionStyle } from \"../types.js\";\n\ntype BaseRules = Record<string, EslintRuleConfig> & {\n \"func-style\"?: EslintRuleConfig<\n \"declaration\" | \"expression\",\n {\n allowArrowFunctions?: boolean;\n overrides?: {\n namedExports?: \"declaration\" | \"expression\" | \"ignore\";\n };\n }\n >;\n};\n\n/**\n * Generates the base set of ESLint rules with configurable function style enforcement.\n *\n * @param functionStyle - Controls how functions 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 * @returns An object containing ESLint rule configurations\n */\nexport const baseEslintRules = (\n functionStyle: \"off\" | FunctionStyle,\n): BaseRules => ({\n /**\n * Require return statements in array methods callbacks.\n *\n * 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return\n */\n \"array-callback-return\": [\n \"warn\",\n { allowImplicit: true, checkForEach: true },\n ],\n /**\n * Treat `var` statements as if they were block scoped.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var\n */\n \"block-scoped-var\": \"warn\",\n /**\n * Require camel case names.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/camelcase\n */\n camelcase: [\n \"warn\",\n { allow: [\"^UNSAFE_\"], ignoreDestructuring: false, properties: \"never\" },\n ],\n /**\n * Require curly braces for multiline blocks.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/curly\n */\n curly: [\"warn\", \"multi-line\"],\n /**\n * Require default clauses in switch statements to be last (if used).\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last\n */\n \"default-case-last\": \"warn\",\n /**\n * Require triple equals (`===` and `!==`).\n *å\n * 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq\n */\n eqeqeq: \"warn\",\n \"for-direction\": \"warn\",\n /**\n * Require function expressions to have a name.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/func-names\n */\n \"func-names\": [\"warn\", \"as-needed\"],\n \"func-style\":\n functionStyle === \"off\" ? \"off\" : (\n [\n \"warn\",\n functionStyle === \"arrow\" ? \"expression\" : functionStyle,\n { allowArrowFunctions: true },\n ]\n ),\n /**\n * Require grouped accessor pairs in object literals and classes.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs\n */\n \"grouped-accessor-pairs\": \"warn\",\n /**\n * Require a capital letter for constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/new-cap\n */\n \"new-cap\": [\"warn\", { capIsNew: false }],\n /**\n * Disallow use of `alert()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-alert\n */\n \"no-alert\": \"warn\",\n \"no-async-promise-executor\": \"warn\",\n /**\n * Disallow use of bitwise operators.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-bitwise\n */\n \"no-bitwise\": \"warn\",\n /**\n * Disallow use of `caller`/`callee`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-caller\n */\n \"no-caller\": \"warn\",\n \"no-case-declarations\": \"warn\",\n \"no-compare-neg-zero\": \"warn\",\n \"no-cond-assign\": \"warn\",\n /**\n * Disallow the use of console.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-console\": [\"warn\", { allow: [\"info\", \"warn\", \"error\"] }],\n /**\n * Disallow expressions where the operation doesn't affect the value.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-console\n */\n \"no-constant-binary-expression\": \"warn\",\n \"no-constant-condition\": \"warn\",\n /**\n * Disallow returning value in constructor.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return\n */\n \"no-constructor-return\": \"warn\",\n \"no-control-regex\": \"warn\",\n \"no-debugger\": \"warn\",\n \"no-delete-var\": \"warn\",\n \"no-dupe-else-if\": \"warn\",\n \"no-duplicate-case\": \"warn\",\n /**\n * Disallow using an `else` if the `if` block contains a return.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-else-return\n */\n \"no-else-return\": \"warn\",\n \"no-empty\": \"warn\",\n \"no-empty-character-class\": \"warn\",\n \"no-empty-pattern\": \"warn\",\n \"no-empty-static-block\": \"warn\",\n /**\n * Disallow `eval()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-eval\n */\n \"no-eval\": \"warn\",\n \"no-ex-assign\": \"warn\",\n /**\n * Disallow extending native objects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native\n */\n \"no-extend-native\": \"warn\",\n /**\n * Disallow unnecessary function binding.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind\n */\n \"no-extra-bind\": \"warn\",\n \"no-extra-boolean-cast\": \"warn\",\n /**\n * Disallow unnecessary labels.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label\n */\n \"no-extra-label\": \"warn\",\n \"no-fallthrough\": \"warn\",\n \"no-global-assign\": \"warn\",\n /**\n * Make people convert types explicitly e.g. `Boolean(foo)` instead of `!!foo`.\n *\n * 🔧 Partially Fixable - https://eslint.org/docs/rules/no-implicit-coercion\n */\n \"no-implicit-coercion\": \"warn\",\n \"no-invalid-regexp\": \"warn\",\n \"no-irregular-whitespace\": \"warn\",\n /**\n * Disallow usage of `__iterator__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator\n */\n \"no-iterator\": \"warn\",\n /**\n * Disallow labels that share a name with a variable.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-label-var\n */\n \"no-label-var\": \"warn\",\n /**\n * Disallow use of labels for anything other than loops and switches.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-labels\n */\n \"no-labels\": [\"warn\"],\n /**\n * Disallow unnecessary nested blocks.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks\n */\n \"no-lone-blocks\": \"warn\",\n /**\n * Disallow if as the only statement in an else block.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-lonely-if\n */\n \"no-lonely-if\": \"warn\",\n \"no-loss-of-precision\": \"warn\",\n \"no-misleading-character-class\": \"warn\",\n /**\n * Disallow use of chained assignment expressions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign\n */\n \"no-multi-assign\": [\"warn\"],\n /**\n * Disallow nested ternary expressions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-nested-ternary\n */\n \"no-nested-ternary\": \"warn\",\n /**\n * Disallow `new` for side effects.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new\n */\n \"no-new\": \"warn\",\n /**\n * Disallow function constructors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func\n */\n \"no-new-func\": \"warn\",\n /**\n * Disallow primitive wrapper instances, such as `new String('foo')`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers\n */\n \"no-new-wrappers\": \"warn\",\n \"no-nonoctal-decimal-escape\": \"warn\",\n \"no-octal\": \"warn\",\n /**\n * Disallow use of octal escape sequences in string literals.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape\n */\n \"no-octal-escape\": \"warn\",\n /**\n * Disallow reassignment of function parameters.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign\n */\n \"no-param-reassign\": \"warn\",\n /**\n * Disallow returning values from Promise executor functions.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-promise-executor-return\n */\n \"no-promise-executor-return\": \"warn\",\n /**\n * Disallow usage of the deprecated `__proto__` property.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-proto\n */\n \"no-proto\": \"warn\",\n \"no-prototype-builtins\": \"warn\",\n \"no-regex-spaces\": \"warn\",\n /**\n * Disallow assignment in `return` statement.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign\n */\n \"no-return-assign\": \"warn\",\n /**\n * Disallow use of `javascript:` urls.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url\n */\n \"no-script-url\": \"warn\",\n \"no-self-assign\": \"warn\",\n /**\n * Disallow comparisons where both sides are exactly the same.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare\n */\n \"no-self-compare\": \"warn\",\n /**\n * Disallow use of comma operator.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences\n */\n \"no-sequences\": \"warn\",\n \"no-shadow-restricted-names\": \"warn\",\n \"no-sparse-arrays\": \"warn\",\n /**\n * Disallow template literal placeholder syntax in regular strings, as\n * these are likely errors.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-template-curly-in-string\n */\n \"no-template-curly-in-string\": \"warn\",\n /**\n * Disallow initializing variables to `undefined`.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-undef-init\n */\n \"no-undef-init\": \"warn\",\n \"no-unexpected-multiline\": \"warn\",\n /**\n * Disallow ternary operators when simpler alternatives exist.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unneeded-ternary\n */\n \"no-unneeded-ternary\": \"warn\",\n /**\n * Disallow loops with a body that allows only one iteration.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-unreachable-loop\n */\n \"no-unreachable-loop\": \"warn\",\n \"no-unsafe-finally\": \"warn\",\n \"no-unsafe-optional-chaining\": \"warn\",\n \"no-unused-labels\": \"warn\",\n \"no-unused-private-class-members\": \"warn\",\n \"no-useless-backreference\": \"warn\",\n /**\n * Disallow unnecessary `.call()` and `.apply()`.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call\n */\n \"no-useless-call\": \"warn\",\n \"no-useless-catch\": \"warn\",\n /**\n * Disallow useless computed property keys.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-computed-key\n */\n \"no-useless-computed-key\": \"warn\",\n /**\n * Disallow unnecessary concatenation of strings.\n *\n * � Not fixable - https://eslint.org/docs/rules/no-useless-concat\n */\n \"no-useless-concat\": \"warn\",\n \"no-useless-escape\": \"warn\",\n /**\n * Disallow renaming import, export, and destructured assignments to the\n * same name.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-rename\n */\n \"no-useless-rename\": \"warn\",\n /**\n * Disallow redundant return statements.\n *\n * � Fixable - https://eslint.org/docs/rules/no-useless-return\n */\n \"no-useless-return\": \"warn\",\n /**\n * Require `let` or `const` instead of `var`.\n * ts transpiles let/const to var, so no need for vars any more\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/no-var\n */\n \"no-var\": \"warn\",\n \"no-with\": \"warn\",\n /**\n * Require object literal shorthand syntax.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/object-shorthand\n */\n \"object-shorthand\": \"warn\",\n /**\n * Require default to `const` instead of `let`.\n * ts provides better types with const\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-const\n */\n \"prefer-const\": \"warn\",\n /**\n * Require using named capture groups in regular expressions.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group\n */\n \"prefer-named-capture-group\": \"warn\",\n /**\n * Disallow parseInt() in favor of binary, octal, and hexadecimal literals.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-numeric-literals\n */\n \"prefer-numeric-literals\": \"warn\",\n /**\n * Require use of an object spread over Object.assign.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-object-spread\n */\n \"prefer-object-spread\": \"warn\",\n /**\n * Disallow use of the RegExp constructor in favor of regular expression\n * literals.\n *\n * � Not fixable - https://eslint.org/docs/rules/prefer-regex-literals\n */\n \"prefer-regex-literals\": \"warn\",\n /**\n * Require using rest parameters instead of `arguments`.\n * ts provides better types with rest args over arguments\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-rest-params\n */\n \"prefer-rest-params\": \"warn\",\n /**\n * Require using spread syntax instead of `.apply()`.\n * ts transpiles spread to apply, so no need for manual apply\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-spread\n */\n \"prefer-spread\": \"warn\",\n /**\n * Require using template literals instead of string concatenation.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/prefer-template\n */\n \"prefer-template\": \"warn\",\n \"require-yield\": \"warn\",\n /**\n * Require a `Symbol` description.\n *\n * 🚫 Not fixable - https://eslint.org/docs/rules/symbol-description\n */\n \"symbol-description\": \"warn\",\n \"use-isnan\": \"warn\",\n \"valid-typeof\": \"warn\",\n /**\n * Disallow \"Yoda conditions\", ensuring the comparison.\n *\n * 🔧 Fixable - https://eslint.org/docs/rules/yoda\n */\n yoda: \"warn\",\n});\n"],"mappings":";AAwBO,IAAM,kBAAkB,CAC7B,mBACe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMf,yBAAyB;AAAA,IACvB;AAAA,IACA,EAAE,eAAe,MAAM,cAAc,KAAK;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpB,WAAW;AAAA,IACT;AAAA,IACA,EAAE,OAAO,CAAC,UAAU,GAAG,qBAAqB,OAAO,YAAY,QAAQ;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,CAAC,QAAQ,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5B,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrB,QAAQ;AAAA,EACR,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,cAAc,CAAC,QAAQ,WAAW;AAAA,EAClC,cACE,kBAAkB,QAAQ,QACxB;AAAA,IACE;AAAA,IACA,kBAAkB,UAAU,eAAe;AAAA,IAC3C,EAAE,qBAAqB,KAAK;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOJ,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1B,WAAW,CAAC,QAAQ,EAAE,UAAU,MAA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.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3OHUY7NC.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/javascript/config.ts
|
|
9
9
|
var baseEslintConfig = (functionStyle) => ({
|
|
@@ -18,4 +18,4 @@ var baseEslintConfig = (functionStyle) => ({
|
|
|
18
18
|
export {
|
|
19
19
|
baseEslintConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-24D5VXCF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/javascript/config.ts"],"sourcesContent":["import type { EslintConfigObject, FunctionStyle } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\nimport { baseEslintRules } from \"./rules.js\";\n\n/**\n * Creates a base ESLint configuration object with specified function style rules.\n *\n * @param functionStyle - Controls how functions 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 * @returns ESLint configuration object\n */\nexport const baseEslintConfig = (\n functionStyle: \"off\" | FunctionStyle,\n): EslintConfigObject => ({\n languageOptions: {\n ecmaVersion: 2022,\n },\n linterOptions: { reportUnusedDisableDirectives: true },\n name: configNames.base,\n rules: baseEslintRules(functionStyle),\n});\n"],"mappings":";;;;;;;;AAeO,IAAM,mBAAmB,CAC9B,mBACwB;AAAA,EACxB,iBAAiB;AAAA,IACf,aAAa;AAAA,EACf;AAAA,EACA,eAAe,EAAE,+BAA+B,KAAK;AAAA,EACrD,MAAM,YAAY;AAAA,EAClB,OAAO,gBAAgB,aAAa;AACtC;","names":[]}
|
|
@@ -7,7 +7,7 @@ var reactRules = (functionStyle, typescript) => {
|
|
|
7
7
|
};
|
|
8
8
|
return {
|
|
9
9
|
/**
|
|
10
|
-
* Disabled in favor of TypeScript for type checking
|
|
10
|
+
* Disabled in favor of TypeScript for type checking
|
|
11
11
|
*/
|
|
12
12
|
...typescript ? {} : { "react/prop-types": "warn" },
|
|
13
13
|
"react-hooks/exhaustive-deps": "warn",
|
|
@@ -130,4 +130,4 @@ var reactRules = (functionStyle, typescript) => {
|
|
|
130
130
|
export {
|
|
131
131
|
reactRules
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-26SVGV32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3OHUY7NC.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/react-compiler/config.ts
|
|
6
6
|
import reactCompiler from "eslint-plugin-react-compiler";
|
|
@@ -17,4 +17,4 @@ var reactCompilerEslintConfig = {
|
|
|
17
17
|
export {
|
|
18
18
|
reactCompilerEslintConfig
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-2F7EYOEC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/react-compiler/config.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\": \"error\",\n },\n};\n"],"mappings":";;;;;AAAA,OAAO,mBAAmB;AAWnB,IAAM,4BAAgD;AAAA,EAC3D,MAAM,YAAY;AAAA,EAClB,SAAS;AAAA,IACP,kBAAkB;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,IACL,iCAAiC;AAAA,EACnC;AACF;","names":[]}
|
|
@@ -4,6 +4,7 @@ var configNames = {
|
|
|
4
4
|
disableTypeChecked: "typescript-eslint/disable-type-checked",
|
|
5
5
|
ignores: "ignores-config",
|
|
6
6
|
jsdoc: "jsdoc-config",
|
|
7
|
+
markdown: "markdown-config",
|
|
7
8
|
perfectionist: "perfectionist-config",
|
|
8
9
|
react: "react-config",
|
|
9
10
|
reactCompiler: "react-compiler-config",
|
|
@@ -13,4 +14,4 @@ var configNames = {
|
|
|
13
14
|
export {
|
|
14
15
|
configNames
|
|
15
16
|
};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-3OHUY7NC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/constants.ts"],"sourcesContent":["/**\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-config\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores-config\",\n jsdoc: \"jsdoc-config\",\n markdown: \"markdown-config\",\n perfectionist: \"perfectionist-config\",\n react: \"react-config\",\n reactCompiler: \"react-compiler-config\",\n typescript: \"tseslint-config\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAKO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,OAAO;AAAA,EACP,eAAe;AAAA,EACf,YAAY;AACd;","names":[]}
|