@cuiqg/eslint-config 2.7.3 → 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.
- package/dist/index.mjs +13 -39
- package/package.json +2 -6
package/dist/index.mjs
CHANGED
|
@@ -363,42 +363,14 @@ async function vue() {
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
//#endregion
|
|
366
|
-
//#region src/configs/
|
|
367
|
-
async function
|
|
368
|
-
const
|
|
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/
|
|
371
|
-
plugins: {
|
|
372
|
-
|
|
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
|
-
...(await interopDefault(import("eslint-plugin-import"))).flatConfigs.recommended,
|
|
401
|
-
name: "cuiqg/imports"
|
|
370
|
+
name: "cuiqg/tailwindcss",
|
|
371
|
+
plugins: { tailwindcss: pluginTailwindcss },
|
|
372
|
+
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
|
|
373
|
+
rules: { ...pluginTailwindcss.configs["flat/recommended"][1].rules }
|
|
402
374
|
}];
|
|
403
375
|
}
|
|
404
376
|
|
|
@@ -419,7 +391,8 @@ const hasVue = () => [
|
|
|
419
391
|
"@slidev/cli"
|
|
420
392
|
].some((i) => isPackageExists(i));
|
|
421
393
|
const hasTypeScript = () => isPackageExists("typescript");
|
|
422
|
-
const
|
|
394
|
+
const hasUnocss = () => isPackageExists("unocss");
|
|
395
|
+
const hasTailwindcss = () => isPackageExists("tailwindcss");
|
|
423
396
|
|
|
424
397
|
//#endregion
|
|
425
398
|
//#region src/presets.js
|
|
@@ -434,11 +407,12 @@ const defaultPluginRenaming = {
|
|
|
434
407
|
* @returns {Promise<any[]>} 合并后的配置
|
|
435
408
|
*/
|
|
436
409
|
function cuiqg(options = {}, ...userConfigs) {
|
|
437
|
-
const { prettier: enablePrettier = false, unocss: enableUnocss =
|
|
410
|
+
const { prettier: enablePrettier = false, unocss: enableUnocss = hasUnocss(), tailwindcss: enableTailwindcss = hasTailwindcss(), vue: enableVue = hasVue() } = options;
|
|
438
411
|
const configs = [];
|
|
439
|
-
configs.push(
|
|
412
|
+
configs.push(ignores(), javascript(), jsdoc(), stylistic(), packageJson());
|
|
440
413
|
if (enableVue) configs.push(vue(), macros());
|
|
441
414
|
if (enableUnocss) configs.push(unocss());
|
|
415
|
+
if (enableTailwindcss) configs.push(tailwindcss());
|
|
442
416
|
if (enablePrettier) configs.push(prettier());
|
|
443
417
|
let composer = new FlatConfigComposer();
|
|
444
418
|
composer = composer.append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
@@ -450,4 +424,4 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
450
424
|
var src_default = cuiqg;
|
|
451
425
|
|
|
452
426
|
//#endregion
|
|
453
|
-
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,
|
|
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.
|
|
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": "^2.32.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-
|
|
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",
|