@pengzhanbo/eslint-config 1.2.1 → 1.2.2
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 +68 -12
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +67 -12
- package/package.json +7 -2
package/dist/index.cjs
CHANGED
|
@@ -78,6 +78,7 @@ __export(src_exports, {
|
|
|
78
78
|
sortPackageJson: () => sortPackageJson,
|
|
79
79
|
sortTsconfig: () => sortTsconfig,
|
|
80
80
|
stylistic: () => stylistic,
|
|
81
|
+
tailwindcss: () => tailwindcss,
|
|
81
82
|
test: () => test,
|
|
82
83
|
toArray: () => toArray,
|
|
83
84
|
typescript: () => typescript,
|
|
@@ -1236,8 +1237,8 @@ async function unocss(options = {}) {
|
|
|
1236
1237
|
} = options;
|
|
1237
1238
|
const unInstalled = unocssPackages.filter((i) => !(0, import_local_pkg.isPackageExists)(i));
|
|
1238
1239
|
if (unInstalled.length > 0) {
|
|
1239
|
-
|
|
1240
|
-
|
|
1240
|
+
console.warn(`${unInstalled.join(", ")} is not installed, please install it first.
|
|
1241
|
+
Run \`npm install -D ${unInstalled.join(" ")}\``);
|
|
1241
1242
|
return [];
|
|
1242
1243
|
}
|
|
1243
1244
|
const [
|
|
@@ -1264,6 +1265,55 @@ async function unocss(options = {}) {
|
|
|
1264
1265
|
];
|
|
1265
1266
|
}
|
|
1266
1267
|
|
|
1268
|
+
// src/configs/tailwindcss.ts
|
|
1269
|
+
var import_local_pkg2 = require("local-pkg");
|
|
1270
|
+
var tailwindPackages = ["eslint-plugin-tailwindcss"];
|
|
1271
|
+
async function tailwindcss(options = {}) {
|
|
1272
|
+
const { whitelist, cssFiles: cssFilesFilter, customClassNames = true } = options;
|
|
1273
|
+
const unInstalled = tailwindPackages.filter((i) => !(0, import_local_pkg2.isPackageExists)(i));
|
|
1274
|
+
if (unInstalled.length > 0) {
|
|
1275
|
+
console.warn(`${unInstalled.join(", ")} is not installed, please install it first.
|
|
1276
|
+
Run \`npm install -D ${unInstalled.join(" ")}\``);
|
|
1277
|
+
return [];
|
|
1278
|
+
}
|
|
1279
|
+
const [
|
|
1280
|
+
pluginTailwindcss
|
|
1281
|
+
] = await Promise.all([
|
|
1282
|
+
interopDefault(import("eslint-plugin-tailwindcss"))
|
|
1283
|
+
]);
|
|
1284
|
+
const cssFiles = cssFilesFilter ? [.../* @__PURE__ */ new Set([
|
|
1285
|
+
"**/*.css",
|
|
1286
|
+
"!**/node_modules",
|
|
1287
|
+
"!**/.*",
|
|
1288
|
+
"!**/dist",
|
|
1289
|
+
"!**/build",
|
|
1290
|
+
...cssFilesFilter
|
|
1291
|
+
])] : void 0;
|
|
1292
|
+
return [
|
|
1293
|
+
{
|
|
1294
|
+
name: "config:tailwindcss:setup",
|
|
1295
|
+
plugins: {
|
|
1296
|
+
tailwindcss: pluginTailwindcss
|
|
1297
|
+
},
|
|
1298
|
+
settings: {
|
|
1299
|
+
tailwindcss: {
|
|
1300
|
+
cssFiles,
|
|
1301
|
+
whitelist
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
name: "config:tailwindcss:rules",
|
|
1307
|
+
rules: {
|
|
1308
|
+
...pluginTailwindcss.configs.recommended.rules,
|
|
1309
|
+
...customClassNames ? {
|
|
1310
|
+
"tailwindcss/no-custom-classname": "off"
|
|
1311
|
+
} : {}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
];
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1267
1317
|
// src/preset.ts
|
|
1268
1318
|
var defaultPreset = (options) => {
|
|
1269
1319
|
const {
|
|
@@ -1337,20 +1387,22 @@ var defaultPreset = (options) => {
|
|
|
1337
1387
|
stylistic: stylisticOptions
|
|
1338
1388
|
}));
|
|
1339
1389
|
}
|
|
1390
|
+
if (options.unocss)
|
|
1391
|
+
configs.push(unocss(options.unocss === true ? {} : options.unocss));
|
|
1392
|
+
if (options.tailwindcss)
|
|
1393
|
+
configs.push(tailwindcss(options.tailwindcss === true ? {} : options.tailwindcss));
|
|
1340
1394
|
if (options.markdown) {
|
|
1341
1395
|
configs.push(markdown({
|
|
1342
1396
|
componentExts,
|
|
1343
1397
|
overrides: overrides.markdown
|
|
1344
1398
|
}));
|
|
1345
1399
|
}
|
|
1346
|
-
if (options.unocss)
|
|
1347
|
-
configs.push(unocss(options.unocss === true ? {} : options.unocss));
|
|
1348
1400
|
return configs;
|
|
1349
1401
|
};
|
|
1350
1402
|
|
|
1351
1403
|
// src/resolvedOptions.ts
|
|
1352
1404
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
1353
|
-
var
|
|
1405
|
+
var import_local_pkg3 = require("local-pkg");
|
|
1354
1406
|
var VuePackages = [
|
|
1355
1407
|
"vue",
|
|
1356
1408
|
"nuxt",
|
|
@@ -1364,23 +1416,25 @@ function resolveOptions(options = {}) {
|
|
|
1364
1416
|
gitignore = true,
|
|
1365
1417
|
isInEditor = !!((import_node_process2.default.env.VSCODE_PID || import_node_process2.default.env.JETBRAINS_IDE) && !import_node_process2.default.env.CI),
|
|
1366
1418
|
overrides = {},
|
|
1367
|
-
typescript: typescript2 = (0,
|
|
1419
|
+
typescript: typescript2 = (0, import_local_pkg3.isPackageExists)("typescript"),
|
|
1368
1420
|
jsx = true,
|
|
1369
1421
|
test: test2 = true,
|
|
1370
1422
|
jsonc: jsonc2 = true,
|
|
1371
1423
|
yaml: yaml2 = true,
|
|
1372
1424
|
markdown: markdown2 = true,
|
|
1373
|
-
unocss: enableUnocss = false
|
|
1425
|
+
unocss: enableUnocss = false,
|
|
1426
|
+
tailwindcss: enableTailwindcss = false
|
|
1374
1427
|
} = options;
|
|
1375
1428
|
const stylistic2 = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
1376
1429
|
if (stylistic2 && !("jsx" in stylistic2))
|
|
1377
1430
|
stylistic2.jsx = options.jsx ?? true;
|
|
1378
|
-
const unocss2 = enableUnocss === false ? false : typeof
|
|
1379
|
-
|
|
1431
|
+
const unocss2 = enableUnocss === false ? false : typeof enableUnocss === "object" ? enableUnocss : {};
|
|
1432
|
+
const tailwindcss2 = enableTailwindcss === false ? false : typeof enableTailwindcss === "object" ? enableTailwindcss : {};
|
|
1433
|
+
if (VuePackages.some((i) => (0, import_local_pkg3.isPackageExists)(i)))
|
|
1380
1434
|
componentExts.push("vue");
|
|
1381
|
-
if ((0,
|
|
1435
|
+
if ((0, import_local_pkg3.isPackageExists)("astro"))
|
|
1382
1436
|
componentExts.push("astro");
|
|
1383
|
-
if ((0,
|
|
1437
|
+
if ((0, import_local_pkg3.isPackageExists)("svelte"))
|
|
1384
1438
|
componentExts.push("svelte");
|
|
1385
1439
|
return {
|
|
1386
1440
|
...options,
|
|
@@ -1396,7 +1450,8 @@ function resolveOptions(options = {}) {
|
|
|
1396
1450
|
jsonc: jsonc2,
|
|
1397
1451
|
yaml: yaml2,
|
|
1398
1452
|
markdown: markdown2,
|
|
1399
|
-
unocss: unocss2
|
|
1453
|
+
unocss: unocss2,
|
|
1454
|
+
tailwindcss: tailwindcss2
|
|
1400
1455
|
};
|
|
1401
1456
|
}
|
|
1402
1457
|
|
|
@@ -1491,6 +1546,7 @@ var src_default = eslintFlatConfig;
|
|
|
1491
1546
|
sortPackageJson,
|
|
1492
1547
|
sortTsconfig,
|
|
1493
1548
|
stylistic,
|
|
1549
|
+
tailwindcss,
|
|
1494
1550
|
test,
|
|
1495
1551
|
toArray,
|
|
1496
1552
|
typescript,
|
package/dist/index.d.cts
CHANGED
|
@@ -92,6 +92,26 @@ interface OptionsUnoCSS {
|
|
|
92
92
|
*/
|
|
93
93
|
strict?: boolean;
|
|
94
94
|
}
|
|
95
|
+
interface OptionsTailwindCSS {
|
|
96
|
+
/**
|
|
97
|
+
* Read CSS files
|
|
98
|
+
*/
|
|
99
|
+
cssFiles?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* List of whitelisted classes. when `no-custom-classname` is enabled,
|
|
102
|
+
* only allow classnames from Tailwind CSS and the values from the whitelist option.
|
|
103
|
+
* @default []
|
|
104
|
+
*/
|
|
105
|
+
whitelist?: string[];
|
|
106
|
+
/**
|
|
107
|
+
* Enable custom class names.
|
|
108
|
+
*
|
|
109
|
+
* If it is false, only allow classnames from Tailwind CSS and the values
|
|
110
|
+
* from the `whitelist` option
|
|
111
|
+
* @default true
|
|
112
|
+
*/
|
|
113
|
+
customClassNames?: boolean;
|
|
114
|
+
}
|
|
95
115
|
type PresetItem = (options: Required<Omit<OptionsConfig, 'preset'>> & {
|
|
96
116
|
stylistic: false | StylisticConfig;
|
|
97
117
|
}) => Awaitable<FlatConfigItem[]>[];
|
|
@@ -168,6 +188,13 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
168
188
|
* @default false
|
|
169
189
|
*/
|
|
170
190
|
unocss?: boolean | OptionsUnoCSS;
|
|
191
|
+
/**
|
|
192
|
+
* Enable TailwindCSS rules.
|
|
193
|
+
*
|
|
194
|
+
* Requires installing:
|
|
195
|
+
* - `eslint-plugin-tailwindcss`
|
|
196
|
+
*/
|
|
197
|
+
tailwindcss?: boolean | OptionsTailwindCSS;
|
|
171
198
|
/**
|
|
172
199
|
* Control to disable some rules in editors.
|
|
173
200
|
* @default auto-detect based on the process.env
|
|
@@ -279,6 +306,8 @@ declare function perfectionist(): Promise<FlatConfigItem[]>;
|
|
|
279
306
|
|
|
280
307
|
declare function unocss(options?: OptionsUnoCSS): Promise<FlatConfigItem[]>;
|
|
281
308
|
|
|
309
|
+
declare function tailwindcss(options?: OptionsTailwindCSS): Promise<FlatConfigItem[]>;
|
|
310
|
+
|
|
282
311
|
declare const defaultPreset: PresetItem;
|
|
283
312
|
|
|
284
|
-
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, unocss, yaml };
|
|
313
|
+
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, typescript, unicorn, unocss, yaml };
|
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,26 @@ interface OptionsUnoCSS {
|
|
|
92
92
|
*/
|
|
93
93
|
strict?: boolean;
|
|
94
94
|
}
|
|
95
|
+
interface OptionsTailwindCSS {
|
|
96
|
+
/**
|
|
97
|
+
* Read CSS files
|
|
98
|
+
*/
|
|
99
|
+
cssFiles?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* List of whitelisted classes. when `no-custom-classname` is enabled,
|
|
102
|
+
* only allow classnames from Tailwind CSS and the values from the whitelist option.
|
|
103
|
+
* @default []
|
|
104
|
+
*/
|
|
105
|
+
whitelist?: string[];
|
|
106
|
+
/**
|
|
107
|
+
* Enable custom class names.
|
|
108
|
+
*
|
|
109
|
+
* If it is false, only allow classnames from Tailwind CSS and the values
|
|
110
|
+
* from the `whitelist` option
|
|
111
|
+
* @default true
|
|
112
|
+
*/
|
|
113
|
+
customClassNames?: boolean;
|
|
114
|
+
}
|
|
95
115
|
type PresetItem = (options: Required<Omit<OptionsConfig, 'preset'>> & {
|
|
96
116
|
stylistic: false | StylisticConfig;
|
|
97
117
|
}) => Awaitable<FlatConfigItem[]>[];
|
|
@@ -168,6 +188,13 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
168
188
|
* @default false
|
|
169
189
|
*/
|
|
170
190
|
unocss?: boolean | OptionsUnoCSS;
|
|
191
|
+
/**
|
|
192
|
+
* Enable TailwindCSS rules.
|
|
193
|
+
*
|
|
194
|
+
* Requires installing:
|
|
195
|
+
* - `eslint-plugin-tailwindcss`
|
|
196
|
+
*/
|
|
197
|
+
tailwindcss?: boolean | OptionsTailwindCSS;
|
|
171
198
|
/**
|
|
172
199
|
* Control to disable some rules in editors.
|
|
173
200
|
* @default auto-detect based on the process.env
|
|
@@ -279,6 +306,8 @@ declare function perfectionist(): Promise<FlatConfigItem[]>;
|
|
|
279
306
|
|
|
280
307
|
declare function unocss(options?: OptionsUnoCSS): Promise<FlatConfigItem[]>;
|
|
281
308
|
|
|
309
|
+
declare function tailwindcss(options?: OptionsTailwindCSS): Promise<FlatConfigItem[]>;
|
|
310
|
+
|
|
282
311
|
declare const defaultPreset: PresetItem;
|
|
283
312
|
|
|
284
|
-
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, test, toArray, typescript, unicorn, unocss, yaml };
|
|
313
|
+
export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, renameRules, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, typescript, unicorn, unocss, yaml };
|
package/dist/index.js
CHANGED
|
@@ -1147,8 +1147,8 @@ async function unocss(options = {}) {
|
|
|
1147
1147
|
} = options;
|
|
1148
1148
|
const unInstalled = unocssPackages.filter((i) => !isPackageExists(i));
|
|
1149
1149
|
if (unInstalled.length > 0) {
|
|
1150
|
-
|
|
1151
|
-
|
|
1150
|
+
console.warn(`${unInstalled.join(", ")} is not installed, please install it first.
|
|
1151
|
+
Run \`npm install -D ${unInstalled.join(" ")}\``);
|
|
1152
1152
|
return [];
|
|
1153
1153
|
}
|
|
1154
1154
|
const [
|
|
@@ -1175,6 +1175,55 @@ async function unocss(options = {}) {
|
|
|
1175
1175
|
];
|
|
1176
1176
|
}
|
|
1177
1177
|
|
|
1178
|
+
// src/configs/tailwindcss.ts
|
|
1179
|
+
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
1180
|
+
var tailwindPackages = ["eslint-plugin-tailwindcss"];
|
|
1181
|
+
async function tailwindcss(options = {}) {
|
|
1182
|
+
const { whitelist, cssFiles: cssFilesFilter, customClassNames = true } = options;
|
|
1183
|
+
const unInstalled = tailwindPackages.filter((i) => !isPackageExists2(i));
|
|
1184
|
+
if (unInstalled.length > 0) {
|
|
1185
|
+
console.warn(`${unInstalled.join(", ")} is not installed, please install it first.
|
|
1186
|
+
Run \`npm install -D ${unInstalled.join(" ")}\``);
|
|
1187
|
+
return [];
|
|
1188
|
+
}
|
|
1189
|
+
const [
|
|
1190
|
+
pluginTailwindcss
|
|
1191
|
+
] = await Promise.all([
|
|
1192
|
+
interopDefault(import("eslint-plugin-tailwindcss"))
|
|
1193
|
+
]);
|
|
1194
|
+
const cssFiles = cssFilesFilter ? [.../* @__PURE__ */ new Set([
|
|
1195
|
+
"**/*.css",
|
|
1196
|
+
"!**/node_modules",
|
|
1197
|
+
"!**/.*",
|
|
1198
|
+
"!**/dist",
|
|
1199
|
+
"!**/build",
|
|
1200
|
+
...cssFilesFilter
|
|
1201
|
+
])] : void 0;
|
|
1202
|
+
return [
|
|
1203
|
+
{
|
|
1204
|
+
name: "config:tailwindcss:setup",
|
|
1205
|
+
plugins: {
|
|
1206
|
+
tailwindcss: pluginTailwindcss
|
|
1207
|
+
},
|
|
1208
|
+
settings: {
|
|
1209
|
+
tailwindcss: {
|
|
1210
|
+
cssFiles,
|
|
1211
|
+
whitelist
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
name: "config:tailwindcss:rules",
|
|
1217
|
+
rules: {
|
|
1218
|
+
...pluginTailwindcss.configs.recommended.rules,
|
|
1219
|
+
...customClassNames ? {
|
|
1220
|
+
"tailwindcss/no-custom-classname": "off"
|
|
1221
|
+
} : {}
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
];
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1178
1227
|
// src/preset.ts
|
|
1179
1228
|
var defaultPreset = (options) => {
|
|
1180
1229
|
const {
|
|
@@ -1248,20 +1297,22 @@ var defaultPreset = (options) => {
|
|
|
1248
1297
|
stylistic: stylisticOptions
|
|
1249
1298
|
}));
|
|
1250
1299
|
}
|
|
1300
|
+
if (options.unocss)
|
|
1301
|
+
configs.push(unocss(options.unocss === true ? {} : options.unocss));
|
|
1302
|
+
if (options.tailwindcss)
|
|
1303
|
+
configs.push(tailwindcss(options.tailwindcss === true ? {} : options.tailwindcss));
|
|
1251
1304
|
if (options.markdown) {
|
|
1252
1305
|
configs.push(markdown({
|
|
1253
1306
|
componentExts,
|
|
1254
1307
|
overrides: overrides.markdown
|
|
1255
1308
|
}));
|
|
1256
1309
|
}
|
|
1257
|
-
if (options.unocss)
|
|
1258
|
-
configs.push(unocss(options.unocss === true ? {} : options.unocss));
|
|
1259
1310
|
return configs;
|
|
1260
1311
|
};
|
|
1261
1312
|
|
|
1262
1313
|
// src/resolvedOptions.ts
|
|
1263
1314
|
import process2 from "process";
|
|
1264
|
-
import { isPackageExists as
|
|
1315
|
+
import { isPackageExists as isPackageExists3 } from "local-pkg";
|
|
1265
1316
|
var VuePackages = [
|
|
1266
1317
|
"vue",
|
|
1267
1318
|
"nuxt",
|
|
@@ -1275,23 +1326,25 @@ function resolveOptions(options = {}) {
|
|
|
1275
1326
|
gitignore = true,
|
|
1276
1327
|
isInEditor = !!((process2.env.VSCODE_PID || process2.env.JETBRAINS_IDE) && !process2.env.CI),
|
|
1277
1328
|
overrides = {},
|
|
1278
|
-
typescript: typescript2 =
|
|
1329
|
+
typescript: typescript2 = isPackageExists3("typescript"),
|
|
1279
1330
|
jsx = true,
|
|
1280
1331
|
test: test2 = true,
|
|
1281
1332
|
jsonc: jsonc2 = true,
|
|
1282
1333
|
yaml: yaml2 = true,
|
|
1283
1334
|
markdown: markdown2 = true,
|
|
1284
|
-
unocss: enableUnocss = false
|
|
1335
|
+
unocss: enableUnocss = false,
|
|
1336
|
+
tailwindcss: enableTailwindcss = false
|
|
1285
1337
|
} = options;
|
|
1286
1338
|
const stylistic2 = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
1287
1339
|
if (stylistic2 && !("jsx" in stylistic2))
|
|
1288
1340
|
stylistic2.jsx = options.jsx ?? true;
|
|
1289
|
-
const unocss2 = enableUnocss === false ? false : typeof
|
|
1290
|
-
|
|
1341
|
+
const unocss2 = enableUnocss === false ? false : typeof enableUnocss === "object" ? enableUnocss : {};
|
|
1342
|
+
const tailwindcss2 = enableTailwindcss === false ? false : typeof enableTailwindcss === "object" ? enableTailwindcss : {};
|
|
1343
|
+
if (VuePackages.some((i) => isPackageExists3(i)))
|
|
1291
1344
|
componentExts.push("vue");
|
|
1292
|
-
if (
|
|
1345
|
+
if (isPackageExists3("astro"))
|
|
1293
1346
|
componentExts.push("astro");
|
|
1294
|
-
if (
|
|
1347
|
+
if (isPackageExists3("svelte"))
|
|
1295
1348
|
componentExts.push("svelte");
|
|
1296
1349
|
return {
|
|
1297
1350
|
...options,
|
|
@@ -1307,7 +1360,8 @@ function resolveOptions(options = {}) {
|
|
|
1307
1360
|
jsonc: jsonc2,
|
|
1308
1361
|
yaml: yaml2,
|
|
1309
1362
|
markdown: markdown2,
|
|
1310
|
-
unocss: unocss2
|
|
1363
|
+
unocss: unocss2,
|
|
1364
|
+
tailwindcss: tailwindcss2
|
|
1311
1365
|
};
|
|
1312
1366
|
}
|
|
1313
1367
|
|
|
@@ -1402,6 +1456,7 @@ export {
|
|
|
1402
1456
|
sortPackageJson,
|
|
1403
1457
|
sortTsconfig,
|
|
1404
1458
|
stylistic,
|
|
1459
|
+
tailwindcss,
|
|
1405
1460
|
test,
|
|
1406
1461
|
toArray,
|
|
1407
1462
|
typescript,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pengzhanbo/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"author": "pengzhanbo <q942450674@outlook.com> (https://github/pengzhanbo/)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/pengzhanbo/configs#readme",
|
|
@@ -33,11 +33,15 @@
|
|
|
33
33
|
],
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
36
|
-
"eslint": ">=8.40.0"
|
|
36
|
+
"eslint": ">=8.40.0",
|
|
37
|
+
"eslint-plugin-tailwindcss": ">=3.10.0"
|
|
37
38
|
},
|
|
38
39
|
"peerDependenciesMeta": {
|
|
39
40
|
"@unocss/eslint-plugin": {
|
|
40
41
|
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"eslint-plugin-tailwindcss": {
|
|
44
|
+
"optional": true
|
|
41
45
|
}
|
|
42
46
|
},
|
|
43
47
|
"dependencies": {
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
"@unocss/eslint-plugin": "^0.57.7",
|
|
73
77
|
"eslint": "^8.54.0",
|
|
74
78
|
"eslint-flat-config-viewer": "^0.1.3",
|
|
79
|
+
"eslint-plugin-tailwindcss": "^3.13.0",
|
|
75
80
|
"tsup": "^8.0.1"
|
|
76
81
|
},
|
|
77
82
|
"scripts": {
|