@debbl/eslint-config 2.1.2 → 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 +74 -7
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +73 -7
- 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,17 +1309,78 @@ 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
|
]);
|
|
1318
|
+
const PlainFileRules = [
|
|
1319
|
+
{
|
|
1320
|
+
name: "eslint:prettier:markdown",
|
|
1321
|
+
files: [GLOB_MARKDOWN],
|
|
1322
|
+
parser: "markdown"
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
name: "eslint:prettier:mdx",
|
|
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
|
+
}));
|
|
1313
1375
|
return [
|
|
1314
1376
|
{
|
|
1315
|
-
name: "eslint:prettier",
|
|
1377
|
+
name: "eslint:prettier:setup",
|
|
1316
1378
|
plugins: {
|
|
1317
1379
|
prettier: pluginPrettier
|
|
1318
|
-
}
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
{
|
|
1383
|
+
name: "eslint:prettier:rules",
|
|
1319
1384
|
rules: {
|
|
1320
1385
|
...configPrettier.rules,
|
|
1321
1386
|
...pluginPrettier.configs.recommended.rules,
|
|
@@ -1327,7 +1392,8 @@ async function prettier(options) {
|
|
|
1327
1392
|
}
|
|
1328
1393
|
]
|
|
1329
1394
|
}
|
|
1330
|
-
}
|
|
1395
|
+
},
|
|
1396
|
+
...PlainFileRules
|
|
1331
1397
|
];
|
|
1332
1398
|
}
|
|
1333
1399
|
|
|
@@ -1522,6 +1588,7 @@ var src_default = config;
|
|
|
1522
1588
|
GLOB_MARKDOWN,
|
|
1523
1589
|
GLOB_MARKDOWN_CODE,
|
|
1524
1590
|
GLOB_MDX,
|
|
1591
|
+
GLOB_POSTCSS,
|
|
1525
1592
|
GLOB_SCSS,
|
|
1526
1593
|
GLOB_SRC,
|
|
1527
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,17 +1230,78 @@ 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
|
]);
|
|
1239
|
+
const PlainFileRules = [
|
|
1240
|
+
{
|
|
1241
|
+
name: "eslint:prettier:markdown",
|
|
1242
|
+
files: [GLOB_MARKDOWN],
|
|
1243
|
+
parser: "markdown"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
name: "eslint:prettier:mdx",
|
|
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
|
+
}));
|
|
1235
1296
|
return [
|
|
1236
1297
|
{
|
|
1237
|
-
name: "eslint:prettier",
|
|
1298
|
+
name: "eslint:prettier:setup",
|
|
1238
1299
|
plugins: {
|
|
1239
1300
|
prettier: pluginPrettier
|
|
1240
|
-
}
|
|
1301
|
+
}
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
name: "eslint:prettier:rules",
|
|
1241
1305
|
rules: {
|
|
1242
1306
|
...configPrettier.rules,
|
|
1243
1307
|
...pluginPrettier.configs.recommended.rules,
|
|
@@ -1249,7 +1313,8 @@ async function prettier(options) {
|
|
|
1249
1313
|
}
|
|
1250
1314
|
]
|
|
1251
1315
|
}
|
|
1252
|
-
}
|
|
1316
|
+
},
|
|
1317
|
+
...PlainFileRules
|
|
1253
1318
|
];
|
|
1254
1319
|
}
|
|
1255
1320
|
|
|
@@ -1443,6 +1508,7 @@ export {
|
|
|
1443
1508
|
GLOB_MARKDOWN,
|
|
1444
1509
|
GLOB_MARKDOWN_CODE,
|
|
1445
1510
|
GLOB_MDX,
|
|
1511
|
+
GLOB_POSTCSS,
|
|
1446
1512
|
GLOB_SCSS,
|
|
1447
1513
|
GLOB_SRC,
|
|
1448
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",
|