@cuiqg/eslint-config 2.8.16 → 2.8.17
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 +21 -17
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -33,9 +33,7 @@ const GLOB_TS = `**/*.?([cm])ts`;
|
|
|
33
33
|
const GLOB_TSX = `**/*.?([cm])tsx`;
|
|
34
34
|
const GLOB_JS = `**/*.?([cm])js`;
|
|
35
35
|
const GLOB_JSX = `**/*.?([cm])jsx`;
|
|
36
|
-
const GLOB_STYLE = "**/*.{c,sc}ss";
|
|
37
36
|
const GLOB_CSS = "**/*.css";
|
|
38
|
-
const GLOB_SCSS = "**/*.scss";
|
|
39
37
|
const GLOB_VUE = "**/*.vue";
|
|
40
38
|
const GLOB_EXCLUDE = [
|
|
41
39
|
"**/node_modules",
|
|
@@ -83,7 +81,7 @@ const GLOB_EXCLUDE = [
|
|
|
83
81
|
async function ignores() {
|
|
84
82
|
const [pluginGitignore] = await Promise.all([interopDefault(import("eslint-config-flat-gitignore"))]);
|
|
85
83
|
return [{
|
|
86
|
-
ignores:
|
|
84
|
+
ignores: GLOB_EXCLUDE,
|
|
87
85
|
name: "cuiqg/ignores"
|
|
88
86
|
}, { ...pluginGitignore({
|
|
89
87
|
name: "cuiqg/ignores/gitignore",
|
|
@@ -259,12 +257,8 @@ async function stylistic(options = {}) {
|
|
|
259
257
|
async function unocss() {
|
|
260
258
|
const [pluginUnoCSS] = await Promise.all([interopDefault(import("@unocss/eslint-plugin"))]);
|
|
261
259
|
return [{
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
rules: {
|
|
265
|
-
"@unocss/order": "warn",
|
|
266
|
-
"@unocss/order-attributify": "warn"
|
|
267
|
-
}
|
|
260
|
+
...pluginUnoCSS.configs.flat,
|
|
261
|
+
name: "cuiqg/unocss"
|
|
268
262
|
}];
|
|
269
263
|
}
|
|
270
264
|
|
|
@@ -355,11 +349,7 @@ async function tailwindcss() {
|
|
|
355
349
|
//#endregion
|
|
356
350
|
//#region src/configs/typescript.js
|
|
357
351
|
async function typescript() {
|
|
358
|
-
const files = [
|
|
359
|
-
GLOB_TS,
|
|
360
|
-
GLOB_TSX,
|
|
361
|
-
GLOB_VUE
|
|
362
|
-
];
|
|
352
|
+
const files = [GLOB_TS, GLOB_TSX];
|
|
363
353
|
const [pluginTs, parserTs] = await Promise.all([interopDefault(import("@typescript-eslint/eslint-plugin")), interopDefault(import("@typescript-eslint/parser"))]);
|
|
364
354
|
return [{
|
|
365
355
|
files,
|
|
@@ -570,6 +560,18 @@ async function nextjs() {
|
|
|
570
560
|
}];
|
|
571
561
|
}
|
|
572
562
|
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region src/configs/css.js
|
|
565
|
+
async function css() {
|
|
566
|
+
const [pluginCSS] = await Promise.all([interopDefault(import("@eslint/css"))]);
|
|
567
|
+
return [{
|
|
568
|
+
name: "cuiqg/css",
|
|
569
|
+
files: [GLOB_CSS],
|
|
570
|
+
plugins: { css: pluginCSS },
|
|
571
|
+
rules: { ...pluginCSS.configs.recommended.rules }
|
|
572
|
+
}];
|
|
573
|
+
}
|
|
574
|
+
|
|
573
575
|
//#endregion
|
|
574
576
|
//#region src/env.js
|
|
575
577
|
const isInGitHookOrLintStaged = () => {
|
|
@@ -594,15 +596,17 @@ const hasUnocss = () => isPackageExists("unocss");
|
|
|
594
596
|
* @param {boolean} [options.typescript]
|
|
595
597
|
* @param {boolean} [options.vue]
|
|
596
598
|
* @param {boolean} [options.nextjs]
|
|
597
|
-
* @param
|
|
599
|
+
* @param {boolean} [options.css]
|
|
600
|
+
* @param {...object} userConfigs
|
|
598
601
|
* @returns {FlatConfigComposer} FlatConfigComposer
|
|
599
602
|
*/
|
|
600
603
|
function cuiqg(options = {}, ...userConfigs) {
|
|
601
|
-
const { jsdoc: enableJsdoc = true, unocss: enableUnocss = hasUnocss(), tailwindcss: enableTailwindcss = false, typescript: enableTypescript = false, vue: enableVue = hasVue(), nextjs: enableNextjs = false } = options;
|
|
604
|
+
const { jsdoc: enableJsdoc = true, unocss: enableUnocss = hasUnocss(), tailwindcss: enableTailwindcss = false, typescript: enableTypescript = false, vue: enableVue = hasVue(), nextjs: enableNextjs = false, css: enableCSS = false } = options;
|
|
602
605
|
const configs = [];
|
|
603
606
|
configs.push(autoImports(), baseline(), ignores(), javascript({ isInEditor }), stylistic(), packageJson());
|
|
604
607
|
if (enableTypescript) configs.push(typescript());
|
|
605
608
|
if (enableJsdoc) configs.push(jsdoc());
|
|
609
|
+
if (enableCSS) configs.push(css());
|
|
606
610
|
if (enableVue) configs.push(vue({ typescript: enableTypescript }), macros());
|
|
607
611
|
if (enableNextjs) configs.push(nextjs());
|
|
608
612
|
if (enableUnocss) configs.push(unocss());
|
|
@@ -615,4 +619,4 @@ function cuiqg(options = {}, ...userConfigs) {
|
|
|
615
619
|
var src_default = cuiqg;
|
|
616
620
|
|
|
617
621
|
//#endregion
|
|
618
|
-
export { GLOB_CSS, GLOB_EXCLUDE, GLOB_JS, GLOB_JSX,
|
|
622
|
+
export { GLOB_CSS, GLOB_EXCLUDE, GLOB_JS, GLOB_JSX, GLOB_SRC, GLOB_SRC_EXT, GLOB_TS, GLOB_TSX, GLOB_VUE, autoImports, baseline, css, cuiqg, src_default as default, hasUnocss, hasVue, ignores, isInEditor, isInGitHookOrLintStaged, javascript, jsdoc, macros, nextjs, packageJson, stylistic, stylisticConfigDefaults, tailwindcss, typescript, unocss, vue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuiqg/eslint-config",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.17",
|
|
4
4
|
"description": "Eslint config for @cuiqg",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint-config"
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"eslint": ">=9.28.0"
|
|
31
|
+
},
|
|
29
32
|
"devDependencies": {
|
|
30
33
|
"@eslint/config-inspector": "^1.4.2",
|
|
31
34
|
"@types/node": "^25.0.3",
|
|
@@ -35,10 +38,8 @@
|
|
|
35
38
|
"typescript": "^5.9.3",
|
|
36
39
|
"unrun": "^0.2.22"
|
|
37
40
|
},
|
|
38
|
-
"peerDependencies": {
|
|
39
|
-
"eslint": ">=9.28.0"
|
|
40
|
-
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@eslint/css": "^0.14.1",
|
|
42
43
|
"@eslint/js": "^9.39.2",
|
|
43
44
|
"@next/eslint-plugin-next": "^16.1.1",
|
|
44
45
|
"@stylistic/eslint-plugin": "^5.6.1",
|