@debbl/eslint-config 2.2.0 → 2.3.0
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 +73 -36
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +72 -36
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(src_exports, {
|
|
|
43
43
|
GLOB_MARKDOWN: () => GLOB_MARKDOWN,
|
|
44
44
|
GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
|
|
45
45
|
GLOB_MDX: () => GLOB_MDX,
|
|
46
|
+
GLOB_POSTCSS: () => GLOB_POSTCSS,
|
|
46
47
|
GLOB_SCSS: () => GLOB_SCSS,
|
|
47
48
|
GLOB_SRC: () => GLOB_SRC,
|
|
48
49
|
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
@@ -111,6 +112,7 @@ var GLOB_TS = "**/*.?([cm])ts";
|
|
|
111
112
|
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
112
113
|
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
113
114
|
var GLOB_CSS = "**/*.css";
|
|
115
|
+
var GLOB_POSTCSS = "**/*.{p,post}css";
|
|
114
116
|
var GLOB_LESS = "**/*.less";
|
|
115
117
|
var GLOB_SCSS = "**/*.scss";
|
|
116
118
|
var GLOB_JSON = "**/*.json";
|
|
@@ -589,8 +591,10 @@ async function jsonc() {
|
|
|
589
591
|
// src/configs/markdown.ts
|
|
590
592
|
async function markdown(options = {}) {
|
|
591
593
|
const { componentExts = [] } = options;
|
|
592
|
-
const pluginMdx = await
|
|
593
|
-
|
|
594
|
+
const [pluginMdx, parserMdx] = await Promise.all([
|
|
595
|
+
interopDefault(import("eslint-plugin-mdx")),
|
|
596
|
+
interopDefault(import("eslint-mdx"))
|
|
597
|
+
]);
|
|
594
598
|
return [
|
|
595
599
|
{
|
|
596
600
|
name: "eslint:markdown:setup",
|
|
@@ -1305,59 +1309,91 @@ async function perfectionist() {
|
|
|
1305
1309
|
|
|
1306
1310
|
// src/configs/prettier.ts
|
|
1307
1311
|
async function prettier(options) {
|
|
1308
|
-
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1312
|
+
const [pluginPrettier, configPrettier, parserPlain] = await Promise.all([
|
|
1309
1313
|
interopDefault(import("eslint-plugin-prettier")),
|
|
1310
1314
|
// @ts-expect-error missing types
|
|
1311
|
-
interopDefault(import("eslint-config-prettier"))
|
|
1315
|
+
interopDefault(import("eslint-config-prettier")),
|
|
1316
|
+
interopDefault(import("eslint-parser-plain"))
|
|
1312
1317
|
]);
|
|
1313
|
-
|
|
1314
|
-
{
|
|
1315
|
-
name: "eslint:prettier",
|
|
1316
|
-
plugins: {
|
|
1317
|
-
prettier: pluginPrettier
|
|
1318
|
-
},
|
|
1319
|
-
rules: {
|
|
1320
|
-
...configPrettier.rules,
|
|
1321
|
-
...pluginPrettier.configs.recommended.rules,
|
|
1322
|
-
"prettier/prettier": [
|
|
1323
|
-
"warn",
|
|
1324
|
-
{
|
|
1325
|
-
quoteProps: "consistent",
|
|
1326
|
-
...options
|
|
1327
|
-
}
|
|
1328
|
-
]
|
|
1329
|
-
}
|
|
1330
|
-
},
|
|
1318
|
+
const PlainFileRules = [
|
|
1331
1319
|
{
|
|
1332
1320
|
name: "eslint:prettier:markdown",
|
|
1333
1321
|
files: [GLOB_MARKDOWN],
|
|
1334
|
-
|
|
1335
|
-
prettier: pluginPrettier
|
|
1336
|
-
},
|
|
1337
|
-
rules: {
|
|
1338
|
-
"prettier/prettier": [
|
|
1339
|
-
"warn",
|
|
1340
|
-
{
|
|
1341
|
-
parser: "markdown"
|
|
1342
|
-
}
|
|
1343
|
-
]
|
|
1344
|
-
}
|
|
1322
|
+
parser: "markdown"
|
|
1345
1323
|
},
|
|
1346
1324
|
{
|
|
1347
1325
|
name: "eslint:prettier:mdx",
|
|
1348
1326
|
files: [GLOB_MDX],
|
|
1327
|
+
parser: "mdx"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
name: "eslint:prettier:html",
|
|
1331
|
+
files: ["**/*.html"],
|
|
1332
|
+
parser: "html"
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
name: "eslint:prettier:css",
|
|
1336
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1337
|
+
parser: "css"
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
name: "eslint:prettier:scss",
|
|
1341
|
+
files: [GLOB_SCSS],
|
|
1342
|
+
parser: "scss"
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
name: "eslint:prettier:less",
|
|
1346
|
+
files: [GLOB_LESS],
|
|
1347
|
+
parser: "less"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
name: "eslint:prettier:toml",
|
|
1351
|
+
files: ["**/*.toml"],
|
|
1352
|
+
parser: "toml"
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
name: "eslint:prettier:graphql",
|
|
1356
|
+
files: ["**/*.graphql"],
|
|
1357
|
+
parser: "graphql"
|
|
1358
|
+
}
|
|
1359
|
+
].map((rule) => ({
|
|
1360
|
+
name: rule.name,
|
|
1361
|
+
files: rule.files,
|
|
1362
|
+
languageOptions: {
|
|
1363
|
+
parser: parserPlain
|
|
1364
|
+
},
|
|
1365
|
+
rules: {
|
|
1366
|
+
"prettier/prettier": [
|
|
1367
|
+
"warn",
|
|
1368
|
+
{
|
|
1369
|
+
...options,
|
|
1370
|
+
parser: rule.parser
|
|
1371
|
+
}
|
|
1372
|
+
]
|
|
1373
|
+
}
|
|
1374
|
+
}));
|
|
1375
|
+
return [
|
|
1376
|
+
{
|
|
1377
|
+
name: "eslint:prettier:setup",
|
|
1349
1378
|
plugins: {
|
|
1350
1379
|
prettier: pluginPrettier
|
|
1351
|
-
}
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
name: "eslint:prettier:rules",
|
|
1352
1384
|
rules: {
|
|
1385
|
+
...configPrettier.rules,
|
|
1386
|
+
...pluginPrettier.configs.recommended.rules,
|
|
1353
1387
|
"prettier/prettier": [
|
|
1354
1388
|
"warn",
|
|
1355
1389
|
{
|
|
1356
|
-
|
|
1390
|
+
quoteProps: "consistent",
|
|
1391
|
+
...options
|
|
1357
1392
|
}
|
|
1358
1393
|
]
|
|
1359
1394
|
}
|
|
1360
|
-
}
|
|
1395
|
+
},
|
|
1396
|
+
...PlainFileRules
|
|
1361
1397
|
];
|
|
1362
1398
|
}
|
|
1363
1399
|
|
|
@@ -1552,6 +1588,7 @@ var src_default = config;
|
|
|
1552
1588
|
GLOB_MARKDOWN,
|
|
1553
1589
|
GLOB_MARKDOWN_CODE,
|
|
1554
1590
|
GLOB_MDX,
|
|
1591
|
+
GLOB_POSTCSS,
|
|
1555
1592
|
GLOB_SCSS,
|
|
1556
1593
|
GLOB_SRC,
|
|
1557
1594
|
GLOB_SRC_EXT,
|
package/dist/index.d.cts
CHANGED
|
@@ -187,6 +187,7 @@ declare const GLOB_TS = "**/*.?([cm])ts";
|
|
|
187
187
|
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
188
188
|
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
189
189
|
declare const GLOB_CSS = "**/*.css";
|
|
190
|
+
declare const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
190
191
|
declare const GLOB_LESS = "**/*.less";
|
|
191
192
|
declare const GLOB_SCSS = "**/*.scss";
|
|
192
193
|
declare const GLOB_JSON = "**/*.json";
|
|
@@ -202,4 +203,4 @@ declare const GLOB_TESTS: string[];
|
|
|
202
203
|
declare const GLOB_ALL_SRC: string[];
|
|
203
204
|
declare const GLOB_EXCLUDE: string[];
|
|
204
205
|
|
|
205
|
-
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
|
206
|
+
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -187,6 +187,7 @@ declare const GLOB_TS = "**/*.?([cm])ts";
|
|
|
187
187
|
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
188
188
|
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
189
189
|
declare const GLOB_CSS = "**/*.css";
|
|
190
|
+
declare const GLOB_POSTCSS = "**/*.{p,post}css";
|
|
190
191
|
declare const GLOB_LESS = "**/*.less";
|
|
191
192
|
declare const GLOB_SCSS = "**/*.scss";
|
|
192
193
|
declare const GLOB_JSON = "**/*.json";
|
|
@@ -202,4 +203,4 @@ declare const GLOB_TESTS: string[];
|
|
|
202
203
|
declare const GLOB_ALL_SRC: string[];
|
|
203
204
|
declare const GLOB_EXCLUDE: string[];
|
|
204
205
|
|
|
205
|
-
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
|
206
|
+
export { type Awaitable, type ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MDX, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierRequiredOptions, type ReactOptions, combine, comments, config, config as default, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, perfectionist, prettier, sortPackageJson, sortTsconfig, test, typescript, unicorn, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var GLOB_TS = "**/*.?([cm])ts";
|
|
|
33
33
|
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
34
34
|
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
35
35
|
var GLOB_CSS = "**/*.css";
|
|
36
|
+
var GLOB_POSTCSS = "**/*.{p,post}css";
|
|
36
37
|
var GLOB_LESS = "**/*.less";
|
|
37
38
|
var GLOB_SCSS = "**/*.scss";
|
|
38
39
|
var GLOB_JSON = "**/*.json";
|
|
@@ -511,8 +512,10 @@ async function jsonc() {
|
|
|
511
512
|
// src/configs/markdown.ts
|
|
512
513
|
async function markdown(options = {}) {
|
|
513
514
|
const { componentExts = [] } = options;
|
|
514
|
-
const pluginMdx = await
|
|
515
|
-
|
|
515
|
+
const [pluginMdx, parserMdx] = await Promise.all([
|
|
516
|
+
interopDefault(import("eslint-plugin-mdx")),
|
|
517
|
+
interopDefault(import("eslint-mdx"))
|
|
518
|
+
]);
|
|
516
519
|
return [
|
|
517
520
|
{
|
|
518
521
|
name: "eslint:markdown:setup",
|
|
@@ -1227,59 +1230,91 @@ async function perfectionist() {
|
|
|
1227
1230
|
|
|
1228
1231
|
// src/configs/prettier.ts
|
|
1229
1232
|
async function prettier(options) {
|
|
1230
|
-
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
1233
|
+
const [pluginPrettier, configPrettier, parserPlain] = await Promise.all([
|
|
1231
1234
|
interopDefault(import("eslint-plugin-prettier")),
|
|
1232
1235
|
// @ts-expect-error missing types
|
|
1233
|
-
interopDefault(import("eslint-config-prettier"))
|
|
1236
|
+
interopDefault(import("eslint-config-prettier")),
|
|
1237
|
+
interopDefault(import("eslint-parser-plain"))
|
|
1234
1238
|
]);
|
|
1235
|
-
|
|
1236
|
-
{
|
|
1237
|
-
name: "eslint:prettier",
|
|
1238
|
-
plugins: {
|
|
1239
|
-
prettier: pluginPrettier
|
|
1240
|
-
},
|
|
1241
|
-
rules: {
|
|
1242
|
-
...configPrettier.rules,
|
|
1243
|
-
...pluginPrettier.configs.recommended.rules,
|
|
1244
|
-
"prettier/prettier": [
|
|
1245
|
-
"warn",
|
|
1246
|
-
{
|
|
1247
|
-
quoteProps: "consistent",
|
|
1248
|
-
...options
|
|
1249
|
-
}
|
|
1250
|
-
]
|
|
1251
|
-
}
|
|
1252
|
-
},
|
|
1239
|
+
const PlainFileRules = [
|
|
1253
1240
|
{
|
|
1254
1241
|
name: "eslint:prettier:markdown",
|
|
1255
1242
|
files: [GLOB_MARKDOWN],
|
|
1256
|
-
|
|
1257
|
-
prettier: pluginPrettier
|
|
1258
|
-
},
|
|
1259
|
-
rules: {
|
|
1260
|
-
"prettier/prettier": [
|
|
1261
|
-
"warn",
|
|
1262
|
-
{
|
|
1263
|
-
parser: "markdown"
|
|
1264
|
-
}
|
|
1265
|
-
]
|
|
1266
|
-
}
|
|
1243
|
+
parser: "markdown"
|
|
1267
1244
|
},
|
|
1268
1245
|
{
|
|
1269
1246
|
name: "eslint:prettier:mdx",
|
|
1270
1247
|
files: [GLOB_MDX],
|
|
1248
|
+
parser: "mdx"
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
name: "eslint:prettier:html",
|
|
1252
|
+
files: ["**/*.html"],
|
|
1253
|
+
parser: "html"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
name: "eslint:prettier:css",
|
|
1257
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
1258
|
+
parser: "css"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
name: "eslint:prettier:scss",
|
|
1262
|
+
files: [GLOB_SCSS],
|
|
1263
|
+
parser: "scss"
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
name: "eslint:prettier:less",
|
|
1267
|
+
files: [GLOB_LESS],
|
|
1268
|
+
parser: "less"
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
name: "eslint:prettier:yaml",
|
|
1272
|
+
files: [GLOB_YAML],
|
|
1273
|
+
parser: "yaml"
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
name: "eslint:prettier:graphql",
|
|
1277
|
+
files: ["**/*.graphql"],
|
|
1278
|
+
parser: "graphql"
|
|
1279
|
+
}
|
|
1280
|
+
].map((rule) => ({
|
|
1281
|
+
name: rule.name,
|
|
1282
|
+
files: rule.files,
|
|
1283
|
+
languageOptions: {
|
|
1284
|
+
parser: parserPlain
|
|
1285
|
+
},
|
|
1286
|
+
rules: {
|
|
1287
|
+
"prettier/prettier": [
|
|
1288
|
+
"warn",
|
|
1289
|
+
{
|
|
1290
|
+
...options,
|
|
1291
|
+
parser: rule.parser
|
|
1292
|
+
}
|
|
1293
|
+
]
|
|
1294
|
+
}
|
|
1295
|
+
}));
|
|
1296
|
+
return [
|
|
1297
|
+
{
|
|
1298
|
+
name: "eslint:prettier:setup",
|
|
1271
1299
|
plugins: {
|
|
1272
1300
|
prettier: pluginPrettier
|
|
1273
|
-
}
|
|
1301
|
+
}
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
name: "eslint:prettier:rules",
|
|
1274
1305
|
rules: {
|
|
1306
|
+
...configPrettier.rules,
|
|
1307
|
+
...pluginPrettier.configs.recommended.rules,
|
|
1275
1308
|
"prettier/prettier": [
|
|
1276
1309
|
"warn",
|
|
1277
1310
|
{
|
|
1278
|
-
|
|
1311
|
+
quoteProps: "consistent",
|
|
1312
|
+
...options
|
|
1279
1313
|
}
|
|
1280
1314
|
]
|
|
1281
1315
|
}
|
|
1282
|
-
}
|
|
1316
|
+
},
|
|
1317
|
+
...PlainFileRules
|
|
1283
1318
|
];
|
|
1284
1319
|
}
|
|
1285
1320
|
|
|
@@ -1473,6 +1508,7 @@ export {
|
|
|
1473
1508
|
GLOB_MARKDOWN,
|
|
1474
1509
|
GLOB_MARKDOWN_CODE,
|
|
1475
1510
|
GLOB_MDX,
|
|
1511
|
+
GLOB_POSTCSS,
|
|
1476
1512
|
GLOB_SCSS,
|
|
1477
1513
|
GLOB_SRC,
|
|
1478
1514
|
GLOB_SRC_EXT,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"packageManager": "pnpm@8.11.0",
|
|
6
6
|
"description": "Brendan Dash's ESLint config",
|
|
7
7
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"eslint-config-prettier": "^9.1.0",
|
|
34
34
|
"eslint-define-config": "^2.0.0",
|
|
35
35
|
"eslint-mdx": "^2.2.0",
|
|
36
|
+
"eslint-parser-plain": "^0.1.0",
|
|
36
37
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
37
38
|
"eslint-plugin-i": "^2.29.0",
|
|
38
39
|
"eslint-plugin-jsdoc": "^46.9.0",
|