@cuiqg/eslint-config 2.8.0 → 2.8.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.
Files changed (2) hide show
  1. package/dist/index.mjs +13 -47
  2. package/package.json +2 -6
package/dist/index.mjs CHANGED
@@ -363,50 +363,14 @@ async function vue() {
363
363
  }
364
364
 
365
365
  //#endregion
366
- //#region src/configs/compat.js
367
- async function compat() {
368
- const pluginCompat = await interopDefault(import("eslint-plugin-compat"));
366
+ //#region src/configs/tailwindcss.js
367
+ async function tailwindcss() {
368
+ const pluginTailwindcss = await interopDefault(import("eslint-plugin-tailwindcss"));
369
369
  return [{
370
- name: "cuiqg/compat",
371
- plugins: { compat: pluginCompat },
372
- rules: { ...pluginCompat.configs.recommended.rules }
373
- }];
374
- }
375
-
376
- //#endregion
377
- //#region src/configs/unicorn.js
378
- async function unicorn() {
379
- const pluginUnicorn = await interopDefault(import("eslint-plugin-unicorn"));
380
- return [{
381
- name: "cuiqg/unicorn",
382
- plugins: { unicorn: pluginUnicorn },
383
- rules: { ...pluginUnicorn.configs?.recommended?.rules }
384
- }];
385
- }
386
-
387
- //#endregion
388
- //#region src/configs/promise.js
389
- async function promise() {
390
- return [{
391
- ...(await interopDefault(import("eslint-plugin-promise"))).configs["flat/recommended"],
392
- name: "cuiqg/promise"
393
- }];
394
- }
395
-
396
- //#endregion
397
- //#region src/configs/imports.js
398
- async function imports() {
399
- return [{
400
- name: "cuiqg/imports",
401
- plugins: { import: await interopDefault(import("eslint-plugin-import-lite")) },
402
- rules: {
403
- "import/consistent-type-specifier-style": ["error", "top-level"],
404
- "import/first": "error",
405
- "import/no-duplicates": "error",
406
- "import/no-mutable-exports": "error",
407
- "import/no-named-default": "error",
408
- "import/newline-after-import": ["error", { count: 1 }]
409
- }
370
+ name: "cuiqg/tailwindcss",
371
+ plugins: { tailwindcss: pluginTailwindcss },
372
+ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
373
+ rules: { ...pluginTailwindcss.configs["flat/recommended"][1].rules }
410
374
  }];
411
375
  }
412
376
 
@@ -427,7 +391,8 @@ const hasVue = () => [
427
391
  "@slidev/cli"
428
392
  ].some((i) => isPackageExists(i));
429
393
  const hasTypeScript = () => isPackageExists("typescript");
430
- const hasUnoCss = () => isPackageExists("unocss");
394
+ const hasUnocss = () => isPackageExists("unocss");
395
+ const hasTailwindcss = () => isPackageExists("tailwindcss");
431
396
 
432
397
  //#endregion
433
398
  //#region src/presets.js
@@ -442,11 +407,12 @@ const defaultPluginRenaming = {
442
407
  * @returns {Promise<any[]>} 合并后的配置
443
408
  */
444
409
  function cuiqg(options = {}, ...userConfigs) {
445
- const { prettier: enablePrettier = false, unocss: enableUnocss = hasUnoCss(), vue: enableVue = hasVue() } = options;
410
+ const { prettier: enablePrettier = false, unocss: enableUnocss = hasUnocss(), tailwindcss: enableTailwindcss = hasTailwindcss(), vue: enableVue = hasVue() } = options;
446
411
  const configs = [];
447
- configs.push(compat(), ignores(), javascript(), imports(), jsdoc(), stylistic(), packageJson(), unicorn(), promise());
412
+ configs.push(ignores(), javascript(), jsdoc(), stylistic(), packageJson());
448
413
  if (enableVue) configs.push(vue(), macros());
449
414
  if (enableUnocss) configs.push(unocss());
415
+ if (enableTailwindcss) configs.push(tailwindcss());
450
416
  if (enablePrettier) configs.push(prettier());
451
417
  let composer = new FlatConfigComposer();
452
418
  composer = composer.append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
@@ -458,4 +424,4 @@ function cuiqg(options = {}, ...userConfigs) {
458
424
  var src_default = cuiqg;
459
425
 
460
426
  //#endregion
461
- export { GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_STYLUS, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, compat, cuiqg, src_default as default, defaultPluginRenaming, hasTypeScript, hasUnoCss, hasVue, ignores, imports, isInEditor, isInGitHookOrLintStaged, javascript, jsdoc, macros, packageJson, prettier, promise, stylistic, unicorn, unocss, vue };
427
+ export { GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_STYLUS, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, cuiqg, src_default as default, defaultPluginRenaming, hasTailwindcss, hasTypeScript, hasUnocss, hasVue, ignores, isInEditor, isInGitHookOrLintStaged, javascript, jsdoc, macros, packageJson, prettier, stylistic, tailwindcss, unocss, vue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuiqg/eslint-config",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Eslint config for @cuiqg",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -42,14 +42,10 @@
42
42
  "eslint-config-flat-gitignore": "^2.1.0",
43
43
  "eslint-config-prettier": "^10.1.8",
44
44
  "eslint-flat-config-utils": "^2.1.4",
45
- "eslint-plugin-compat": "^6.0.2",
46
- "eslint-plugin-import-lite": "^0.3.0",
47
45
  "eslint-plugin-jsdoc": "^61.4.1",
48
46
  "eslint-plugin-package-json": "^0.85.0",
49
- "eslint-plugin-perfectionist": "^4.15.1",
50
47
  "eslint-plugin-prettier": "^5.5.4",
51
- "eslint-plugin-promise": "^7.2.1",
52
- "eslint-plugin-unicorn": "^62.0.0",
48
+ "eslint-plugin-tailwindcss": "4.0.0-beta.0",
53
49
  "eslint-plugin-vue": "^10.6.2",
54
50
  "globals": "^16.5.0",
55
51
  "jsonc-eslint-parser": "^2.4.1",