@icebreakers/eslint-config 1.3.5 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -109,7 +109,7 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
109
109
  }
110
110
  });
111
111
 
112
- // ../../node_modules/.pnpm/eslint-plugin-vue@10.4.0_@typescript-eslint+parser@8.39.0_eslint@9.33.0_jiti@2.5.1__typ_55be7873b8c7d4130584032ae69f50c6/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
112
+ // ../../node_modules/.pnpm/eslint-plugin-vue@10.4.0_@typescript-eslint+parser@8.42.0_eslint@9.34.0_jiti@2.5.1__typ_8fc7a87f8e8dfb34270bc832e9dd9f18/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
113
113
  var inline_non_void_elements_default = [
114
114
  "a",
115
115
  "abbr",
@@ -220,7 +220,7 @@ function getDefaultTypescriptOptions(opts) {
220
220
  }
221
221
  ]
222
222
  };
223
- if (opts?.nest) {
223
+ if (opts?.nestjs) {
224
224
  Object.assign(overrides, {
225
225
  "ts/interface-name-prefix": "off",
226
226
  "ts/explicit-function-return-type": "off",
@@ -256,6 +256,11 @@ function getPresets(options, mode) {
256
256
  // 'no-undef': 'error',
257
257
  // 'prefer-const': 'off',
258
258
  }
259
+ },
260
+ test: {
261
+ overrides: {
262
+ "test/prefer-lowercase-title": ["off"]
263
+ }
259
264
  }
260
265
  });
261
266
  const vueOptions = getDefaultVueOptions(options);
@@ -310,19 +315,47 @@ function getPresets(options, mode) {
310
315
  }
311
316
  ];
312
317
  if (enableTailwindcss) {
313
- presets.push(
314
- // @ts-ignore
315
- (0, antfu_exports.interopDefault)(
316
- import("eslint-plugin-tailwindcss")
317
- ).then((tailwind) => {
318
- return tailwind.configs["flat/recommended"];
319
- })
320
- );
321
- presets.push({
322
- rules: {
323
- "tailwindcss/no-custom-classname": "off"
324
- }
325
- });
318
+ if (typeof enableTailwindcss === "object") {
319
+ presets.push(
320
+ (0, antfu_exports.interopDefault)(
321
+ import("eslint-plugin-better-tailwindcss")
322
+ ).then((eslintPluginBetterTailwindcss) => {
323
+ return {
324
+ plugins: {
325
+ "better-tailwindcss": eslintPluginBetterTailwindcss
326
+ },
327
+ rules: {
328
+ // enable all recommended rules to report a warning
329
+ ...eslintPluginBetterTailwindcss.configs["recommended-warn"].rules,
330
+ // enable all recommended rules to report an error
331
+ ...eslintPluginBetterTailwindcss.configs["recommended-error"].rules
332
+ },
333
+ settings: {
334
+ "better-tailwindcss": {
335
+ // tailwindcss 4: the path to the entry file of the css based tailwind config (eg: `src/global.css`)
336
+ entryPoint: enableTailwindcss.entryPoint,
337
+ // tailwindcss 3: the path to the tailwind config file (eg: `tailwind.config.js`)
338
+ tailwindConfig: enableTailwindcss.tailwindConfig
339
+ }
340
+ }
341
+ };
342
+ })
343
+ );
344
+ } else {
345
+ presets.push(
346
+ // @ts-ignore
347
+ (0, antfu_exports.interopDefault)(
348
+ import("eslint-plugin-tailwindcss")
349
+ ).then((tailwind) => {
350
+ return tailwind.configs["flat/recommended"];
351
+ })
352
+ );
353
+ presets.push({
354
+ rules: {
355
+ "tailwindcss/no-custom-classname": "off"
356
+ }
357
+ });
358
+ }
326
359
  }
327
360
  if (enableMDX) {
328
361
  presets.push((0, antfu_exports.interopDefault)(import("eslint-plugin-mdx")).then((mdx) => {
package/dist/index.d.cts CHANGED
@@ -5,11 +5,44 @@ export { FlatConfigComposer } from 'eslint-flat-config-utils';
5
5
  import { Linter } from 'eslint';
6
6
 
7
7
  type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
8
- tailwindcss?: boolean;
8
+ /**
9
+ * Enable TailwindCSS support
10
+ * @default false
11
+ */
12
+ tailwindcss?: boolean | {
13
+ /**
14
+ * tailwindcss 4: the path to the entry file of the css based tailwind config (eg: `src/global.css`)
15
+ */
16
+ entryPoint?: string;
17
+ /**
18
+ * tailwindcss 3: the path to the tailwind config file (eg: `tailwind.config.js`)
19
+ */
20
+ tailwindConfig?: string;
21
+ };
22
+ /**
23
+ * Enable MDX support
24
+ * @default false
25
+ */
9
26
  mdx?: boolean;
27
+ /**
28
+ * Enable A11y support
29
+ * @default false
30
+ */
10
31
  a11y?: boolean;
11
- nest?: boolean;
32
+ /**
33
+ * Enable NestJS support
34
+ * @default false
35
+ */
36
+ nestjs?: boolean;
37
+ /**
38
+ * Enable Ionic support
39
+ * @default false
40
+ */
12
41
  ionic?: boolean;
42
+ /**
43
+ * Enable Weapp support
44
+ * @default false
45
+ */
13
46
  weapp?: boolean;
14
47
  };
15
48
  type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>;
package/dist/index.d.ts CHANGED
@@ -5,11 +5,44 @@ export { FlatConfigComposer } from 'eslint-flat-config-utils';
5
5
  import { Linter } from 'eslint';
6
6
 
7
7
  type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
8
- tailwindcss?: boolean;
8
+ /**
9
+ * Enable TailwindCSS support
10
+ * @default false
11
+ */
12
+ tailwindcss?: boolean | {
13
+ /**
14
+ * tailwindcss 4: the path to the entry file of the css based tailwind config (eg: `src/global.css`)
15
+ */
16
+ entryPoint?: string;
17
+ /**
18
+ * tailwindcss 3: the path to the tailwind config file (eg: `tailwind.config.js`)
19
+ */
20
+ tailwindConfig?: string;
21
+ };
22
+ /**
23
+ * Enable MDX support
24
+ * @default false
25
+ */
9
26
  mdx?: boolean;
27
+ /**
28
+ * Enable A11y support
29
+ * @default false
30
+ */
10
31
  a11y?: boolean;
11
- nest?: boolean;
32
+ /**
33
+ * Enable NestJS support
34
+ * @default false
35
+ */
36
+ nestjs?: boolean;
37
+ /**
38
+ * Enable Ionic support
39
+ * @default false
40
+ */
12
41
  ionic?: boolean;
42
+ /**
43
+ * Enable Weapp support
44
+ * @default false
45
+ */
13
46
  weapp?: boolean;
14
47
  };
15
48
  type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>;
package/dist/index.js CHANGED
@@ -85,7 +85,7 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
85
85
  }
86
86
  });
87
87
 
88
- // ../../node_modules/.pnpm/eslint-plugin-vue@10.4.0_@typescript-eslint+parser@8.39.0_eslint@9.33.0_jiti@2.5.1__typ_55be7873b8c7d4130584032ae69f50c6/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
88
+ // ../../node_modules/.pnpm/eslint-plugin-vue@10.4.0_@typescript-eslint+parser@8.42.0_eslint@9.34.0_jiti@2.5.1__typ_8fc7a87f8e8dfb34270bc832e9dd9f18/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
89
89
  var inline_non_void_elements_default = [
90
90
  "a",
91
91
  "abbr",
@@ -196,7 +196,7 @@ function getDefaultTypescriptOptions(opts) {
196
196
  }
197
197
  ]
198
198
  };
199
- if (opts?.nest) {
199
+ if (opts?.nestjs) {
200
200
  Object.assign(overrides, {
201
201
  "ts/interface-name-prefix": "off",
202
202
  "ts/explicit-function-return-type": "off",
@@ -232,6 +232,11 @@ function getPresets(options, mode) {
232
232
  // 'no-undef': 'error',
233
233
  // 'prefer-const': 'off',
234
234
  }
235
+ },
236
+ test: {
237
+ overrides: {
238
+ "test/prefer-lowercase-title": ["off"]
239
+ }
235
240
  }
236
241
  });
237
242
  const vueOptions = getDefaultVueOptions(options);
@@ -286,19 +291,47 @@ function getPresets(options, mode) {
286
291
  }
287
292
  ];
288
293
  if (enableTailwindcss) {
289
- presets.push(
290
- // @ts-ignore
291
- (0, antfu_exports.interopDefault)(
292
- import("eslint-plugin-tailwindcss")
293
- ).then((tailwind) => {
294
- return tailwind.configs["flat/recommended"];
295
- })
296
- );
297
- presets.push({
298
- rules: {
299
- "tailwindcss/no-custom-classname": "off"
300
- }
301
- });
294
+ if (typeof enableTailwindcss === "object") {
295
+ presets.push(
296
+ (0, antfu_exports.interopDefault)(
297
+ import("eslint-plugin-better-tailwindcss")
298
+ ).then((eslintPluginBetterTailwindcss) => {
299
+ return {
300
+ plugins: {
301
+ "better-tailwindcss": eslintPluginBetterTailwindcss
302
+ },
303
+ rules: {
304
+ // enable all recommended rules to report a warning
305
+ ...eslintPluginBetterTailwindcss.configs["recommended-warn"].rules,
306
+ // enable all recommended rules to report an error
307
+ ...eslintPluginBetterTailwindcss.configs["recommended-error"].rules
308
+ },
309
+ settings: {
310
+ "better-tailwindcss": {
311
+ // tailwindcss 4: the path to the entry file of the css based tailwind config (eg: `src/global.css`)
312
+ entryPoint: enableTailwindcss.entryPoint,
313
+ // tailwindcss 3: the path to the tailwind config file (eg: `tailwind.config.js`)
314
+ tailwindConfig: enableTailwindcss.tailwindConfig
315
+ }
316
+ }
317
+ };
318
+ })
319
+ );
320
+ } else {
321
+ presets.push(
322
+ // @ts-ignore
323
+ (0, antfu_exports.interopDefault)(
324
+ import("eslint-plugin-tailwindcss")
325
+ ).then((tailwind) => {
326
+ return tailwind.configs["flat/recommended"];
327
+ })
328
+ );
329
+ presets.push({
330
+ rules: {
331
+ "tailwindcss/no-custom-classname": "off"
332
+ }
333
+ });
334
+ }
302
335
  }
303
336
  if (enableMDX) {
304
337
  presets.push((0, antfu_exports.interopDefault)(import("eslint-plugin-mdx")).then((mdx) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/eslint-config",
3
3
  "type": "module",
4
- "version": "1.3.5",
4
+ "version": "1.4.0",
5
5
  "description": "icebreakers's eslint config",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -40,9 +40,10 @@
40
40
  "dist"
41
41
  ],
42
42
  "dependencies": {
43
- "@antfu/eslint-config": "5.2.1",
44
- "@eslint-react/eslint-plugin": "^1.52.6",
45
- "@next/eslint-plugin-next": "^15.5.0",
43
+ "@antfu/eslint-config": "5.2.2",
44
+ "@eslint-react/eslint-plugin": "^1.53.0",
45
+ "@next/eslint-plugin-next": "^15.5.2",
46
+ "eslint-plugin-better-tailwindcss": "^3.7.6",
46
47
  "eslint-plugin-format": "1.0.1",
47
48
  "eslint-plugin-jsx-a11y": "^6.10.2",
48
49
  "eslint-plugin-react-hooks": "^5.2.0",
@@ -51,7 +52,7 @@
51
52
  "eslint-plugin-vuejs-accessibility": "^2.4.1"
52
53
  },
53
54
  "optionalDependencies": {
54
- "@unocss/eslint-plugin": "66.4.2",
55
+ "@unocss/eslint-plugin": "66.5.0",
55
56
  "eslint-plugin-mdx": "3.6.2"
56
57
  },
57
58
  "publishConfig": {