@nelsonlaidev/eslint-config 2.5.1 → 3.0.1

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 CHANGED
@@ -22,10 +22,6 @@ export default defineConfig({
22
22
 
23
23
  ```ts
24
24
  type Options = {
25
- // Optional
26
- // The root directory of the TypeScript configuration
27
- // Defaults to process.cwd() if not specified
28
- tsconfigRootDir?: string
29
25
  // Optional
30
26
  // Enable React specific linting rules
31
27
  react?: boolean
@@ -33,39 +29,91 @@ type Options = {
33
29
  // Enable Next.js specific linting rules
34
30
  nextjs?: boolean
35
31
  // Optional
36
- // Specify the entry point for Tailwind CSS (also enable ESLint rules for tailwindcss)
37
- tailwindEntryPoint?: string
32
+ // Configure Tailwind CSS ESLint rules
33
+ tailwindcss?: {
34
+ // Path to the main entry point of your Tailwind CSS setup
35
+ entryPoint?: string
36
+ // Path to your tailwind.config.ts file
37
+ tailwindConfig?: string
38
+ // Path to your tsconfig.json file
39
+ tsconfig?: string
40
+ // Additional rule options...
41
+ }
38
42
  // Optional
39
- // Specify glob patterns for Vitest (also enable ESLint rules for vitest)
40
- vitestGlob?: string
43
+ // Configure JSX and accessibility linting rules
44
+ jsx?: {
45
+ // jsx-a11y plugin options
46
+ a11y?: {
47
+ // Custom component to native element mappings
48
+ // Example: { Button: 'button', Link: 'a' }
49
+ components?: Record<string, string>
50
+ // Custom attribute mappings
51
+ attributes?: {
52
+ for?: string[]
53
+ }
54
+ // Polymorphic component prop name (e.g., 'as' or 'component')
55
+ polymorphicPropName?: string
56
+ // List of allowed polymorphic component types
57
+ polymorphicAllowList?: string[]
58
+ }
59
+ }
41
60
  // Optional
42
- // Specify glob patterns for Playwright (also enable ESLint rules for playwright)
43
- playwrightGlob?: string
61
+ // Configure Vitest (also enable ESLint rules for vitest)
62
+ vitest?: {
63
+ // Specify files/globs for Vitest
64
+ files: Array<string | string[]>
65
+ }
66
+ // Optional
67
+ // Configure Playwright (also enable ESLint rules for playwright)
68
+ playwright?: {
69
+ // Specify files/globs for Playwright
70
+ files: Array<string | string[]>
71
+ // Alias globals for Playwright's test runner functions
72
+ globalAliases?: {
73
+ test?: string[]
74
+ expect?: string[]
75
+ }
76
+ // Custom messages used by Playwright plugin rules
77
+ messages?: Record<string, string | undefined>
78
+ // Rule options
79
+ expectExpect?: {
80
+ assertFunctionNames?: string[]
81
+ assertFunctionPatterns?: string[]
82
+ }
83
+ maxNestedDescribe?: {
84
+ max?: number
85
+ }
86
+ missingPlaywrightAwait?: {
87
+ customMatchers?: string[]
88
+ }
89
+ noSkippedTest?: {
90
+ allowConditional?: boolean
91
+ }
92
+ validExpect?: {
93
+ minArgs?: number
94
+ maxArgs?: number
95
+ }
96
+ validTitle?: {
97
+ ignoreSpaces?: boolean
98
+ ignoreTypeOfStepName?: boolean
99
+ ignoreTypeOfTestName?: boolean
100
+ ignoreTypeOfDescribeName?: boolean
101
+ disallowedWords?: string[]
102
+ mustNotMatch?: Partial<Record<'describe' | 'test', string>> | string
103
+ mustMatch?: Partial<Record<'describe' | 'test', string>> | string
104
+ }
105
+ validTestTags?: {
106
+ allowedTags?: (string | RegExp)[]
107
+ disallowedTags?: (string | RegExp)[]
108
+ }
109
+ }
110
+ // Optional
111
+ // Enable eslint-plugin-prettier rules
112
+ // Defaults to enabling only when Prettier is installed
113
+ // Set to true/false to override
114
+ prettier?: boolean
44
115
  // Optional
45
116
  // Specify files to ignore
46
117
  ignores?: string[]
47
- // Optional
48
- // Override specific ESLint rules for each plugin
49
- overrides?: {
50
- javascript?: Record<string, any>
51
- sonarjs?: Record<string, any>
52
- importSort?: Record<string, any>
53
- deMorgan?: Record<string, any>
54
- comments?: Record<string, any>
55
- node?: Record<string, any>
56
- imports?: Record<string, any>
57
- unicorn?: Record<string, any>
58
- jsx?: Record<string, any>
59
- typescript?: Record<string, any>
60
- regexp?: Record<string, any>
61
- vitest?: Record<string, any>
62
- playwright?: Record<string, any>
63
- react?: Record<string, any>
64
- nextjs?: Record<string, any>
65
- tailwindcss?: Record<string, any>
66
- prettier?: Record<string, any>
67
- stylistic?: Record<string, any>
68
- zod?: Record<string, any>
69
- }
70
118
  }
71
119
  ```
package/dist/index.d.mts CHANGED
@@ -1,69 +1,415 @@
1
+ import { ObjectKeyMatcher, ObjectValueMatcher, StringMatcher } from "eslint-plugin-better-tailwindcss/types";
1
2
  import { Linter } from "eslint";
2
3
 
3
- //#region src/types.d.ts
4
+ //#region src/types/jsx.d.ts
5
+ type JsxOptions = {
6
+ a11y?: JsxA11yOptions;
7
+ };
8
+ type JsxA11yOptions = {
9
+ /**
10
+ * See [official docs](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/main?tab=readme-ov-file#component-mapping) for more details.
11
+ */
12
+ components?: Record<string, string>;
13
+ /**
14
+ * See [official docs](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/main?tab=readme-ov-file#attribute-mapping) for more details.
15
+ */
16
+ attributes?: {
17
+ for?: string[];
18
+ };
19
+ /**
20
+ * See [official docs](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/main?tab=readme-ov-file#polymorphic-components) for more details.
21
+ */
22
+ polymorphicPropName?: string;
23
+ /**
24
+ * See [official docs](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/main?tab=readme-ov-file#polymorphic-components) for more details.
25
+ */
26
+ polymorphicAllowList?: string[];
27
+ };
28
+ //#endregion
29
+ //#region src/types/playwright.d.ts
30
+ type ExpectExpectOptions = {
31
+ /**
32
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md#assertfunctionnames) for more details.
33
+ *
34
+ * @default []
35
+ */
36
+ assertFunctionNames?: string[];
37
+ /**
38
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md#assertfunctionpatterns) for more details.
39
+ *
40
+ * @default []
41
+ */
42
+ assertFunctionPatterns?: string[];
43
+ };
44
+ type MaxNestedDescribeOptions = {
45
+ /**
46
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/max-nested-describe.md#max) for more details.
47
+ *
48
+ * @default 5
49
+ */
50
+ max?: number;
51
+ };
52
+ type MissingPlaywrightAwaitOptions = {
53
+ /**
54
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/missing-playwright-await.md#options) for more details.
55
+ *
56
+ * @default []
57
+ */
58
+ customMatchers?: string[];
59
+ };
60
+ type NoSkippedTestOptions = {
61
+ /**
62
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/no-skipped-test.md#allowconditional) for more details.
63
+ *
64
+ * @default false
65
+ */
66
+ allowConditional?: boolean;
67
+ };
68
+ type ValidExpectOptions = {
69
+ /**
70
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-expect.md#minargs--maxargs) for more details.
71
+ *
72
+ * @default 1
73
+ */
74
+ minArgs?: number;
75
+ /**
76
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-expect.md#minargs--maxargs) for more details.
77
+ *
78
+ * @default 2
79
+ */
80
+ maxArgs?: number;
81
+ };
82
+ type ValidTitleOptions = {
83
+ /**
84
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md#ignorespaces) for more details.
85
+ *
86
+ * @default false
87
+ */
88
+ ignoreSpaces?: boolean;
89
+ /**
90
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md#ignoretypeofstepname) for more details.
91
+ *
92
+ * @default true
93
+ */
94
+ ignoreTypeOfStepName?: boolean;
95
+ /**
96
+ * Official docs is not available for this option yet.
97
+ *
98
+ * @default false
99
+ */
100
+ ignoreTypeOfTestName?: boolean;
101
+ /**
102
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md#ignoretypeofdescribename) for more details.
103
+ *
104
+ * @default false
105
+ */
106
+ ignoreTypeOfDescribeName?: boolean;
107
+ /**
108
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md#disallowedwords) for more details.
109
+ *
110
+ * @default []
111
+ */
112
+ disallowedWords?: string[];
113
+ /**
114
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md#mustmatch--mustnotmatch) for more details.
115
+ *
116
+ * @default {}
117
+ */
118
+ mustNotMatch?: Partial<Record<'describe' | 'test', string>> | string;
119
+ /**
120
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md#mustmatch--mustnotmatch) for more details.
121
+ *
122
+ * @default {}
123
+ */
124
+ mustMatch?: Partial<Record<'describe' | 'test', string>> | string;
125
+ };
126
+ type ValidTestTagsOptions = {
127
+ /**
128
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-test-tags.md#allowedtags) for more details.
129
+ *
130
+ * @default []
131
+ */
132
+ allowedTags?: Array<string | RegExp>;
133
+ /**
134
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-test-tags.md#disallowedtags) for more details.
135
+ *
136
+ * @default []
137
+ */
138
+ disallowedTags?: Array<string | RegExp>;
139
+ };
4
140
  /**
5
- * ESLint configuration options.
141
+ * Playwright configuration options.
6
142
  */
7
- type ConfigOptions = {
143
+ type PlaywrightOptions = {
144
+ /**
145
+ * File paths or glob patterns for your Playwright test files.
146
+ */
147
+ files: Array<string | string[]>;
148
+ /**
149
+ * Alias globals for Playwright's test runner functions.
150
+ *
151
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright#aliased-playwright-globals) for more details.
152
+ */
153
+ globalAliases?: {
154
+ test?: string[];
155
+ expect?: string[];
156
+ };
157
+ /**
158
+ * Custom messages used by Playwright plugin rules.
159
+ *
160
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright#custom-messages) for more details.
161
+ */
162
+ messages?: Record<string, string | undefined>;
163
+ /**
164
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md) for more details.
165
+ */
166
+ expectExpect?: ExpectExpectOptions;
167
+ /**
168
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/max-nested-describe.md) for more details.
169
+ */
170
+ maxNestedDescribe?: MaxNestedDescribeOptions;
171
+ /**
172
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/missing-playwright-await.md) for more details.
173
+ */
174
+ missingPlaywrightAwait?: MissingPlaywrightAwaitOptions;
175
+ /**
176
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/no-skipped-test.md) for more details.
177
+ */
178
+ noSkippedTest?: NoSkippedTestOptions;
179
+ /**
180
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-expect.md) for more details.
181
+ */
182
+ validExpect?: ValidExpectOptions;
183
+ /**
184
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md) for more details.
185
+ */
186
+ validTitle?: ValidTitleOptions;
187
+ /**
188
+ * See [official docs](https://github.com/mskelton/eslint-plugin-playwright/blob/main/docs/rules/valid-test-tags.md) for more details.
189
+ */
190
+ validTestTags?: ValidTestTagsOptions;
191
+ };
192
+ //#endregion
193
+ //#region src/types/tailwindcss.d.ts
194
+ type Matchers = Array<string | [string, Array<StringMatcher | ObjectKeyMatcher | ObjectValueMatcher>]>;
195
+ type CanonicalClassesOptions = {
196
+ /**
197
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#rootfontsize) for more details.
198
+ *
199
+ * @default 16
200
+ */
201
+ rootFontSize?: number;
202
+ /**
203
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#collapse) for more details.
204
+ *
205
+ * @default true
206
+ */
207
+ collapse?: boolean;
208
+ /**
209
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md#logical) for more details.
210
+ *
211
+ * @default true
212
+ */
213
+ logical?: boolean;
214
+ };
215
+ type ConsistentClassOrderOptions = {
216
+ /**
217
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#order) for more details.
218
+ *
219
+ * @default 'official'
220
+ */
221
+ order?: 'asc' | 'desc' | 'official' | 'strict';
222
+ /**
223
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#detectComponentClasses) for more details.
224
+ *
225
+ * @default false
226
+ */
227
+ detectComponentClasses?: boolean;
228
+ /**
229
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassOrder) for more details.
230
+ *
231
+ * @default 'preserve'
232
+ */
233
+ componentClassOrder?: 'asc' | 'desc' | 'preserve';
234
+ /**
235
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#componentClassPosition) for more details.
236
+ *
237
+ * @default 'start'
238
+ */
239
+ componentClassPosition?: 'start' | 'end';
240
+ /**
241
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassOrder) for more details.
242
+ *
243
+ * @default 'preserve'
244
+ */
245
+ unknownClassOrder?: 'asc' | 'desc' | 'preserve';
246
+ /**
247
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md#unknownClassPosition) for more details.
248
+ *
249
+ * @default 'start'
250
+ */
251
+ unknownClassPosition?: 'start' | 'end';
252
+ };
253
+ type NoRestrictedClassesOptions = {
254
+ /**
255
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md#restrict) for more details.
256
+ *
257
+ * @default []
258
+ */
259
+ restrict?: string[] | Array<{
260
+ pattern: string;
261
+ message?: string;
262
+ fix?: string;
263
+ }>;
264
+ };
265
+ type NoUnknownClassesOptions = {
266
+ /**
267
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unknown-classes.md#ignore) for more details.
268
+ *
269
+ * @default []
270
+ */
271
+ ignore?: string[];
272
+ /**
273
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unknown-classes.md#detectComponentClasses) for more details.
274
+ *
275
+ * @default false
276
+ */
277
+ detectComponentClasses?: boolean;
278
+ };
279
+ type NoUnnecessaryWhitespaceOptions = {
280
+ /**
281
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md#allowMultiline) for more details.
282
+ *
283
+ * @default true
284
+ */
285
+ allowMultiline?: boolean;
286
+ };
287
+ type TailwindCSSOptions = {
288
+ /**
289
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#entrypoint) for more details.
290
+ */
291
+ entryPoint?: string;
292
+ /**
293
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tailwindconfig) for more details.
294
+ */
295
+ tailwindConfig?: string;
296
+ /**
297
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tsconfig) for more details.
298
+ */
299
+ tsconfig?: string;
300
+ /**
301
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#detectcomponentclasses) for more details.
302
+ *
303
+ * @default false
304
+ */
305
+ detectComponentClasses?: boolean;
8
306
  /**
9
- * The absolute or relative path to the root directory that contains
10
- * the `tsconfig.json`. Used to resolve TypeScript configuration.
307
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#rootfontsize) for more details.
308
+ *
309
+ * @default 16
11
310
  */
12
- tsconfigRootDir?: string;
311
+ rootFontSize?: number;
312
+ /**
313
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#messagestyle) for more details.
314
+ */
315
+ messageStyle?: 'visual' | 'compact' | 'raw';
316
+ /**
317
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#attributes) for more details.
318
+ */
319
+ attributes?: Matchers;
320
+ /**
321
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#callees) for more details.
322
+ */
323
+ callees?: Matchers;
324
+ /**
325
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#variables) for more details.
326
+ */
327
+ variables?: Matchers;
328
+ /**
329
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tags) for more details.
330
+ */
331
+ tags?: Matchers;
332
+ /**
333
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-canonical-classes.md) for more details.
334
+ */
335
+ canonicalClasses?: CanonicalClassesOptions;
336
+ /**
337
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-class-order.md) for more details.
338
+ */
339
+ consistentClassOrder?: ConsistentClassOrderOptions;
340
+ /**
341
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md) for more details.
342
+ */
343
+ noRestrictedClasses?: NoRestrictedClassesOptions;
344
+ /**
345
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unknown-classes.md) for more details.
346
+ */
347
+ noUnknownClasses?: NoUnknownClassesOptions;
348
+ /**
349
+ * See [official docs](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-unnecessary-whitespace.md) for more details.
350
+ */
351
+ noUnnecessaryWhitespace?: NoUnnecessaryWhitespaceOptions;
352
+ };
353
+ //#endregion
354
+ //#region src/types/vitest.d.ts
355
+ /**
356
+ * Vitest configuration options.
357
+ */
358
+ type VitestOptions = {
359
+ /**
360
+ * File paths or glob patterns for your Vitest test files.
361
+ */
362
+ files: Array<string | string[]>;
363
+ };
364
+ //#endregion
365
+ //#region src/types/config.d.ts
366
+ /**
367
+ * ESLint configuration options.
368
+ */
369
+ type ConfigOptions = {
13
370
  /**
14
371
  * Enable additional ESLint rules optimized for React projects.
15
372
  */
16
373
  react?: boolean;
17
374
  /**
18
375
  * Enable additional ESLint rules optimized for Next.js projects.
376
+ *
19
377
  * This option also automatically enables React rules.
20
378
  */
21
379
  nextjs?: boolean;
22
380
  /**
23
- * Path to the main entry point of your Tailwind CSS setup.
24
- * Enabling this also turns on ESLint rules related to Tailwind CSS.
381
+ * Tailwind CSS configuration options.
382
+ *
383
+ * Providing this object (with any of its options) automatically enables ESLint rules related to Tailwind CSS.
25
384
  */
26
- tailwindEntryPoint?: string;
385
+ tailwindcss?: TailwindCSSOptions;
27
386
  /**
28
- * Glob patterns for your Vitest test files.
29
- * When provided, ESLint rules for Vitest will be enabled.
387
+ * JSX configuration options.
30
388
  */
31
- vitestGlob?: string;
389
+ jsx?: JsxOptions;
32
390
  /**
33
- * Glob patterns for your Playwright test files.
34
- * When provided, ESLint rules for Playwright will be enabled.
391
+ * Vitest configuration options.
392
+ *
393
+ * Providing this object (with any of its options) automatically enables ESLint rules related to Vitest.
35
394
  */
36
- playwrightGlob?: string;
395
+ vitest?: VitestOptions;
396
+ /**
397
+ * Playwright configuration options.
398
+ *
399
+ * Providing this object (with any of its options) automatically enables ESLint rules related to Playwright.
400
+ */
401
+ playwright?: PlaywrightOptions;
402
+ /**
403
+ * Enable eslint-plugin-prettier rules.
404
+ *
405
+ * Defaults to enabling only when Prettier is installed.
406
+ * Set to true/false to override.
407
+ */
408
+ prettier?: boolean;
37
409
  /**
38
410
  * A list of file paths or glob patterns that ESLint should ignore.
39
411
  */
40
412
  ignores?: string[];
41
- /**
42
- * Override specific ESLint rules for each plugin.
43
- */
44
- overrides?: Overrides;
45
- };
46
- type RuleOverrides = Linter.Config['rules'];
47
- type Overrides = {
48
- javascript?: RuleOverrides;
49
- sonarjs?: RuleOverrides;
50
- importSort?: RuleOverrides;
51
- deMorgan?: RuleOverrides;
52
- comments?: RuleOverrides;
53
- node?: RuleOverrides;
54
- imports?: RuleOverrides;
55
- unicorn?: RuleOverrides;
56
- jsx?: RuleOverrides;
57
- typescript?: RuleOverrides;
58
- regexp?: RuleOverrides;
59
- vitest?: RuleOverrides;
60
- playwright?: RuleOverrides;
61
- react?: RuleOverrides;
62
- nextjs?: RuleOverrides;
63
- tailwindcss?: RuleOverrides;
64
- prettier?: RuleOverrides;
65
- stylistic?: RuleOverrides;
66
- zod?: RuleOverrides;
67
413
  };
68
414
  type FlatConfig = Linter.Config;
69
415
  //#endregion
@@ -78,5 +424,5 @@ declare const GLOB_JSX = "**/*.?([cm])jsx";
78
424
  declare const GLOB_TS = "**/*.?([cm])ts";
79
425
  declare const GLOB_TSX = "**/*.?([cm])tsx";
80
426
  //#endregion
81
- export { ConfigOptions, FlatConfig, GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, Overrides, RuleOverrides, defineConfig };
427
+ export { CanonicalClassesOptions, ConfigOptions, ConsistentClassOrderOptions, ExpectExpectOptions, FlatConfig, GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, JsxA11yOptions, JsxOptions, Matchers, MaxNestedDescribeOptions, MissingPlaywrightAwaitOptions, NoRestrictedClassesOptions, NoSkippedTestOptions, NoUnknownClassesOptions, NoUnnecessaryWhitespaceOptions, PlaywrightOptions, TailwindCSSOptions, ValidExpectOptions, ValidTestTagsOptions, ValidTitleOptions, VitestOptions, defineConfig };
82
428
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/base.ts","../src/globs.ts"],"mappings":";;;;;AAKA;KAAY,aAAA;;;;;EAKV,eAAA;EAcA;;;EAVA,KAAA;EA4BA;;;;EAvBA,MAAA;EA0BuB;;;;EArBvB,kBAAA;EAuBmB;;;;EAlBnB,UAAA;EAsBW;;;;EAjBX,cAAA;EAsBM;;;EAlBN,OAAA;EAsBa;;;EAlBb,SAAA,GAAY,SAAA;AAAA;AAAA,KAGF,aAAA,GAAgB,MAAA,CAAO,MAAA;AAAA,KAEvB,SAAA;EACV,UAAA,GAAa,aAAA;EACb,OAAA,GAAU,aAAA;EACV,UAAA,GAAa,aAAA;EACb,QAAA,GAAW,aAAA;EACX,QAAA,GAAW,aAAA;EACX,IAAA,GAAO,aAAA;EACP,OAAA,GAAU,aAAA;EACV,OAAA,GAAU,aAAA;EACV,GAAA,GAAM,aAAA;EACN,UAAA,GAAa,aAAA;EACb,MAAA,GAAS,aAAA;EACT,MAAA,GAAS,aAAA;EACT,UAAA,GAAa,aAAA;EACb,KAAA,GAAQ,aAAA;EACR,MAAA,GAAS,aAAA;EACT,WAAA,GAAc,aAAA;EACd,QAAA,GAAW,aAAA;EACX,SAAA,GAAY,aAAA;EACZ,GAAA,GAAM,aAAA;AAAA;AAAA,KAGI,UAAA,GAAa,MAAA,CAAO,MAAA;;;cCrCnB,YAAA,GAAgB,OAAA,GAAS,aAAA,KAAuB,WAAA,EAAa,UAAA,OAAe,UAAA;;;cChC5E,YAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/jsx.ts","../src/types/playwright.ts","../src/types/tailwindcss.ts","../src/types/vitest.ts","../src/types/config.ts","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,KAAA,EAAO,KAAA;AAAA;;;;;;KCEG,aAAA;EJLA;;;EISV,KAAA;EJLA;;;;;EIWA,MAAA;EJGoB;;;;;EIGpB,WAAA,GAAc,kBAAA;EHzBe;;;EG6B7B,GAAA,GAAM,UAAA;EHdI;;;;;EGoBV,MAAA,GAAS,aAAA;EHX8B;;;;AASzC;EGQE,UAAA,GAAa,iBAAA;;;;AHCf;;;EGME,QAAA;EHMO;AAGT;;EGLE,OAAA;AAAA;AAAA,KAGU,UAAA,GAAa,MAAA,CAAO,MAAA;;;cCxBnB,YAAA,GAAgB,OAAA,GAAS,aAAA,KAAuB,WAAA,EAAa,UAAA,OAAe,UAAA;;;cC/B5E,YAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA;AAAA,cAEA,OAAA;AAAA,cACA,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import process from "node:process";
2
1
  import { isPackageExists } from "local-pkg";
3
2
  import commentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
4
3
  import reactPlugin from "@eslint-react/eslint-plugin";
@@ -25,6 +24,7 @@ import unusedImportsPlugin from "eslint-plugin-unused-imports";
25
24
  import gitignorePlugin from "eslint-config-flat-gitignore";
26
25
  import eslint from "@eslint/js";
27
26
  import globals from "globals";
27
+ import { getDefaultAttributes, getDefaultCallees, getDefaultTags, getDefaultVariables } from "eslint-plugin-better-tailwindcss/api/defaults";
28
28
  import parser from "@typescript-eslint/parser";
29
29
 
30
30
  //#region src/configs/command.ts
@@ -35,7 +35,7 @@ const command = () => [{
35
35
 
36
36
  //#endregion
37
37
  //#region src/configs/comments.ts
38
- const comments = (overrides) => [{
38
+ const comments = () => [{
39
39
  name: "nelsonlaidev/eslint-comments/rules",
40
40
  plugins: { "@eslint-community/eslint-comments": commentsPlugin },
41
41
  rules: {
@@ -47,20 +47,16 @@ const comments = (overrides) => [{
47
47
  "eslint-disable-next-line",
48
48
  "eslint-disable",
49
49
  "eslint-enable"
50
- ] }],
51
- ...overrides
50
+ ] }]
52
51
  }
53
52
  }];
54
53
 
55
54
  //#endregion
56
55
  //#region src/configs/de-morgan.ts
57
- const deMorgan = (overrides) => [{
56
+ const deMorgan = () => [{
58
57
  name: "nelsonlaidev/de-morgan/rules",
59
58
  plugins: { "de-morgan": deMorganPlugin },
60
- rules: {
61
- ...deMorganPlugin.configs.recommended.rules,
62
- ...overrides
63
- }
59
+ rules: { ...deMorganPlugin.configs.recommended.rules }
64
60
  }];
65
61
 
66
62
  //#endregion
@@ -76,7 +72,7 @@ const ignores = (userIgnores = []) => [{
76
72
 
77
73
  //#endregion
78
74
  //#region src/configs/import-sort.ts
79
- const importSort = (overrides) => [{
75
+ const importSort = () => [{
80
76
  name: "nelsonlaidev/import-sort/rules",
81
77
  plugins: { "import-sort": importSortPlugin },
82
78
  rules: {
@@ -95,14 +91,13 @@ const importSort = (overrides) => [{
95
91
  [String.raw`^\.\.`],
96
92
  [String.raw`^\.`]
97
93
  ] }],
98
- "import-sort/exports": "error",
99
- ...overrides
94
+ "import-sort/exports": "error"
100
95
  }
101
96
  }];
102
97
 
103
98
  //#endregion
104
99
  //#region src/configs/imports.ts
105
- const imports = (overrides) => [{
100
+ const imports = () => [{
106
101
  name: "nelsonlaidev/imports/rules",
107
102
  plugins: { "import-lite": importLitePlugin },
108
103
  rules: {
@@ -110,14 +105,13 @@ const imports = (overrides) => [{
110
105
  "import-lite/newline-after-import": ["error", { count: 1 }],
111
106
  "import-lite/no-duplicates": "error",
112
107
  "import-lite/no-mutable-exports": "error",
113
- "import-lite/no-named-default": "error",
114
- ...overrides
108
+ "import-lite/no-named-default": "error"
115
109
  }
116
110
  }];
117
111
 
118
112
  //#endregion
119
113
  //#region src/configs/javascript.ts
120
- const javascript = (overrides) => [{
114
+ const javascript = () => [{
121
115
  name: "nelsonlaidev/javascript/setup",
122
116
  languageOptions: {
123
117
  ecmaVersion: 2022,
@@ -153,8 +147,7 @@ const javascript = (overrides) => [{
153
147
  varsIgnorePattern: "^_",
154
148
  args: "after-used",
155
149
  argsIgnorePattern: "^_"
156
- }],
157
- ...overrides
150
+ }]
158
151
  }
159
152
  }];
160
153
 
@@ -169,7 +162,7 @@ const GLOB_TSX = "**/*.?([cm])tsx";
169
162
 
170
163
  //#endregion
171
164
  //#region src/configs/jsx.ts
172
- const jsx = (overrides) => [{
165
+ const jsx = (options) => [{
173
166
  name: "nelsonlaidev/jsx/setup",
174
167
  files: [GLOB_JSX, GLOB_TSX],
175
168
  languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }
@@ -178,35 +171,37 @@ const jsx = (overrides) => [{
178
171
  files: [GLOB_JSX, GLOB_TSX],
179
172
  plugins: { "jsx-a11y": jsxA11yPlugin },
180
173
  rules: {
181
- ...jsxA11yPlugin.flatConfigs.strict.rules,
174
+ ...jsxA11yPlugin.flatConfigs.recommended.rules,
182
175
  "jsx-a11y/lang": "error",
183
- "jsx-a11y/no-aria-hidden-on-focusable": "error",
184
- ...overrides
176
+ "jsx-a11y/no-aria-hidden-on-focusable": "error"
185
177
  },
186
- settings: { "jsx-a11y": { components: {
187
- Button: "button",
188
- Image: "img",
189
- Input: "input",
190
- Textarea: "textarea",
191
- Link: "a"
192
- } } }
178
+ settings: { "jsx-a11y": {
179
+ ...options.a11y,
180
+ components: {
181
+ Button: "button",
182
+ Image: "img",
183
+ Input: "input",
184
+ Textarea: "textarea",
185
+ Link: "a",
186
+ ...options.a11y?.components
187
+ }
188
+ } }
193
189
  }];
194
190
 
195
191
  //#endregion
196
192
  //#region src/configs/nextjs.ts
197
- const nextjs = (overrides) => [{
193
+ const nextjs = () => [{
198
194
  name: "nelsonlaidev/nextjs/rules",
199
195
  plugins: { "@next/next": nextPlugin },
200
196
  rules: {
201
197
  ...nextPlugin.configs["core-web-vitals"].rules,
202
- "@next/next/no-html-link-for-pages": "off",
203
- ...overrides
198
+ "@next/next/no-html-link-for-pages": "off"
204
199
  }
205
200
  }];
206
201
 
207
202
  //#endregion
208
203
  //#region src/configs/node.ts
209
- const node = (overrides) => [{
204
+ const node = () => [{
210
205
  name: "nelsonlaidev/node/rules",
211
206
  plugins: { n: nodePlugin },
212
207
  rules: {
@@ -216,40 +211,120 @@ const node = (overrides) => [{
216
211
  "n/no-new-require": "error",
217
212
  "n/no-path-concat": "error",
218
213
  "n/prefer-promises/fs": "error",
219
- "n/process-exit-as-throw": "error",
220
- ...overrides
214
+ "n/process-exit-as-throw": "error"
221
215
  }
222
216
  }];
223
217
 
218
+ //#endregion
219
+ //#region src/defaults.ts
220
+ const DEFAULT_ROOT_FONT_SIZE = 16;
221
+ const CANONICAL_CLASSES_DEFAULT_OPTIONS = {
222
+ rootFontSize: DEFAULT_ROOT_FONT_SIZE,
223
+ collapse: true,
224
+ logical: true
225
+ };
226
+ const CONSISTENT_CLASS_ORDER_DEFAULT_OPTIONS = {
227
+ order: "official",
228
+ detectComponentClasses: false,
229
+ componentClassOrder: "preserve",
230
+ componentClassPosition: "start",
231
+ unknownClassOrder: "preserve",
232
+ unknownClassPosition: "start"
233
+ };
234
+ const NO_RESTRICTED_CLASSES_DEFAULT_OPTIONS = { restrict: [] };
235
+ const NO_UNKNOWN_CLASSES_DEFAULT_OPTIONS = {
236
+ ignore: [],
237
+ detectComponentClasses: false
238
+ };
239
+ const NO_UNNECESSARY_WHITESPACE_DEFAULT_OPTIONS = { allowMultiline: true };
240
+ const EXPECT_EXPECT_DEFAULT_OPTIONS = {
241
+ assertFunctionNames: [],
242
+ assertFunctionPatterns: []
243
+ };
244
+ const MAX_NESTED_DESCRIBE_DEFAULT_OPTIONS = { max: 5 };
245
+ const MISSING_PLAYWRIGHT_AWAIT_DEFAULT_OPTIONS = { customMatchers: [] };
246
+ const NO_SKIPPED_TEST_DEFAULT_OPTIONS = { allowConditional: false };
247
+ const VALID_EXPECT_DEFAULT_OPTIONS = {
248
+ minArgs: 1,
249
+ maxArgs: 2
250
+ };
251
+ const VALID_TITLE_DEFAULT_OPTIONS = {
252
+ ignoreSpaces: false,
253
+ ignoreTypeOfStepName: true,
254
+ ignoreTypeOfTestName: false,
255
+ ignoreTypeOfDescribeName: false,
256
+ disallowedWords: [],
257
+ mustNotMatch: {},
258
+ mustMatch: {}
259
+ };
260
+ const VALID_TEST_TAGS_DEFAULT_OPTIONS = {
261
+ allowedTags: [],
262
+ disallowedTags: []
263
+ };
264
+
224
265
  //#endregion
225
266
  //#region src/configs/playwright.ts
226
- const playwright = (glob, overrides) => [{
267
+ const playwright = (options) => [{
227
268
  name: "nelsonlaidev/playwright/setup",
228
269
  languageOptions: { globals: globals["shared-node-browser"] }
229
270
  }, {
230
271
  name: "nelsonlaidev/playwright/rules",
231
- files: [glob],
272
+ files: options.files,
232
273
  plugins: { playwright: playwrightPlugin },
274
+ settings: { playwright: {
275
+ globalAliases: options.globalAliases,
276
+ messages: options.messages
277
+ } },
233
278
  rules: {
234
279
  ...playwrightPlugin.configs.recommended.rules,
235
- ...overrides
280
+ "playwright/expect-expect": ["error", {
281
+ ...EXPECT_EXPECT_DEFAULT_OPTIONS,
282
+ ...options.expectExpect,
283
+ assertFunctionNames: [...options.expectExpect?.assertFunctionNames ?? []],
284
+ assertFunctionPatterns: [...options.expectExpect?.assertFunctionPatterns ?? []]
285
+ }],
286
+ "playwright/max-nested-describe": ["error", {
287
+ ...MAX_NESTED_DESCRIBE_DEFAULT_OPTIONS,
288
+ ...options.maxNestedDescribe
289
+ }],
290
+ "playwright/missing-playwright-await": ["error", {
291
+ ...MISSING_PLAYWRIGHT_AWAIT_DEFAULT_OPTIONS,
292
+ ...options.missingPlaywrightAwait,
293
+ customMatchers: [...options.missingPlaywrightAwait?.customMatchers ?? []]
294
+ }],
295
+ "playwright/no-skipped-test": ["error", {
296
+ ...NO_SKIPPED_TEST_DEFAULT_OPTIONS,
297
+ ...options.noSkippedTest
298
+ }],
299
+ "playwright/valid-expect": ["error", {
300
+ ...VALID_EXPECT_DEFAULT_OPTIONS,
301
+ ...options.validExpect
302
+ }],
303
+ "playwright/valid-title": ["error", {
304
+ ...VALID_TITLE_DEFAULT_OPTIONS,
305
+ ...options.validTitle,
306
+ disallowedWords: [...options.validTitle?.disallowedWords ?? []]
307
+ }],
308
+ "playwright/valid-test-tags": ["error", {
309
+ ...VALID_TEST_TAGS_DEFAULT_OPTIONS,
310
+ ...options.validTestTags,
311
+ allowedTags: [...options.validTestTags?.allowedTags ?? []],
312
+ disallowedTags: [...options.validTestTags?.disallowedTags ?? []]
313
+ }]
236
314
  }
237
315
  }];
238
316
 
239
317
  //#endregion
240
318
  //#region src/configs/prettier.ts
241
- const prettier = (overrides) => [{
319
+ const prettier = () => [{
242
320
  name: "nelsonlaidev/prettier/rules",
243
321
  plugins: { prettier: prettierPlugin },
244
- rules: {
245
- ...prettierPluginRecommended.rules,
246
- ...overrides
247
- }
322
+ rules: { ...prettierPluginRecommended.rules }
248
323
  }];
249
324
 
250
325
  //#endregion
251
326
  //#region src/configs/react.ts
252
- const react = (overrides) => [{
327
+ const react = () => [{
253
328
  name: "nelsonlaidev/react/rules",
254
329
  files: [GLOB_SRC],
255
330
  plugins: {
@@ -274,25 +349,21 @@ const react = (overrides) => [{
274
349
  "@eslint-react/naming-convention/use-state": "off",
275
350
  "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "off",
276
351
  "react-hooks/set-state-in-effect": "off",
277
- "react-hooks/static-components": "off",
278
- ...overrides
352
+ "react-hooks/static-components": "off"
279
353
  }
280
354
  }];
281
355
 
282
356
  //#endregion
283
357
  //#region src/configs/regexp.ts
284
- const regexp = (overrides) => [{
358
+ const regexp = () => [{
285
359
  name: "nelsonlaidev/regexp/rules",
286
360
  plugins: { regexp: regexpPlugin },
287
- rules: {
288
- ...regexpPlugin.configs.recommended.rules,
289
- ...overrides
290
- }
361
+ rules: { ...regexpPlugin.configs.recommended.rules }
291
362
  }];
292
363
 
293
364
  //#endregion
294
365
  //#region src/configs/sonarjs.ts
295
- const sonarjs = (overrides) => [{
366
+ const sonarjs = () => [{
296
367
  name: "nelsonlaidev/sonarjs/rules",
297
368
  plugins: { sonarjs: sonarjsPlugin },
298
369
  rules: {
@@ -302,50 +373,75 @@ const sonarjs = (overrides) => [{
302
373
  "sonarjs/arguments-order": "off",
303
374
  "sonarjs/pseudo-random": "off",
304
375
  "sonarjs/function-return-type": "off",
305
- "sonarjs/prefer-read-only-props": "off",
306
- ...overrides
376
+ "sonarjs/prefer-read-only-props": "off"
307
377
  }
308
378
  }];
309
379
 
310
380
  //#endregion
311
381
  //#region src/configs/stylistic.ts
312
- const stylistic = (overrides) => [{
382
+ const stylistic = () => [{
313
383
  name: "nelsonlaidev/stylistic/rules",
314
384
  plugins: { "@stylistic": stylisticPlugin },
315
- rules: {
316
- "@stylistic/multiline-comment-style": ["error", "separate-lines"],
317
- ...overrides
318
- }
385
+ rules: { "@stylistic/multiline-comment-style": ["error", "separate-lines"] }
319
386
  }];
320
387
 
321
388
  //#endregion
322
389
  //#region src/configs/tailwindcss.ts
323
- const tailwindcss = (entryPoint, overrides) => [{
324
- name: "nelsonlaidev/tailwindcss/rules",
325
- plugins: { "better-tailwindcss": tailwindcssPlugin },
326
- rules: {
327
- "better-tailwindcss/enforce-consistent-class-order": "error",
328
- "better-tailwindcss/enforce-canonical-classes": "error",
329
- "better-tailwindcss/no-conflicting-classes": "error",
330
- "better-tailwindcss/no-deprecated-classes": "error",
331
- "better-tailwindcss/no-duplicate-classes": "error",
332
- "better-tailwindcss/no-unnecessary-whitespace": "error",
333
- "better-tailwindcss/no-unknown-classes": "error",
334
- ...overrides
335
- },
336
- settings: { "better-tailwindcss": { entryPoint } }
337
- }];
390
+ const tailwindcss = (options) => {
391
+ const shouldEnableShorthandRule = !options.canonicalClasses || options.canonicalClasses.logical === false;
392
+ return [{
393
+ name: "nelsonlaidev/tailwindcss/rules",
394
+ plugins: { "better-tailwindcss": tailwindcssPlugin },
395
+ rules: {
396
+ "better-tailwindcss/enforce-canonical-classes": ["error", {
397
+ ...CANONICAL_CLASSES_DEFAULT_OPTIONS,
398
+ ...options.canonicalClasses
399
+ }],
400
+ "better-tailwindcss/enforce-consistent-important-position": "off",
401
+ "better-tailwindcss/enforce-consistent-variable-syntax": "off",
402
+ "better-tailwindcss/enforce-shorthand-classes": shouldEnableShorthandRule ? "error" : "off",
403
+ "better-tailwindcss/enforce-consistent-class-order": ["error", {
404
+ ...CONSISTENT_CLASS_ORDER_DEFAULT_OPTIONS,
405
+ ...options.consistentClassOrder
406
+ }],
407
+ "better-tailwindcss/no-conflicting-classes": "error",
408
+ "better-tailwindcss/no-deprecated-classes": "error",
409
+ "better-tailwindcss/no-duplicate-classes": "error",
410
+ "better-tailwindcss/no-restricted-classes": ["error", {
411
+ ...NO_RESTRICTED_CLASSES_DEFAULT_OPTIONS,
412
+ ...options.noRestrictedClasses,
413
+ restrict: [...options.noRestrictedClasses?.restrict ?? []]
414
+ }],
415
+ "better-tailwindcss/no-unknown-classes": ["error", {
416
+ ...NO_UNKNOWN_CLASSES_DEFAULT_OPTIONS,
417
+ ...options.noUnknownClasses,
418
+ ignore: [...options.noUnknownClasses?.ignore ?? []]
419
+ }],
420
+ "better-tailwindcss/no-unnecessary-whitespace": ["error", {
421
+ ...NO_UNNECESSARY_WHITESPACE_DEFAULT_OPTIONS,
422
+ ...options.noUnnecessaryWhitespace
423
+ }]
424
+ },
425
+ settings: { "better-tailwindcss": {
426
+ ...options,
427
+ rootFontSize: options.rootFontSize ?? DEFAULT_ROOT_FONT_SIZE,
428
+ attributes: [...getDefaultAttributes(), ...options.attributes ?? []],
429
+ callees: [...getDefaultCallees(), ...options.callees ?? []],
430
+ variables: [...getDefaultVariables(), ...options.variables ?? []],
431
+ tags: [...getDefaultTags(), ...options.tags ?? []]
432
+ } }
433
+ }];
434
+ };
338
435
 
339
436
  //#endregion
340
437
  //#region src/configs/typescript.ts
341
- const typescript = (tsconfigRootDir, overrides) => [{
438
+ const typescript = () => [{
342
439
  name: "nelsonlaidev/typescript/setup",
343
- files: [GLOB_TS, GLOB_TSX],
344
440
  languageOptions: {
345
441
  parser,
346
442
  parserOptions: {
347
443
  projectService: true,
348
- tsconfigRootDir
444
+ tsconfigRootDir: process.cwd()
349
445
  },
350
446
  sourceType: "module"
351
447
  },
@@ -378,14 +474,13 @@ const typescript = (tsconfigRootDir, overrides) => [{
378
474
  "@typescript-eslint/no-unsafe-member-access": "off",
379
475
  "@typescript-eslint/no-unsafe-assignment": "off",
380
476
  "@typescript-eslint/no-non-null-assertion": "off",
381
- "@typescript-eslint/consistent-type-definitions": "off",
382
- ...overrides
477
+ "@typescript-eslint/consistent-type-definitions": "off"
383
478
  }
384
479
  }];
385
480
 
386
481
  //#endregion
387
482
  //#region src/configs/unicorn.ts
388
- const unicorn = (overrides) => [{
483
+ const unicorn = () => [{
389
484
  name: "nelsonlaidev/unicorn/rules",
390
485
  plugins: { unicorn: unicornPlugin },
391
486
  rules: {
@@ -393,67 +488,61 @@ const unicorn = (overrides) => [{
393
488
  "unicorn/prevent-abbreviations": "off",
394
489
  "unicorn/no-null": "off",
395
490
  "unicorn/no-document-cookie": "off",
396
- "unicorn/prefer-string-raw": "off",
397
- ...overrides
491
+ "unicorn/prefer-string-raw": "off"
398
492
  }
399
493
  }];
400
494
 
401
495
  //#endregion
402
496
  //#region src/configs/vitest.ts
403
- const vitest = (glob, overrides) => [{
497
+ const vitest = (options) => [{
404
498
  name: "nelsonlaidev/vitest/rules",
405
- files: [glob],
499
+ files: options.files,
406
500
  plugins: { vitest: vitestPlugin },
407
- rules: {
408
- ...vitestPlugin.configs.recommended.rules,
409
- ...overrides
410
- }
501
+ rules: { ...vitestPlugin.configs.recommended.rules }
411
502
  }];
412
503
 
413
504
  //#endregion
414
505
  //#region src/configs/zod.ts
415
- const zod = (overrides) => [{
506
+ const zod = () => [{
416
507
  name: "nelsonlaidev/zod/rules",
417
508
  plugins: { "import-zod": importZodPlugin },
418
- rules: {
419
- "import-zod/prefer-zod-namespace": "error",
420
- ...overrides
421
- }
509
+ rules: { "import-zod/prefer-zod-namespace": "error" }
422
510
  }];
423
511
 
424
512
  //#endregion
425
513
  //#region src/base.ts
426
514
  const isReactInstalled = isPackageExists("react");
427
515
  const isNextjsInstalled = isPackageExists("next");
516
+ const isPrettierInstalled = isPackageExists("prettier");
428
517
  const defineConfig = (options = {}, ...userConfigs) => {
429
- const { overrides = {} } = options;
430
518
  const configs = [
431
519
  ...gitignore(),
432
520
  ...ignores(options.ignores),
433
- ...javascript(overrides.javascript),
434
- ...sonarjs(overrides.sonarjs),
435
- ...importSort(overrides.importSort),
436
- ...deMorgan(overrides.deMorgan),
437
- ...comments(overrides.comments),
438
- ...node(overrides.node),
439
- ...imports(overrides.imports),
521
+ ...javascript(),
522
+ ...sonarjs(),
523
+ ...importSort(),
524
+ ...deMorgan(),
525
+ ...comments(),
526
+ ...node(),
527
+ ...imports(),
440
528
  ...command(),
441
- ...unicorn(overrides.unicorn),
442
- ...jsx(overrides.jsx),
443
- ...typescript(options.tsconfigRootDir ?? process.cwd(), overrides.typescript),
444
- ...regexp(overrides.regexp),
445
- ...stylistic(overrides.stylistic),
446
- ...zod(overrides.zod)
529
+ ...unicorn(),
530
+ ...jsx(options.jsx ?? {}),
531
+ ...typescript(),
532
+ ...regexp(),
533
+ ...stylistic(),
534
+ ...zod()
447
535
  ];
448
536
  const isNextjsEnabled = options.nextjs ?? isNextjsInstalled;
449
537
  const isReactEnabled = (options.react ?? isReactInstalled) || isNextjsEnabled;
450
- if (options.vitestGlob) configs.push(...vitest(options.vitestGlob, overrides.vitest));
451
- if (options.playwrightGlob) configs.push(...playwright(options.playwrightGlob, overrides.playwright));
452
- if (isReactEnabled) configs.push(...react(overrides.react));
453
- if (isNextjsEnabled) configs.push(...nextjs(overrides.nextjs));
454
- if (options.tailwindEntryPoint) configs.push(...tailwindcss(options.tailwindEntryPoint, overrides.tailwindcss));
538
+ const isPrettierEnabled = options.prettier ?? isPrettierInstalled;
539
+ if (options.vitest) configs.push(...vitest(options.vitest));
540
+ if (options.playwright) configs.push(...playwright(options.playwright));
541
+ if (isReactEnabled) configs.push(...react());
542
+ if (isNextjsEnabled) configs.push(...nextjs());
543
+ if (options.tailwindcss) configs.push(...tailwindcss(options.tailwindcss));
455
544
  configs.push(...userConfigs);
456
- configs.push(...prettier(overrides.prettier));
545
+ if (isPrettierEnabled) configs.push(...prettier());
457
546
  return configs;
458
547
  };
459
548
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/configs/command.ts","../src/configs/comments.ts","../src/configs/de-morgan.ts","../src/configs/gitignore.ts","../src/configs/ignores.ts","../src/configs/import-sort.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/globs.ts","../src/configs/jsx.ts","../src/configs/nextjs.ts","../src/configs/node.ts","../src/configs/playwright.ts","../src/configs/prettier.ts","../src/configs/react.ts","../src/configs/regexp.ts","../src/configs/sonarjs.ts","../src/configs/stylistic.ts","../src/configs/tailwindcss.ts","../src/configs/typescript.ts","../src/configs/unicorn.ts","../src/configs/vitest.ts","../src/configs/zod.ts","../src/base.ts"],"sourcesContent":["import type { FlatConfig } from '../types'\n\nimport { commandPlugin } from '../plugins'\n\nexport const command = (): FlatConfig[] => [\n {\n ...commandPlugin(),\n name: 'nelsonlaidev/command/rules'\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { commentsPlugin } from '../plugins'\n\nexport const comments = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/eslint-comments/rules',\n plugins: {\n '@eslint-community/eslint-comments': commentsPlugin\n },\n rules: {\n ...commentsPlugin.configs.recommended.rules,\n\n '@eslint-community/eslint-comments/require-description': 'error',\n '@eslint-community/eslint-comments/no-unused-disable': 'error',\n '@eslint-community/eslint-comments/no-restricted-disable': 'error',\n '@eslint-community/eslint-comments/no-use': [\n 'error',\n { allow: ['eslint-disable-next-line', 'eslint-disable', 'eslint-enable'] }\n ],\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { deMorganPlugin } from '../plugins'\n\nexport const deMorgan = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/de-morgan/rules',\n plugins: {\n 'de-morgan': deMorganPlugin\n },\n rules: {\n ...deMorganPlugin.configs.recommended.rules,\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport gitignorePlugin from 'eslint-config-flat-gitignore'\n\nexport const gitignore = (): FlatConfig[] => [\n gitignorePlugin({\n name: 'nelsonlaidev/gitignore'\n })\n]\n","import type { FlatConfig } from '../types'\n\nexport const ignores = (userIgnores: string[] = []): FlatConfig[] => [\n {\n name: 'nelsonlaidev/ignores',\n ignores: ['**/routeTree.gen.ts', ...userIgnores]\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { importSortPlugin } from '../plugins'\n\nexport const importSort = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/import-sort/rules',\n plugins: {\n 'import-sort': importSortPlugin\n },\n rules: {\n 'import-sort/imports': [\n 'error',\n {\n groups: [\n // Type imports (imports ending with \\u0000 are type-only imports)\n // The \\u0000 character is used internally by the import-sort plugin to mark type imports\n [\n String.raw`^.*\\u0000$`,\n String.raw`^node:.*\\u0000$`,\n String.raw`^@?\\w.*\\u0000$`,\n String.raw`^\\.\\..*\\u0000$`,\n String.raw`^\\..*\\u0000$`\n ],\n\n // Side effect imports (e.g., `import 'some-module'`)\n [String.raw`^\\u0000`],\n\n // Node.js builtins prefixed with `node:`\n ['^node:'],\n\n // Things that start with a letter (or digit or underscore), or `@` followed by a letter\n [String.raw`^@?\\w`],\n\n // Absolute imports (e.g., `import something from 'src/utils'`)\n ['^[^.]'],\n\n // Parent directory relative imports (e.g., `import something from '../utils'`)\n [String.raw`^\\.\\.`],\n\n // Current directory relative imports (e.g., `import something from './utils'`)\n [String.raw`^\\.`]\n ]\n }\n ],\n 'import-sort/exports': 'error',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { importLitePlugin } from '../plugins'\n\nexport const imports = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/imports/rules',\n plugins: {\n 'import-lite': importLitePlugin\n },\n rules: {\n 'import-lite/first': 'error',\n 'import-lite/newline-after-import': ['error', { count: 1 }],\n 'import-lite/no-duplicates': 'error',\n 'import-lite/no-mutable-exports': 'error',\n 'import-lite/no-named-default': 'error',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport eslint from '@eslint/js'\nimport globals from 'globals'\n\nimport { unusedImportsPlugin } from '../plugins'\n\nexport const javascript = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/javascript/setup',\n languageOptions: {\n ecmaVersion: 2022,\n globals: {\n ...globals.browser,\n ...globals.es2021,\n ...globals.node,\n document: 'readonly',\n navigator: 'readonly',\n window: 'readonly'\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n },\n ecmaVersion: 2022,\n sourceType: 'module'\n },\n sourceType: 'module'\n },\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n reportUnusedInlineConfigs: 'error'\n }\n },\n {\n name: 'nelsonlaidev/javascript/rules',\n plugins: {\n 'unused-imports': unusedImportsPlugin\n },\n rules: {\n ...eslint.configs.recommended.rules,\n\n // Recommended to disable\n // https://github.com/sweepline/eslint-plugin-unused-imports?tab=readme-ov-file#usage\n 'no-unused-vars': 'off',\n '@typescript-eslint/no-unused-vars': 'off',\n\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n varsIgnorePattern: '^_',\n args: 'after-used',\n argsIgnorePattern: '^_'\n }\n ],\n\n ...overrides\n }\n }\n]\n","export const GLOB_SRC_EXT = '?([cm])[jt]s?(x)'\nexport const GLOB_SRC = '**/*.?([cm])[jt]s?(x)'\n\nexport const GLOB_JS = '**/*.?([cm])js'\nexport const GLOB_JSX = '**/*.?([cm])jsx'\n\nexport const GLOB_TS = '**/*.?([cm])ts'\nexport const GLOB_TSX = '**/*.?([cm])tsx'\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs'\nimport { jsxA11yPlugin } from '../plugins'\n\nexport const jsx = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/jsx/setup',\n files: [GLOB_JSX, GLOB_TSX],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n }\n },\n {\n name: 'nelsonlaidev/jsx/rules',\n files: [GLOB_JSX, GLOB_TSX],\n plugins: {\n 'jsx-a11y': jsxA11yPlugin\n },\n rules: {\n ...jsxA11yPlugin.flatConfigs.strict.rules,\n\n 'jsx-a11y/lang': 'error',\n 'jsx-a11y/no-aria-hidden-on-focusable': 'error',\n\n ...overrides\n },\n settings: {\n 'jsx-a11y': {\n components: {\n Button: 'button',\n Image: 'img',\n Input: 'input',\n Textarea: 'textarea',\n Link: 'a'\n }\n }\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { nextPlugin } from '../plugins'\n\nexport const nextjs = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/nextjs/rules',\n plugins: {\n '@next/next': nextPlugin\n },\n rules: {\n ...nextPlugin.configs['core-web-vitals'].rules,\n\n // Unnecessary\n '@next/next/no-html-link-for-pages': 'off',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { nodePlugin } from '../plugins'\n\nexport const node = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/node/rules',\n plugins: {\n n: nodePlugin\n },\n rules: {\n 'n/handle-callback-err': ['error', '^(err|error)$'],\n 'n/no-deprecated-api': 'error',\n 'n/no-exports-assign': 'error',\n 'n/no-new-require': 'error',\n 'n/no-path-concat': 'error',\n 'n/prefer-promises/fs': 'error',\n 'n/process-exit-as-throw': 'error',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport globals from 'globals'\n\nimport { playwrightPlugin } from '../plugins'\n\nexport const playwright = (glob: string, overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/playwright/setup',\n languageOptions: {\n globals: globals['shared-node-browser']\n }\n },\n {\n name: 'nelsonlaidev/playwright/rules',\n files: [glob],\n plugins: {\n playwright: playwrightPlugin\n },\n rules: {\n ...playwrightPlugin.configs.recommended.rules,\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { prettierPlugin, prettierPluginRecommended } from '../plugins'\n\nexport const prettier = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/prettier/rules',\n plugins: {\n prettier: prettierPlugin\n },\n rules: {\n ...prettierPluginRecommended.rules,\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { GLOB_SRC } from '../globs'\nimport { reactHooksPlugin, reactPlugin } from '../plugins'\n\nexport const react = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/react/rules',\n files: [GLOB_SRC],\n plugins: {\n ...reactPlugin.configs.all.plugins,\n 'react-hooks': reactHooksPlugin\n },\n rules: {\n ...reactPlugin.configs.all.rules,\n ...reactHooksPlugin.configs['recommended-latest'].rules,\n\n '@eslint-react/naming-convention/filename': [\n 'error',\n {\n rule: 'kebab-case',\n excepts: ['index', String.raw`/^_/`, String.raw`/^\\$/`, String.raw`/^[0-9]+$/`, String.raw`/^\\[[^\\]]+\\]$/`]\n }\n ],\n\n // Unnecessary\n '@eslint-react/no-complex-conditional-rendering': 'off',\n '@eslint-react/no-array-index-key': 'off',\n '@eslint-react/naming-convention/use-state': 'off',\n '@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'off',\n 'react-hooks/set-state-in-effect': 'off',\n 'react-hooks/static-components': 'off',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { regexpPlugin } from '../plugins'\n\nexport const regexp = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/regexp/rules',\n plugins: {\n regexp: regexpPlugin\n },\n rules: {\n ...regexpPlugin.configs.recommended.rules,\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { sonarjsPlugin } from '../plugins'\n\nexport const sonarjs = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/sonarjs/rules',\n plugins: {\n sonarjs: sonarjsPlugin\n },\n rules: {\n ...sonarjsPlugin.configs.recommended.rules,\n\n // Disable due to poor performance\n // https://community.sonarsource.com/t/eslint-plugin-sonarjs-performance-issues-on-large-codebase/138392\n 'sonarjs/no-commented-code': 'off',\n 'sonarjs/deprecation': 'off',\n 'sonarjs/arguments-order': 'off',\n\n // Unnecessary\n 'sonarjs/pseudo-random': 'off',\n 'sonarjs/function-return-type': 'off',\n 'sonarjs/prefer-read-only-props': 'off',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { stylisticPlugin } from '../plugins'\n\nexport const stylistic = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/stylistic/rules',\n plugins: {\n '@stylistic': stylisticPlugin\n },\n rules: {\n '@stylistic/multiline-comment-style': ['error', 'separate-lines'],\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { tailwindcssPlugin } from '../plugins'\n\nexport const tailwindcss = (entryPoint: string, overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/tailwindcss/rules',\n plugins: {\n 'better-tailwindcss': tailwindcssPlugin\n },\n rules: {\n 'better-tailwindcss/enforce-consistent-class-order': 'error',\n 'better-tailwindcss/enforce-canonical-classes': 'error',\n 'better-tailwindcss/no-conflicting-classes': 'error',\n 'better-tailwindcss/no-deprecated-classes': 'error',\n 'better-tailwindcss/no-duplicate-classes': 'error',\n 'better-tailwindcss/no-unnecessary-whitespace': 'error',\n 'better-tailwindcss/no-unknown-classes': 'error',\n\n ...overrides\n },\n settings: {\n 'better-tailwindcss': {\n entryPoint\n }\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport parser from '@typescript-eslint/parser'\n\nimport { GLOB_TS, GLOB_TSX } from '../globs'\nimport { typescriptPlugin } from '../plugins'\n\nexport const typescript = (tsconfigRootDir: string, overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/typescript/setup',\n files: [GLOB_TS, GLOB_TSX],\n languageOptions: {\n parser,\n parserOptions: {\n projectService: true,\n tsconfigRootDir\n },\n sourceType: 'module'\n },\n plugins: {\n '@typescript-eslint': typescriptPlugin\n }\n },\n {\n name: 'nelsonlaidev/typescript/rules',\n files: [GLOB_TS, GLOB_TSX],\n rules: {\n ...typescriptPlugin.configs['eslint-recommended'].overrides[0].rules,\n ...typescriptPlugin.configs['strict-type-checked'].rules,\n ...typescriptPlugin.configs['stylistic-type-checked'].rules,\n\n '@typescript-eslint/array-type': ['error', { default: 'array-simple' }],\n '@typescript-eslint/no-invalid-this': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n fixStyle: 'inline-type-imports'\n }\n ],\n '@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: true }],\n '@typescript-eslint/no-import-type-side-effects': 'error',\n '@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],\n '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],\n '@typescript-eslint/only-throw-error': [\n 'error',\n {\n allow: [\n {\n from: 'package',\n package: '@tanstack/router-core',\n name: 'Redirect'\n }\n ]\n }\n ],\n '@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'with-single-extends' }],\n\n // Too opinionated\n '@typescript-eslint/no-floating-promises': 'off',\n '@typescript-eslint/no-unsafe-member-access': 'off',\n '@typescript-eslint/no-unsafe-assignment': 'off',\n '@typescript-eslint/no-non-null-assertion': 'off',\n\n '@typescript-eslint/consistent-type-definitions': 'off',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { unicornPlugin } from '../plugins'\n\nexport const unicorn = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/unicorn/rules',\n plugins: {\n unicorn: unicornPlugin\n },\n rules: {\n ...unicornPlugin.configs.recommended.rules,\n\n // Too opinionated\n 'unicorn/prevent-abbreviations': 'off',\n 'unicorn/no-null': 'off',\n\n // Unnecessary\n 'unicorn/no-document-cookie': 'off',\n 'unicorn/prefer-string-raw': 'off',\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { vitestPlugin } from '../plugins'\n\nexport const vitest = (glob: string, overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/vitest/rules',\n files: [glob],\n plugins: {\n vitest: vitestPlugin\n },\n rules: {\n ...vitestPlugin.configs.recommended.rules,\n\n ...overrides\n }\n }\n]\n","import type { FlatConfig, RuleOverrides } from '../types'\n\nimport { importZodPlugin } from '../plugins'\n\nexport const zod = (overrides?: RuleOverrides): FlatConfig[] => [\n {\n name: 'nelsonlaidev/zod/rules',\n plugins: {\n 'import-zod': importZodPlugin\n },\n rules: {\n 'import-zod/prefer-zod-namespace': 'error',\n\n ...overrides\n }\n }\n]\n","import type { ConfigOptions, FlatConfig } from './types'\n\nimport process from 'node:process'\n\nimport { isPackageExists } from 'local-pkg'\n\nimport { command } from './configs/command'\nimport { comments } from './configs/comments'\nimport { deMorgan } from './configs/de-morgan'\nimport { gitignore } from './configs/gitignore'\nimport { ignores } from './configs/ignores'\nimport { importSort } from './configs/import-sort'\nimport { imports } from './configs/imports'\nimport { javascript } from './configs/javascript'\nimport { jsx } from './configs/jsx'\nimport { nextjs } from './configs/nextjs'\nimport { node } from './configs/node'\nimport { playwright } from './configs/playwright'\nimport { prettier } from './configs/prettier'\nimport { react } from './configs/react'\nimport { regexp } from './configs/regexp'\nimport { sonarjs } from './configs/sonarjs'\nimport { stylistic } from './configs/stylistic'\nimport { tailwindcss } from './configs/tailwindcss'\nimport { typescript } from './configs/typescript'\nimport { unicorn } from './configs/unicorn'\nimport { vitest } from './configs/vitest'\nimport { zod } from './configs/zod'\n\nconst isReactInstalled = isPackageExists('react')\nconst isNextjsInstalled = isPackageExists('next')\n\nexport const defineConfig = (options: ConfigOptions = {}, ...userConfigs: FlatConfig[]): FlatConfig[] => {\n const { overrides = {} } = options\n\n const configs = [\n ...gitignore(),\n ...ignores(options.ignores),\n ...javascript(overrides.javascript),\n ...sonarjs(overrides.sonarjs),\n ...importSort(overrides.importSort),\n ...deMorgan(overrides.deMorgan),\n ...comments(overrides.comments),\n ...node(overrides.node),\n ...imports(overrides.imports),\n ...command(),\n ...unicorn(overrides.unicorn),\n ...jsx(overrides.jsx),\n ...typescript(options.tsconfigRootDir ?? process.cwd(), overrides.typescript),\n ...regexp(overrides.regexp),\n ...stylistic(overrides.stylistic),\n ...zod(overrides.zod)\n ]\n\n const isNextjsEnabled = options.nextjs ?? isNextjsInstalled\n const isReactEnabled = (options.react ?? isReactInstalled) || isNextjsEnabled\n\n if (options.vitestGlob) {\n configs.push(...vitest(options.vitestGlob, overrides.vitest))\n }\n\n if (options.playwrightGlob) {\n configs.push(...playwright(options.playwrightGlob, overrides.playwright))\n }\n\n if (isReactEnabled) {\n configs.push(...react(overrides.react))\n }\n\n if (isNextjsEnabled) {\n configs.push(...nextjs(overrides.nextjs))\n }\n\n if (options.tailwindEntryPoint) {\n configs.push(...tailwindcss(options.tailwindEntryPoint, overrides.tailwindcss))\n }\n\n configs.push(...userConfigs)\n\n // Must be added as the last item\n // https://github.com/prettier/eslint-plugin-prettier?tab=readme-ov-file#configuration-new-eslintconfigjs\n // eslint-disable-next-line unicorn/prefer-single-call -- For better readability\n configs.push(...prettier(overrides.prettier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C3B,GAAG,WAAW,UAAU,WAAW;EACnC,GAAG,QAAQ,UAAU,QAAQ;EAC7B,GAAG,WAAW,UAAU,WAAW;EACnC,GAAG,SAAS,UAAU,SAAS;EAC/B,GAAG,SAAS,UAAU,SAAS;EAC/B,GAAG,KAAK,UAAU,KAAK;EACvB,GAAG,QAAQ,UAAU,QAAQ;EAC7B,GAAG,SAAS;EACZ,GAAG,QAAQ,UAAU,QAAQ;EAC7B,GAAG,IAAI,UAAU,IAAI;EACrB,GAAG,WAAW,QAAQ,mBAAmB,QAAQ,KAAK,EAAE,UAAU,WAAW;EAC7E,GAAG,OAAO,UAAU,OAAO;EAC3B,GAAG,UAAU,UAAU,UAAU;EACjC,GAAG,IAAI,UAAU,IAAI;EACtB;CAED,MAAM,kBAAkB,QAAQ,UAAU;CAC1C,MAAM,kBAAkB,QAAQ,SAAS,qBAAqB;AAE9D,KAAI,QAAQ,WACV,SAAQ,KAAK,GAAG,OAAO,QAAQ,YAAY,UAAU,OAAO,CAAC;AAG/D,KAAI,QAAQ,eACV,SAAQ,KAAK,GAAG,WAAW,QAAQ,gBAAgB,UAAU,WAAW,CAAC;AAG3E,KAAI,eACF,SAAQ,KAAK,GAAG,MAAM,UAAU,MAAM,CAAC;AAGzC,KAAI,gBACF,SAAQ,KAAK,GAAG,OAAO,UAAU,OAAO,CAAC;AAG3C,KAAI,QAAQ,mBACV,SAAQ,KAAK,GAAG,YAAY,QAAQ,oBAAoB,UAAU,YAAY,CAAC;AAGjF,SAAQ,KAAK,GAAG,YAAY;AAK5B,SAAQ,KAAK,GAAG,SAAS,UAAU,SAAS,CAAC;AAE7C,QAAO"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/configs/command.ts","../src/configs/comments.ts","../src/configs/de-morgan.ts","../src/configs/gitignore.ts","../src/configs/ignores.ts","../src/configs/import-sort.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/globs.ts","../src/configs/jsx.ts","../src/configs/nextjs.ts","../src/configs/node.ts","../src/defaults.ts","../src/configs/playwright.ts","../src/configs/prettier.ts","../src/configs/react.ts","../src/configs/regexp.ts","../src/configs/sonarjs.ts","../src/configs/stylistic.ts","../src/configs/tailwindcss.ts","../src/configs/typescript.ts","../src/configs/unicorn.ts","../src/configs/vitest.ts","../src/configs/zod.ts","../src/base.ts"],"sourcesContent":["import type { FlatConfig } from '../types'\n\nimport { commandPlugin } from '../plugins'\n\nexport const command = (): FlatConfig[] => [\n {\n ...commandPlugin(),\n name: 'nelsonlaidev/command/rules'\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { commentsPlugin } from '../plugins'\n\nexport const comments = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/eslint-comments/rules',\n plugins: {\n '@eslint-community/eslint-comments': commentsPlugin\n },\n rules: {\n ...commentsPlugin.configs.recommended.rules,\n\n '@eslint-community/eslint-comments/require-description': 'error',\n '@eslint-community/eslint-comments/no-unused-disable': 'error',\n '@eslint-community/eslint-comments/no-restricted-disable': 'error',\n '@eslint-community/eslint-comments/no-use': [\n 'error',\n { allow: ['eslint-disable-next-line', 'eslint-disable', 'eslint-enable'] }\n ]\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { deMorganPlugin } from '../plugins'\n\nexport const deMorgan = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/de-morgan/rules',\n plugins: {\n 'de-morgan': deMorganPlugin\n },\n rules: {\n ...deMorganPlugin.configs.recommended.rules\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport gitignorePlugin from 'eslint-config-flat-gitignore'\n\nexport const gitignore = (): FlatConfig[] => [\n gitignorePlugin({\n name: 'nelsonlaidev/gitignore'\n })\n]\n","import type { FlatConfig } from '../types'\n\nexport const ignores = (userIgnores: string[] = []): FlatConfig[] => [\n {\n name: 'nelsonlaidev/ignores',\n ignores: ['**/routeTree.gen.ts', ...userIgnores]\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { importSortPlugin } from '../plugins'\n\nexport const importSort = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/import-sort/rules',\n plugins: {\n 'import-sort': importSortPlugin\n },\n rules: {\n 'import-sort/imports': [\n 'error',\n {\n groups: [\n // Type imports (imports ending with \\u0000 are type-only imports)\n // The \\u0000 character is used internally by the import-sort plugin to mark type imports\n [\n String.raw`^.*\\u0000$`,\n String.raw`^node:.*\\u0000$`,\n String.raw`^@?\\w.*\\u0000$`,\n String.raw`^\\.\\..*\\u0000$`,\n String.raw`^\\..*\\u0000$`\n ],\n\n // Side effect imports (e.g., `import 'some-module'`)\n [String.raw`^\\u0000`],\n\n // Node.js builtins prefixed with `node:`\n ['^node:'],\n\n // Things that start with a letter (or digit or underscore), or `@` followed by a letter\n [String.raw`^@?\\w`],\n\n // Absolute imports (e.g., `import something from 'src/utils'`)\n ['^[^.]'],\n\n // Parent directory relative imports (e.g., `import something from '../utils'`)\n [String.raw`^\\.\\.`],\n\n // Current directory relative imports (e.g., `import something from './utils'`)\n [String.raw`^\\.`]\n ]\n }\n ],\n 'import-sort/exports': 'error'\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { importLitePlugin } from '../plugins'\n\nexport const imports = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/imports/rules',\n plugins: {\n 'import-lite': importLitePlugin\n },\n rules: {\n 'import-lite/first': 'error',\n 'import-lite/newline-after-import': ['error', { count: 1 }],\n 'import-lite/no-duplicates': 'error',\n 'import-lite/no-mutable-exports': 'error',\n 'import-lite/no-named-default': 'error'\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport eslint from '@eslint/js'\nimport globals from 'globals'\n\nimport { unusedImportsPlugin } from '../plugins'\n\nexport const javascript = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/javascript/setup',\n languageOptions: {\n ecmaVersion: 2022,\n globals: {\n ...globals.browser,\n ...globals.es2021,\n ...globals.node,\n document: 'readonly',\n navigator: 'readonly',\n window: 'readonly'\n },\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n },\n ecmaVersion: 2022,\n sourceType: 'module'\n },\n sourceType: 'module'\n },\n linterOptions: {\n reportUnusedDisableDirectives: 'error',\n reportUnusedInlineConfigs: 'error'\n }\n },\n {\n name: 'nelsonlaidev/javascript/rules',\n plugins: {\n 'unused-imports': unusedImportsPlugin\n },\n rules: {\n ...eslint.configs.recommended.rules,\n\n // Recommended to disable\n // https://github.com/sweepline/eslint-plugin-unused-imports?tab=readme-ov-file#usage\n 'no-unused-vars': 'off',\n '@typescript-eslint/no-unused-vars': 'off',\n\n 'unused-imports/no-unused-imports': 'error',\n 'unused-imports/no-unused-vars': [\n 'error',\n {\n vars: 'all',\n varsIgnorePattern: '^_',\n args: 'after-used',\n argsIgnorePattern: '^_'\n }\n ]\n }\n }\n]\n","export const GLOB_SRC_EXT = '?([cm])[jt]s?(x)'\nexport const GLOB_SRC = '**/*.?([cm])[jt]s?(x)'\n\nexport const GLOB_JS = '**/*.?([cm])js'\nexport const GLOB_JSX = '**/*.?([cm])jsx'\n\nexport const GLOB_TS = '**/*.?([cm])ts'\nexport const GLOB_TSX = '**/*.?([cm])tsx'\n","import type { FlatConfig, JsxA11yOptions, JsxOptions } from '../types'\n\nimport { GLOB_JSX, GLOB_TSX } from '../globs'\nimport { jsxA11yPlugin } from '../plugins'\n\nexport const jsx = (options: JsxOptions): FlatConfig[] => [\n {\n name: 'nelsonlaidev/jsx/setup',\n files: [GLOB_JSX, GLOB_TSX],\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true\n }\n }\n }\n },\n {\n name: 'nelsonlaidev/jsx/rules',\n files: [GLOB_JSX, GLOB_TSX],\n plugins: {\n 'jsx-a11y': jsxA11yPlugin\n },\n rules: {\n ...jsxA11yPlugin.flatConfigs.recommended.rules,\n\n 'jsx-a11y/lang': 'error',\n 'jsx-a11y/no-aria-hidden-on-focusable': 'error'\n },\n settings: {\n 'jsx-a11y': {\n ...options.a11y,\n components: {\n Button: 'button',\n Image: 'img',\n Input: 'input',\n Textarea: 'textarea',\n Link: 'a',\n ...options.a11y?.components\n }\n } satisfies JsxA11yOptions\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { nextPlugin } from '../plugins'\n\nexport const nextjs = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/nextjs/rules',\n plugins: {\n '@next/next': nextPlugin\n },\n rules: {\n ...nextPlugin.configs['core-web-vitals'].rules,\n\n // Unnecessary\n '@next/next/no-html-link-for-pages': 'off'\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { nodePlugin } from '../plugins'\n\nexport const node = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/node/rules',\n plugins: {\n n: nodePlugin\n },\n rules: {\n 'n/handle-callback-err': ['error', '^(err|error)$'],\n 'n/no-deprecated-api': 'error',\n 'n/no-exports-assign': 'error',\n 'n/no-new-require': 'error',\n 'n/no-path-concat': 'error',\n 'n/prefer-promises/fs': 'error',\n 'n/process-exit-as-throw': 'error'\n }\n }\n]\n","import type {\n CanonicalClassesOptions,\n ConsistentClassOrderOptions,\n ExpectExpectOptions,\n MaxNestedDescribeOptions,\n MissingPlaywrightAwaitOptions,\n NoRestrictedClassesOptions,\n NoSkippedTestOptions,\n NoUnknownClassesOptions,\n NoUnnecessaryWhitespaceOptions,\n ValidExpectOptions,\n ValidTestTagsOptions,\n ValidTitleOptions\n} from './types'\n\nexport const DEFAULT_ROOT_FONT_SIZE = 16\n\nexport const CANONICAL_CLASSES_DEFAULT_OPTIONS: CanonicalClassesOptions = {\n rootFontSize: DEFAULT_ROOT_FONT_SIZE,\n collapse: true,\n logical: true\n}\n\nexport const CONSISTENT_CLASS_ORDER_DEFAULT_OPTIONS: ConsistentClassOrderOptions = {\n order: 'official',\n detectComponentClasses: false,\n componentClassOrder: 'preserve',\n componentClassPosition: 'start',\n unknownClassOrder: 'preserve',\n unknownClassPosition: 'start'\n}\n\nexport const NO_RESTRICTED_CLASSES_DEFAULT_OPTIONS: NoRestrictedClassesOptions = {\n restrict: []\n}\n\nexport const NO_UNKNOWN_CLASSES_DEFAULT_OPTIONS: NoUnknownClassesOptions = {\n ignore: [],\n detectComponentClasses: false\n}\n\nexport const NO_UNNECESSARY_WHITESPACE_DEFAULT_OPTIONS: NoUnnecessaryWhitespaceOptions = {\n allowMultiline: true\n}\n\nexport const EXPECT_EXPECT_DEFAULT_OPTIONS: ExpectExpectOptions = {\n assertFunctionNames: [],\n assertFunctionPatterns: []\n}\n\nexport const MAX_NESTED_DESCRIBE_DEFAULT_OPTIONS: MaxNestedDescribeOptions = {\n max: 5\n}\n\nexport const MISSING_PLAYWRIGHT_AWAIT_DEFAULT_OPTIONS: MissingPlaywrightAwaitOptions = {\n customMatchers: []\n}\n\nexport const NO_SKIPPED_TEST_DEFAULT_OPTIONS: NoSkippedTestOptions = {\n allowConditional: false\n}\n\nexport const VALID_EXPECT_DEFAULT_OPTIONS: ValidExpectOptions = {\n minArgs: 1,\n maxArgs: 2\n}\n\nexport const VALID_TITLE_DEFAULT_OPTIONS: ValidTitleOptions = {\n ignoreSpaces: false,\n ignoreTypeOfStepName: true,\n ignoreTypeOfTestName: false,\n ignoreTypeOfDescribeName: false,\n disallowedWords: [],\n mustNotMatch: {},\n mustMatch: {}\n}\n\nexport const VALID_TEST_TAGS_DEFAULT_OPTIONS: ValidTestTagsOptions = {\n allowedTags: [],\n disallowedTags: []\n}\n","import type { FlatConfig, PlaywrightOptions } from '../types'\n\nimport globals from 'globals'\n\nimport {\n EXPECT_EXPECT_DEFAULT_OPTIONS,\n MAX_NESTED_DESCRIBE_DEFAULT_OPTIONS,\n MISSING_PLAYWRIGHT_AWAIT_DEFAULT_OPTIONS,\n NO_SKIPPED_TEST_DEFAULT_OPTIONS,\n VALID_EXPECT_DEFAULT_OPTIONS,\n VALID_TEST_TAGS_DEFAULT_OPTIONS,\n VALID_TITLE_DEFAULT_OPTIONS\n} from '../defaults'\nimport { playwrightPlugin } from '../plugins'\n\nexport const playwright = (options: PlaywrightOptions): FlatConfig[] => [\n {\n name: 'nelsonlaidev/playwright/setup',\n languageOptions: {\n globals: globals['shared-node-browser']\n }\n },\n {\n name: 'nelsonlaidev/playwright/rules',\n files: options.files,\n plugins: {\n playwright: playwrightPlugin\n },\n settings: {\n playwright: {\n globalAliases: options.globalAliases,\n messages: options.messages\n }\n },\n rules: {\n ...playwrightPlugin.configs.recommended.rules,\n 'playwright/expect-expect': [\n 'error',\n {\n ...EXPECT_EXPECT_DEFAULT_OPTIONS,\n ...options.expectExpect,\n assertFunctionNames: [...(options.expectExpect?.assertFunctionNames ?? [])],\n assertFunctionPatterns: [...(options.expectExpect?.assertFunctionPatterns ?? [])]\n }\n ],\n 'playwright/max-nested-describe': [\n 'error',\n {\n ...MAX_NESTED_DESCRIBE_DEFAULT_OPTIONS,\n ...options.maxNestedDescribe\n }\n ],\n 'playwright/missing-playwright-await': [\n 'error',\n {\n ...MISSING_PLAYWRIGHT_AWAIT_DEFAULT_OPTIONS,\n ...options.missingPlaywrightAwait,\n customMatchers: [...(options.missingPlaywrightAwait?.customMatchers ?? [])]\n }\n ],\n 'playwright/no-skipped-test': [\n 'error',\n {\n ...NO_SKIPPED_TEST_DEFAULT_OPTIONS,\n ...options.noSkippedTest\n }\n ],\n 'playwright/valid-expect': [\n 'error',\n {\n ...VALID_EXPECT_DEFAULT_OPTIONS,\n ...options.validExpect\n }\n ],\n 'playwright/valid-title': [\n 'error',\n {\n ...VALID_TITLE_DEFAULT_OPTIONS,\n ...options.validTitle,\n disallowedWords: [...(options.validTitle?.disallowedWords ?? [])]\n }\n ],\n 'playwright/valid-test-tags': [\n 'error',\n {\n ...VALID_TEST_TAGS_DEFAULT_OPTIONS,\n ...options.validTestTags,\n allowedTags: [...(options.validTestTags?.allowedTags ?? [])],\n disallowedTags: [...(options.validTestTags?.disallowedTags ?? [])]\n }\n ]\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { prettierPlugin, prettierPluginRecommended } from '../plugins'\n\nexport const prettier = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/prettier/rules',\n plugins: {\n prettier: prettierPlugin\n },\n rules: {\n ...prettierPluginRecommended.rules\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { GLOB_SRC } from '../globs'\nimport { reactHooksPlugin, reactPlugin } from '../plugins'\n\nexport const react = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/react/rules',\n files: [GLOB_SRC],\n plugins: {\n ...reactPlugin.configs.all.plugins,\n 'react-hooks': reactHooksPlugin\n },\n rules: {\n ...reactPlugin.configs.all.rules,\n ...reactHooksPlugin.configs['recommended-latest'].rules,\n\n '@eslint-react/naming-convention/filename': [\n 'error',\n {\n rule: 'kebab-case',\n excepts: ['index', String.raw`/^_/`, String.raw`/^\\$/`, String.raw`/^[0-9]+$/`, String.raw`/^\\[[^\\]]+\\]$/`]\n }\n ],\n\n // Unnecessary\n '@eslint-react/no-complex-conditional-rendering': 'off',\n '@eslint-react/no-array-index-key': 'off',\n '@eslint-react/naming-convention/use-state': 'off',\n '@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'off',\n 'react-hooks/set-state-in-effect': 'off',\n 'react-hooks/static-components': 'off'\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { regexpPlugin } from '../plugins'\n\nexport const regexp = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/regexp/rules',\n plugins: {\n regexp: regexpPlugin\n },\n rules: {\n ...regexpPlugin.configs.recommended.rules\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { sonarjsPlugin } from '../plugins'\n\nexport const sonarjs = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/sonarjs/rules',\n plugins: {\n sonarjs: sonarjsPlugin\n },\n rules: {\n ...sonarjsPlugin.configs.recommended.rules,\n\n // Disable due to poor performance\n // https://community.sonarsource.com/t/eslint-plugin-sonarjs-performance-issues-on-large-codebase/138392\n 'sonarjs/no-commented-code': 'off',\n 'sonarjs/deprecation': 'off',\n 'sonarjs/arguments-order': 'off',\n\n // Unnecessary\n 'sonarjs/pseudo-random': 'off',\n 'sonarjs/function-return-type': 'off',\n 'sonarjs/prefer-read-only-props': 'off'\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { stylisticPlugin } from '../plugins'\n\nexport const stylistic = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/stylistic/rules',\n plugins: {\n '@stylistic': stylisticPlugin\n },\n rules: {\n '@stylistic/multiline-comment-style': ['error', 'separate-lines']\n }\n }\n]\n","import type { FlatConfig, TailwindCSSOptions } from '../types'\n\nimport {\n getDefaultAttributes,\n getDefaultCallees,\n getDefaultTags,\n getDefaultVariables\n} from 'eslint-plugin-better-tailwindcss/api/defaults'\n\nimport {\n CANONICAL_CLASSES_DEFAULT_OPTIONS,\n CONSISTENT_CLASS_ORDER_DEFAULT_OPTIONS,\n DEFAULT_ROOT_FONT_SIZE,\n NO_RESTRICTED_CLASSES_DEFAULT_OPTIONS,\n NO_UNKNOWN_CLASSES_DEFAULT_OPTIONS,\n NO_UNNECESSARY_WHITESPACE_DEFAULT_OPTIONS\n} from '../defaults'\nimport { tailwindcssPlugin } from '../plugins'\n\nexport const tailwindcss = (options: TailwindCSSOptions): FlatConfig[] => {\n const shouldEnableShorthandRule = !options.canonicalClasses || options.canonicalClasses.logical === false\n\n return [\n {\n name: 'nelsonlaidev/tailwindcss/rules',\n plugins: {\n 'better-tailwindcss': tailwindcssPlugin\n },\n rules: {\n 'better-tailwindcss/enforce-canonical-classes': [\n 'error',\n {\n ...CANONICAL_CLASSES_DEFAULT_OPTIONS,\n ...options.canonicalClasses\n }\n ],\n // The below rules are recommended to be disabled to avoid duplicate reports\n // when the canonical classes rule is enabled\n 'better-tailwindcss/enforce-consistent-important-position': 'off',\n 'better-tailwindcss/enforce-consistent-variable-syntax': 'off',\n 'better-tailwindcss/enforce-shorthand-classes': shouldEnableShorthandRule ? 'error' : 'off',\n\n 'better-tailwindcss/enforce-consistent-class-order': [\n 'error',\n {\n ...CONSISTENT_CLASS_ORDER_DEFAULT_OPTIONS,\n ...options.consistentClassOrder\n }\n ],\n 'better-tailwindcss/no-conflicting-classes': 'error',\n 'better-tailwindcss/no-deprecated-classes': 'error',\n 'better-tailwindcss/no-duplicate-classes': 'error',\n 'better-tailwindcss/no-restricted-classes': [\n 'error',\n {\n ...NO_RESTRICTED_CLASSES_DEFAULT_OPTIONS,\n ...options.noRestrictedClasses,\n restrict: [...(options.noRestrictedClasses?.restrict ?? [])]\n }\n ],\n 'better-tailwindcss/no-unknown-classes': [\n 'error',\n {\n ...NO_UNKNOWN_CLASSES_DEFAULT_OPTIONS,\n ...options.noUnknownClasses,\n ignore: [...(options.noUnknownClasses?.ignore ?? [])]\n }\n ],\n 'better-tailwindcss/no-unnecessary-whitespace': [\n 'error',\n {\n ...NO_UNNECESSARY_WHITESPACE_DEFAULT_OPTIONS,\n ...options.noUnnecessaryWhitespace\n }\n ]\n },\n settings: {\n 'better-tailwindcss': {\n ...options,\n rootFontSize: options.rootFontSize ?? DEFAULT_ROOT_FONT_SIZE,\n attributes: [...getDefaultAttributes(), ...(options.attributes ?? [])],\n callees: [...getDefaultCallees(), ...(options.callees ?? [])],\n variables: [...getDefaultVariables(), ...(options.variables ?? [])],\n tags: [...getDefaultTags(), ...(options.tags ?? [])]\n } satisfies TailwindCSSOptions\n }\n }\n ]\n}\n","import type { FlatConfig } from '../types'\n\nimport parser from '@typescript-eslint/parser'\n\nimport { GLOB_TS, GLOB_TSX } from '../globs'\nimport { typescriptPlugin } from '../plugins'\n\nexport const typescript = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/typescript/setup',\n languageOptions: {\n parser,\n parserOptions: {\n projectService: true,\n tsconfigRootDir: process.cwd()\n },\n sourceType: 'module'\n },\n plugins: {\n '@typescript-eslint': typescriptPlugin\n }\n },\n {\n name: 'nelsonlaidev/typescript/rules',\n files: [GLOB_TS, GLOB_TSX],\n rules: {\n ...typescriptPlugin.configs['eslint-recommended'].overrides[0].rules,\n ...typescriptPlugin.configs['strict-type-checked'].rules,\n ...typescriptPlugin.configs['stylistic-type-checked'].rules,\n\n '@typescript-eslint/array-type': ['error', { default: 'array-simple' }],\n '@typescript-eslint/no-invalid-this': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n fixStyle: 'inline-type-imports'\n }\n ],\n '@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: true }],\n '@typescript-eslint/no-import-type-side-effects': 'error',\n '@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],\n '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],\n '@typescript-eslint/only-throw-error': [\n 'error',\n {\n allow: [\n {\n from: 'package',\n package: '@tanstack/router-core',\n name: 'Redirect'\n }\n ]\n }\n ],\n '@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'with-single-extends' }],\n\n // Too opinionated\n '@typescript-eslint/no-floating-promises': 'off',\n '@typescript-eslint/no-unsafe-member-access': 'off',\n '@typescript-eslint/no-unsafe-assignment': 'off',\n '@typescript-eslint/no-non-null-assertion': 'off',\n\n '@typescript-eslint/consistent-type-definitions': 'off'\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { unicornPlugin } from '../plugins'\n\nexport const unicorn = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/unicorn/rules',\n plugins: {\n unicorn: unicornPlugin\n },\n rules: {\n ...unicornPlugin.configs.recommended.rules,\n\n // Too opinionated\n 'unicorn/prevent-abbreviations': 'off',\n 'unicorn/no-null': 'off',\n\n // Unnecessary\n 'unicorn/no-document-cookie': 'off',\n 'unicorn/prefer-string-raw': 'off'\n }\n }\n]\n","import type { FlatConfig, VitestOptions } from '../types'\n\nimport { vitestPlugin } from '../plugins'\n\nexport const vitest = (options: VitestOptions): FlatConfig[] => [\n {\n name: 'nelsonlaidev/vitest/rules',\n files: options.files,\n plugins: {\n vitest: vitestPlugin\n },\n rules: {\n ...vitestPlugin.configs.recommended.rules\n }\n }\n]\n","import type { FlatConfig } from '../types'\n\nimport { importZodPlugin } from '../plugins'\n\nexport const zod = (): FlatConfig[] => [\n {\n name: 'nelsonlaidev/zod/rules',\n plugins: {\n 'import-zod': importZodPlugin\n },\n rules: {\n 'import-zod/prefer-zod-namespace': 'error'\n }\n }\n]\n","import type { ConfigOptions, FlatConfig } from './types'\n\nimport { isPackageExists } from 'local-pkg'\n\nimport { command } from './configs/command'\nimport { comments } from './configs/comments'\nimport { deMorgan } from './configs/de-morgan'\nimport { gitignore } from './configs/gitignore'\nimport { ignores } from './configs/ignores'\nimport { importSort } from './configs/import-sort'\nimport { imports } from './configs/imports'\nimport { javascript } from './configs/javascript'\nimport { jsx } from './configs/jsx'\nimport { nextjs } from './configs/nextjs'\nimport { node } from './configs/node'\nimport { playwright } from './configs/playwright'\nimport { prettier } from './configs/prettier'\nimport { react } from './configs/react'\nimport { regexp } from './configs/regexp'\nimport { sonarjs } from './configs/sonarjs'\nimport { stylistic } from './configs/stylistic'\nimport { tailwindcss } from './configs/tailwindcss'\nimport { typescript } from './configs/typescript'\nimport { unicorn } from './configs/unicorn'\nimport { vitest } from './configs/vitest'\nimport { zod } from './configs/zod'\n\nconst isReactInstalled = isPackageExists('react')\nconst isNextjsInstalled = isPackageExists('next')\nconst isPrettierInstalled = isPackageExists('prettier')\n\nexport const defineConfig = (options: ConfigOptions = {}, ...userConfigs: FlatConfig[]): FlatConfig[] => {\n const configs = [\n ...gitignore(),\n ...ignores(options.ignores),\n ...javascript(),\n ...sonarjs(),\n ...importSort(),\n ...deMorgan(),\n ...comments(),\n ...node(),\n ...imports(),\n ...command(),\n ...unicorn(),\n ...jsx(options.jsx ?? {}),\n ...typescript(),\n ...regexp(),\n ...stylistic(),\n ...zod()\n ]\n\n const isNextjsEnabled = options.nextjs ?? isNextjsInstalled\n const isReactEnabled = (options.react ?? isReactInstalled) || isNextjsEnabled\n const isPrettierEnabled = options.prettier ?? isPrettierInstalled\n\n if (options.vitest) {\n configs.push(...vitest(options.vitest))\n }\n\n if (options.playwright) {\n configs.push(...playwright(options.playwright))\n }\n\n if (isReactEnabled) {\n configs.push(...react())\n }\n\n if (isNextjsEnabled) {\n configs.push(...nextjs())\n }\n\n if (options.tailwindcss) {\n configs.push(...tailwindcss(options.tailwindcss))\n }\n\n configs.push(...userConfigs)\n\n if (isPrettierEnabled) {\n // Must be added as the last item\n // https://github.com/prettier/eslint-plugin-prettier?tab=readme-ov-file#configuration-new-eslintconfigjs\n configs.push(...prettier())\n }\n\n return configs\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAa,gBAA8B,CACzC;CACE,GAAG,eAAe;CAClB,MAAM;CACP,CACF;;;;ACLD,MAAa,iBAA+B,CAC1C;CACE,MAAM;CACN,SAAS,EACP,qCAAqC,gBACtC;CACD,OAAO;EACL,GAAG,eAAe,QAAQ,YAAY;EAEtC,yDAAyD;EACzD,uDAAuD;EACvD,2DAA2D;EAC3D,4CAA4C,CAC1C,SACA,EAAE,OAAO;GAAC;GAA4B;GAAkB;GAAgB,EAAE,CAC3E;EACF;CACF,CACF;;;;AClBD,MAAa,iBAA+B,CAC1C;CACE,MAAM;CACN,SAAS,EACP,aAAa,gBACd;CACD,OAAO,EACL,GAAG,eAAe,QAAQ,YAAY,OACvC;CACF,CACF;;;;ACVD,MAAa,kBAAgC,CAC3C,gBAAgB,EACd,MAAM,0BACP,CAAC,CACH;;;;ACND,MAAa,WAAW,cAAwB,EAAE,KAAmB,CACnE;CACE,MAAM;CACN,SAAS,CAAC,uBAAuB,GAAG,YAAY;CACjD,CACF;;;;ACHD,MAAa,mBAAiC,CAC5C;CACE,MAAM;CACN,SAAS,EACP,eAAe,kBAChB;CACD,OAAO;EACL,uBAAuB,CACrB,SACA,EACE,QAAQ;GAGN;IACE,OAAO,GAAG;IACV,OAAO,GAAG;IACV,OAAO,GAAG;IACV,OAAO,GAAG;IACV,OAAO,GAAG;IACX;GAGD,CAAC,OAAO,GAAG,UAA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,QAAQ;EAC3B,GAAG,YAAY;EACf,GAAG,SAAS;EACZ,GAAG,YAAY;EACf,GAAG,UAAU;EACb,GAAG,UAAU;EACb,GAAG,MAAM;EACT,GAAG,SAAS;EACZ,GAAG,SAAS;EACZ,GAAG,SAAS;EACZ,GAAG,IAAI,QAAQ,OAAO,EAAE,CAAC;EACzB,GAAG,YAAY;EACf,GAAG,QAAQ;EACX,GAAG,WAAW;EACd,GAAG,KAAK;EACT;CAED,MAAM,kBAAkB,QAAQ,UAAU;CAC1C,MAAM,kBAAkB,QAAQ,SAAS,qBAAqB;CAC9D,MAAM,oBAAoB,QAAQ,YAAY;AAE9C,KAAI,QAAQ,OACV,SAAQ,KAAK,GAAG,OAAO,QAAQ,OAAO,CAAC;AAGzC,KAAI,QAAQ,WACV,SAAQ,KAAK,GAAG,WAAW,QAAQ,WAAW,CAAC;AAGjD,KAAI,eACF,SAAQ,KAAK,GAAG,OAAO,CAAC;AAG1B,KAAI,gBACF,SAAQ,KAAK,GAAG,QAAQ,CAAC;AAG3B,KAAI,QAAQ,YACV,SAAQ,KAAK,GAAG,YAAY,QAAQ,YAAY,CAAC;AAGnD,SAAQ,KAAK,GAAG,YAAY;AAE5B,KAAI,kBAGF,SAAQ,KAAK,GAAG,UAAU,CAAC;AAG7B,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nelsonlaidev/eslint-config",
3
- "version": "2.5.1",
3
+ "version": "3.0.1",
4
4
  "homepage": "https://github.com/nelsonlaidev/config/blob/main/packages/eslint-config/README.md",
5
5
  "bugs": {
6
6
  "url": "https://github.com/nelsonlaidev/config/issues"