@dhzh/eslint-config 1.0.3 → 1.0.4
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/cli/index.cjs +2 -2
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -14
- package/package.json +2 -2
package/dist/cli/index.cjs
CHANGED
|
@@ -28,7 +28,7 @@ var import_ansis5 = __toESM(require("ansis"), 1);
|
|
|
28
28
|
var import_cac = require("cac");
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
|
-
var version = "1.0.
|
|
31
|
+
var version = "1.0.4";
|
|
32
32
|
var package_default = {
|
|
33
33
|
name: "@dhzh/eslint-config",
|
|
34
34
|
type: "module",
|
|
@@ -70,7 +70,7 @@ var package_default = {
|
|
|
70
70
|
node: "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
71
71
|
},
|
|
72
72
|
scripts: {
|
|
73
|
-
build: "tsup --clean --dts",
|
|
73
|
+
build: "pnpm run typegen && tsup --clean --dts",
|
|
74
74
|
"build:inspector": "pnpm run build && npx @eslint/config-inspector build",
|
|
75
75
|
dev: "pnpm run typegen && npx @eslint/config-inspector --config eslint.config.ts",
|
|
76
76
|
lint: "eslint",
|
package/dist/cli/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import c4 from "ansis";
|
|
|
4
4
|
import { cac } from "cac";
|
|
5
5
|
|
|
6
6
|
// package.json
|
|
7
|
-
var version = "1.0.
|
|
7
|
+
var version = "1.0.4";
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@dhzh/eslint-config",
|
|
10
10
|
type: "module",
|
|
@@ -46,7 +46,7 @@ var package_default = {
|
|
|
46
46
|
node: "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
47
47
|
},
|
|
48
48
|
scripts: {
|
|
49
|
-
build: "tsup --clean --dts",
|
|
49
|
+
build: "pnpm run typegen && tsup --clean --dts",
|
|
50
50
|
"build:inspector": "pnpm run build && npx @eslint/config-inspector build",
|
|
51
51
|
dev: "pnpm run typegen && npx @eslint/config-inspector --config eslint.config.ts",
|
|
52
52
|
lint: "eslint",
|
package/dist/index.cjs
CHANGED
|
@@ -1217,7 +1217,7 @@ function imports(options = {}) {
|
|
|
1217
1217
|
];
|
|
1218
1218
|
}
|
|
1219
1219
|
|
|
1220
|
-
// src/configs/
|
|
1220
|
+
// src/configs/format.ts
|
|
1221
1221
|
var import_eslint_plugin_format = __toESM(require("eslint-plugin-format"), 1);
|
|
1222
1222
|
|
|
1223
1223
|
// src/utils.ts
|
|
@@ -1247,13 +1247,13 @@ var parserPlain = {
|
|
|
1247
1247
|
})
|
|
1248
1248
|
};
|
|
1249
1249
|
|
|
1250
|
-
// src/configs/
|
|
1250
|
+
// src/configs/format.ts
|
|
1251
1251
|
var mergePrettierOptions = (options, overrides) => ({
|
|
1252
1252
|
...options,
|
|
1253
1253
|
...overrides,
|
|
1254
1254
|
plugins: [...overrides.plugins || []]
|
|
1255
1255
|
});
|
|
1256
|
-
function
|
|
1256
|
+
function format(options = {}) {
|
|
1257
1257
|
const {
|
|
1258
1258
|
enable = {
|
|
1259
1259
|
html: true,
|
|
@@ -1293,20 +1293,20 @@ function formatters(options = {}) {
|
|
|
1293
1293
|
xmlWhitespaceSensitivity: "ignore"
|
|
1294
1294
|
};
|
|
1295
1295
|
configs2.push({
|
|
1296
|
-
name: `${RULE_PREFIX}/
|
|
1296
|
+
name: `${RULE_PREFIX}/format`,
|
|
1297
1297
|
plugins: {
|
|
1298
|
-
|
|
1298
|
+
format: import_eslint_plugin_format.default
|
|
1299
1299
|
}
|
|
1300
1300
|
});
|
|
1301
1301
|
if (enable.html) {
|
|
1302
1302
|
configs2.push({
|
|
1303
|
-
name: `${RULE_PREFIX}/
|
|
1303
|
+
name: `${RULE_PREFIX}/format/html`,
|
|
1304
1304
|
files: [GLOB_HTML],
|
|
1305
1305
|
languageOptions: {
|
|
1306
1306
|
parser: parserPlain
|
|
1307
1307
|
},
|
|
1308
1308
|
rules: {
|
|
1309
|
-
"
|
|
1309
|
+
"format/prettier": [
|
|
1310
1310
|
"error",
|
|
1311
1311
|
mergePrettierOptions(prettierOptions, {
|
|
1312
1312
|
parser: "html"
|
|
@@ -1318,7 +1318,7 @@ function formatters(options = {}) {
|
|
|
1318
1318
|
if (enable.css) {
|
|
1319
1319
|
configs2.push(
|
|
1320
1320
|
{
|
|
1321
|
-
name: `${RULE_PREFIX}/
|
|
1321
|
+
name: `${RULE_PREFIX}/format/css`,
|
|
1322
1322
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1323
1323
|
languageOptions: {
|
|
1324
1324
|
parser: parserPlain
|
|
@@ -1333,7 +1333,7 @@ function formatters(options = {}) {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
},
|
|
1335
1335
|
{
|
|
1336
|
-
name: `${RULE_PREFIX}/
|
|
1336
|
+
name: `${RULE_PREFIX}/format/scss`,
|
|
1337
1337
|
files: [GLOB_SCSS],
|
|
1338
1338
|
languageOptions: {
|
|
1339
1339
|
parser: parserPlain
|
|
@@ -1348,7 +1348,7 @@ function formatters(options = {}) {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
},
|
|
1350
1350
|
{
|
|
1351
|
-
name: `${RULE_PREFIX}/
|
|
1351
|
+
name: `${RULE_PREFIX}/format/less`,
|
|
1352
1352
|
files: [GLOB_LESS],
|
|
1353
1353
|
languageOptions: {
|
|
1354
1354
|
parser: parserPlain
|
|
@@ -1366,7 +1366,7 @@ function formatters(options = {}) {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
if (enable.graphql) {
|
|
1368
1368
|
configs2.push({
|
|
1369
|
-
name: `${RULE_PREFIX}/
|
|
1369
|
+
name: `${RULE_PREFIX}/format/graphql`,
|
|
1370
1370
|
files: [GLOB_GRAPHQL],
|
|
1371
1371
|
languageOptions: {
|
|
1372
1372
|
parser: parserPlain
|
|
@@ -1383,7 +1383,7 @@ function formatters(options = {}) {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
if (enable.xml) {
|
|
1385
1385
|
configs2.push({
|
|
1386
|
-
name: `${RULE_PREFIX}/
|
|
1386
|
+
name: `${RULE_PREFIX}/format/xml`,
|
|
1387
1387
|
files: [GLOB_XML],
|
|
1388
1388
|
languageOptions: {
|
|
1389
1389
|
parser: parserPlain
|
|
@@ -1407,7 +1407,7 @@ function formatters(options = {}) {
|
|
|
1407
1407
|
}
|
|
1408
1408
|
if (enable.svg) {
|
|
1409
1409
|
configs2.push({
|
|
1410
|
-
name: `${RULE_PREFIX}/
|
|
1410
|
+
name: `${RULE_PREFIX}/format/svg`,
|
|
1411
1411
|
files: [GLOB_SVG],
|
|
1412
1412
|
languageOptions: {
|
|
1413
1413
|
parser: parserPlain
|
|
@@ -1732,7 +1732,7 @@ function defineConfig(options = {}) {
|
|
|
1732
1732
|
...json(configs2.json),
|
|
1733
1733
|
...unicorn(configs2.unicorn),
|
|
1734
1734
|
...imports(configs2.imports),
|
|
1735
|
-
...
|
|
1735
|
+
...format(configs2.format),
|
|
1736
1736
|
...tailwindcss(configs2.tailwindcss),
|
|
1737
1737
|
...unocss(configs2.unocss),
|
|
1738
1738
|
...yml(configs2.yml),
|
package/dist/index.d.cts
CHANGED
|
@@ -149,7 +149,7 @@ interface IUnicornConfigsOptions extends IConfigsOptions {
|
|
|
149
149
|
interface IImportsConfigsOptions extends IConfigsOptions {
|
|
150
150
|
closeOrder?: boolean;
|
|
151
151
|
}
|
|
152
|
-
interface
|
|
152
|
+
interface IFormatConfigsOptions {
|
|
153
153
|
enable?: false | {
|
|
154
154
|
html?: boolean;
|
|
155
155
|
css?: boolean;
|
|
@@ -194,7 +194,7 @@ interface Options {
|
|
|
194
194
|
json?: IJsonConfigsOptions;
|
|
195
195
|
unicorn?: IUnicornConfigsOptions;
|
|
196
196
|
imports?: IImportsConfigsOptions;
|
|
197
|
-
|
|
197
|
+
format?: IFormatConfigsOptions;
|
|
198
198
|
tailwindcss?: ITailwindcssConfigsOptions;
|
|
199
199
|
unocss?: IUnocssConfigsOptions;
|
|
200
200
|
yml?: IYmlConfigsOptions;
|
package/dist/index.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ interface IUnicornConfigsOptions extends IConfigsOptions {
|
|
|
149
149
|
interface IImportsConfigsOptions extends IConfigsOptions {
|
|
150
150
|
closeOrder?: boolean;
|
|
151
151
|
}
|
|
152
|
-
interface
|
|
152
|
+
interface IFormatConfigsOptions {
|
|
153
153
|
enable?: false | {
|
|
154
154
|
html?: boolean;
|
|
155
155
|
css?: boolean;
|
|
@@ -194,7 +194,7 @@ interface Options {
|
|
|
194
194
|
json?: IJsonConfigsOptions;
|
|
195
195
|
unicorn?: IUnicornConfigsOptions;
|
|
196
196
|
imports?: IImportsConfigsOptions;
|
|
197
|
-
|
|
197
|
+
format?: IFormatConfigsOptions;
|
|
198
198
|
tailwindcss?: ITailwindcssConfigsOptions;
|
|
199
199
|
unocss?: IUnocssConfigsOptions;
|
|
200
200
|
yml?: IYmlConfigsOptions;
|
package/dist/index.js
CHANGED
|
@@ -1181,7 +1181,7 @@ function imports(options = {}) {
|
|
|
1181
1181
|
];
|
|
1182
1182
|
}
|
|
1183
1183
|
|
|
1184
|
-
// src/configs/
|
|
1184
|
+
// src/configs/format.ts
|
|
1185
1185
|
import pluginFormat from "eslint-plugin-format";
|
|
1186
1186
|
|
|
1187
1187
|
// src/utils.ts
|
|
@@ -1211,13 +1211,13 @@ var parserPlain = {
|
|
|
1211
1211
|
})
|
|
1212
1212
|
};
|
|
1213
1213
|
|
|
1214
|
-
// src/configs/
|
|
1214
|
+
// src/configs/format.ts
|
|
1215
1215
|
var mergePrettierOptions = (options, overrides) => ({
|
|
1216
1216
|
...options,
|
|
1217
1217
|
...overrides,
|
|
1218
1218
|
plugins: [...overrides.plugins || []]
|
|
1219
1219
|
});
|
|
1220
|
-
function
|
|
1220
|
+
function format(options = {}) {
|
|
1221
1221
|
const {
|
|
1222
1222
|
enable = {
|
|
1223
1223
|
html: true,
|
|
@@ -1257,20 +1257,20 @@ function formatters(options = {}) {
|
|
|
1257
1257
|
xmlWhitespaceSensitivity: "ignore"
|
|
1258
1258
|
};
|
|
1259
1259
|
configs2.push({
|
|
1260
|
-
name: `${RULE_PREFIX}/
|
|
1260
|
+
name: `${RULE_PREFIX}/format`,
|
|
1261
1261
|
plugins: {
|
|
1262
|
-
|
|
1262
|
+
format: pluginFormat
|
|
1263
1263
|
}
|
|
1264
1264
|
});
|
|
1265
1265
|
if (enable.html) {
|
|
1266
1266
|
configs2.push({
|
|
1267
|
-
name: `${RULE_PREFIX}/
|
|
1267
|
+
name: `${RULE_PREFIX}/format/html`,
|
|
1268
1268
|
files: [GLOB_HTML],
|
|
1269
1269
|
languageOptions: {
|
|
1270
1270
|
parser: parserPlain
|
|
1271
1271
|
},
|
|
1272
1272
|
rules: {
|
|
1273
|
-
"
|
|
1273
|
+
"format/prettier": [
|
|
1274
1274
|
"error",
|
|
1275
1275
|
mergePrettierOptions(prettierOptions, {
|
|
1276
1276
|
parser: "html"
|
|
@@ -1282,7 +1282,7 @@ function formatters(options = {}) {
|
|
|
1282
1282
|
if (enable.css) {
|
|
1283
1283
|
configs2.push(
|
|
1284
1284
|
{
|
|
1285
|
-
name: `${RULE_PREFIX}/
|
|
1285
|
+
name: `${RULE_PREFIX}/format/css`,
|
|
1286
1286
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1287
1287
|
languageOptions: {
|
|
1288
1288
|
parser: parserPlain
|
|
@@ -1297,7 +1297,7 @@ function formatters(options = {}) {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
},
|
|
1299
1299
|
{
|
|
1300
|
-
name: `${RULE_PREFIX}/
|
|
1300
|
+
name: `${RULE_PREFIX}/format/scss`,
|
|
1301
1301
|
files: [GLOB_SCSS],
|
|
1302
1302
|
languageOptions: {
|
|
1303
1303
|
parser: parserPlain
|
|
@@ -1312,7 +1312,7 @@ function formatters(options = {}) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
},
|
|
1314
1314
|
{
|
|
1315
|
-
name: `${RULE_PREFIX}/
|
|
1315
|
+
name: `${RULE_PREFIX}/format/less`,
|
|
1316
1316
|
files: [GLOB_LESS],
|
|
1317
1317
|
languageOptions: {
|
|
1318
1318
|
parser: parserPlain
|
|
@@ -1330,7 +1330,7 @@ function formatters(options = {}) {
|
|
|
1330
1330
|
}
|
|
1331
1331
|
if (enable.graphql) {
|
|
1332
1332
|
configs2.push({
|
|
1333
|
-
name: `${RULE_PREFIX}/
|
|
1333
|
+
name: `${RULE_PREFIX}/format/graphql`,
|
|
1334
1334
|
files: [GLOB_GRAPHQL],
|
|
1335
1335
|
languageOptions: {
|
|
1336
1336
|
parser: parserPlain
|
|
@@ -1347,7 +1347,7 @@ function formatters(options = {}) {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
if (enable.xml) {
|
|
1349
1349
|
configs2.push({
|
|
1350
|
-
name: `${RULE_PREFIX}/
|
|
1350
|
+
name: `${RULE_PREFIX}/format/xml`,
|
|
1351
1351
|
files: [GLOB_XML],
|
|
1352
1352
|
languageOptions: {
|
|
1353
1353
|
parser: parserPlain
|
|
@@ -1371,7 +1371,7 @@ function formatters(options = {}) {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
if (enable.svg) {
|
|
1373
1373
|
configs2.push({
|
|
1374
|
-
name: `${RULE_PREFIX}/
|
|
1374
|
+
name: `${RULE_PREFIX}/format/svg`,
|
|
1375
1375
|
files: [GLOB_SVG],
|
|
1376
1376
|
languageOptions: {
|
|
1377
1377
|
parser: parserPlain
|
|
@@ -1696,7 +1696,7 @@ function defineConfig(options = {}) {
|
|
|
1696
1696
|
...json(configs2.json),
|
|
1697
1697
|
...unicorn(configs2.unicorn),
|
|
1698
1698
|
...imports(configs2.imports),
|
|
1699
|
-
...
|
|
1699
|
+
...format(configs2.format),
|
|
1700
1700
|
...tailwindcss(configs2.tailwindcss),
|
|
1701
1701
|
...unocss(configs2.unocss),
|
|
1702
1702
|
...yml(configs2.yml),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhzh/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"description": "Lyle's ESLint config",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Lyle Zheng",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"*": "eslint --fix"
|
|
103
103
|
},
|
|
104
104
|
"scripts": {
|
|
105
|
-
"build": "tsup --clean --dts",
|
|
105
|
+
"build": "pnpm run typegen && tsup --clean --dts",
|
|
106
106
|
"build:inspector": "pnpm run build && npx @eslint/config-inspector build",
|
|
107
107
|
"dev": "pnpm run typegen && npx @eslint/config-inspector --config eslint.config.ts",
|
|
108
108
|
"lint": "eslint",
|