@biscuittin/eslint-config 0.2.0 → 0.3.1
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.d.ts +13 -2
- package/dist/index.js +43 -29
- package/package.json +19 -19
- package/typegen.d.ts +14 -2
package/dist/index.d.ts
CHANGED
|
@@ -9088,6 +9088,8 @@ type AutofixOneVar = [] | [(("always" | "never" | "consecutive") | {
|
|
|
9088
9088
|
var?: ("always" | "never" | "consecutive");
|
|
9089
9089
|
let?: ("always" | "never" | "consecutive");
|
|
9090
9090
|
const?: ("always" | "never" | "consecutive");
|
|
9091
|
+
using?: ("always" | "never" | "consecutive");
|
|
9092
|
+
awaitUsing?: ("always" | "never" | "consecutive");
|
|
9091
9093
|
} | {
|
|
9092
9094
|
initialized?: ("always" | "never" | "consecutive");
|
|
9093
9095
|
uninitialized?: ("always" | "never" | "consecutive");
|
|
@@ -11384,10 +11386,17 @@ type NoRestrictedExports = [] | [({
|
|
|
11384
11386
|
};
|
|
11385
11387
|
})];
|
|
11386
11388
|
// ----- no-restricted-globals -----
|
|
11387
|
-
type NoRestrictedGlobals = (string | {
|
|
11389
|
+
type NoRestrictedGlobals = ((string | {
|
|
11388
11390
|
name: string;
|
|
11389
11391
|
message?: string;
|
|
11390
|
-
})[]
|
|
11392
|
+
})[] | [] | [{
|
|
11393
|
+
globals: (string | {
|
|
11394
|
+
name: string;
|
|
11395
|
+
message?: string;
|
|
11396
|
+
})[];
|
|
11397
|
+
checkGlobalObject?: boolean;
|
|
11398
|
+
globalObjects?: string[];
|
|
11399
|
+
}]);
|
|
11391
11400
|
// ----- no-restricted-imports -----
|
|
11392
11401
|
type NoRestrictedImports = ((string | {
|
|
11393
11402
|
name: string;
|
|
@@ -11882,6 +11891,8 @@ type OneVar = [] | [(("always" | "never" | "consecutive") | {
|
|
|
11882
11891
|
var?: ("always" | "never" | "consecutive");
|
|
11883
11892
|
let?: ("always" | "never" | "consecutive");
|
|
11884
11893
|
const?: ("always" | "never" | "consecutive");
|
|
11894
|
+
using?: ("always" | "never" | "consecutive");
|
|
11895
|
+
awaitUsing?: ("always" | "never" | "consecutive");
|
|
11885
11896
|
} | {
|
|
11886
11897
|
initialized?: ("always" | "never" | "consecutive");
|
|
11887
11898
|
uninitialized?: ("always" | "never" | "consecutive");
|
package/dist/index.js
CHANGED
|
@@ -246,14 +246,10 @@ const GLOB_JSON = "**/*.json";
|
|
|
246
246
|
const GLOB_JSON5 = "**/*.json5";
|
|
247
247
|
const GLOB_JSONC = "**/*.jsonc";
|
|
248
248
|
const GLOB_MARKDOWN = "**/*.md";
|
|
249
|
-
const GLOB_SVELTE = "**/*.svelte";
|
|
250
|
-
const GLOB_VUE = "**/*.vue";
|
|
251
249
|
const GLOB_YAML = "**/*.y?(a)ml";
|
|
252
250
|
const GLOB_TOML = "**/*.toml";
|
|
253
|
-
const GLOB_XML = "**/*.xml";
|
|
254
251
|
const GLOB_HTML = "**/*.htm?(l)";
|
|
255
252
|
const GLOB_SVG = "**/*.svg";
|
|
256
|
-
const GLOB_ASTRO = "**/*.astro";
|
|
257
253
|
const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
258
254
|
const GLOB_TESTS = [
|
|
259
255
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -270,14 +266,10 @@ const GLOB_ALL_SRC = [
|
|
|
270
266
|
GLOB_JSON5,
|
|
271
267
|
GLOB_JSONC,
|
|
272
268
|
GLOB_MARKDOWN,
|
|
273
|
-
GLOB_SVELTE,
|
|
274
|
-
GLOB_VUE,
|
|
275
269
|
GLOB_YAML,
|
|
276
270
|
GLOB_TOML,
|
|
277
|
-
GLOB_XML,
|
|
278
271
|
GLOB_HTML,
|
|
279
|
-
GLOB_SVG
|
|
280
|
-
GLOB_ASTRO
|
|
272
|
+
GLOB_SVG
|
|
281
273
|
];
|
|
282
274
|
const GLOB_EXCLUDE = [
|
|
283
275
|
"**/node_modules",
|
|
@@ -378,7 +370,6 @@ const parsers = {
|
|
|
378
370
|
parserPlain: eslintPluginFormat.parserPlain,
|
|
379
371
|
parserTypescript: parser
|
|
380
372
|
};
|
|
381
|
-
var parsers_default = parsers;
|
|
382
373
|
|
|
383
374
|
//#endregion
|
|
384
375
|
//#region src/configs/formatters.ts
|
|
@@ -453,7 +444,7 @@ async function formatters(options = {}) {
|
|
|
453
444
|
{
|
|
454
445
|
name: `${name$12.rules}/markdown`,
|
|
455
446
|
files: [GLOB_MARKDOWN],
|
|
456
|
-
languageOptions: { parser:
|
|
447
|
+
languageOptions: { parser: parsers["parserPlain"] },
|
|
457
448
|
rules: hasPlugin("markdown") ? { "format/dprint": ["error", {
|
|
458
449
|
language: getPluginUrl("markdown"),
|
|
459
450
|
languageOptions: {
|
|
@@ -466,7 +457,7 @@ async function formatters(options = {}) {
|
|
|
466
457
|
{
|
|
467
458
|
name: `${name$12.rules}/malva`,
|
|
468
459
|
files: [GLOB_STYLE, GLOB_POSTCSS],
|
|
469
|
-
languageOptions: { parser:
|
|
460
|
+
languageOptions: { parser: parsers["parserPlain"] },
|
|
470
461
|
rules: hasPlugin("malva") ? { "format/dprint": ["error", {
|
|
471
462
|
language: getPluginUrl("malva"),
|
|
472
463
|
languageOptions: {
|
|
@@ -481,13 +472,8 @@ async function formatters(options = {}) {
|
|
|
481
472
|
},
|
|
482
473
|
{
|
|
483
474
|
name: `${name$12.rules}/markup`,
|
|
484
|
-
files: [
|
|
485
|
-
|
|
486
|
-
GLOB_VUE,
|
|
487
|
-
GLOB_SVELTE,
|
|
488
|
-
GLOB_ASTRO
|
|
489
|
-
],
|
|
490
|
-
languageOptions: { parser: parsers_default["parserPlain"] },
|
|
475
|
+
files: [GLOB_HTML],
|
|
476
|
+
languageOptions: { parser: parsers["parserPlain"] },
|
|
491
477
|
rules: hasPlugin("markup") ? { "format/dprint": ["error", {
|
|
492
478
|
language: getPluginUrl("markup"),
|
|
493
479
|
languageOptions: {
|
|
@@ -502,7 +488,7 @@ async function formatters(options = {}) {
|
|
|
502
488
|
{
|
|
503
489
|
name: `${name$12.rules}/yaml`,
|
|
504
490
|
files: [GLOB_YAML],
|
|
505
|
-
languageOptions: { parser:
|
|
491
|
+
languageOptions: { parser: parsers["parserPlain"] },
|
|
506
492
|
rules: hasPlugin("yaml") ? { "format/dprint": ["error", {
|
|
507
493
|
language: getPluginUrl("yaml"),
|
|
508
494
|
languageOptions: {
|
|
@@ -733,7 +719,7 @@ function json(options = {}) {
|
|
|
733
719
|
jsonc: pluginJsonc
|
|
734
720
|
},
|
|
735
721
|
language: "json/json",
|
|
736
|
-
languageOptions: { parser:
|
|
722
|
+
languageOptions: { parser: parsers["parserJsonc"] }
|
|
737
723
|
},
|
|
738
724
|
{
|
|
739
725
|
name: name$8.rules,
|
|
@@ -1010,7 +996,6 @@ function nextJs() {
|
|
|
1010
996
|
name: name$6.rules,
|
|
1011
997
|
files: files$4,
|
|
1012
998
|
rules: {
|
|
1013
|
-
...pluginNextJs.flatConfig.coreWebVitals.rules,
|
|
1014
999
|
"react-refresh/only-export-components": ["warn", { allowExportNames: [
|
|
1015
1000
|
"config",
|
|
1016
1001
|
"generateStaticParams",
|
|
@@ -1018,7 +1003,28 @@ function nextJs() {
|
|
|
1018
1003
|
"generateMetadata",
|
|
1019
1004
|
"viewport",
|
|
1020
1005
|
"generateViewport"
|
|
1021
|
-
] }]
|
|
1006
|
+
] }],
|
|
1007
|
+
"@next/next/google-font-display": "warn",
|
|
1008
|
+
"@next/next/google-font-preconnect": "warn",
|
|
1009
|
+
"@next/next/next-script-for-ga": "warn",
|
|
1010
|
+
"@next/next/no-async-client-component": "warn",
|
|
1011
|
+
"@next/next/no-before-interactive-script-outside-document": "warn",
|
|
1012
|
+
"@next/next/no-css-tags": "warn",
|
|
1013
|
+
"@next/next/no-head-element": "warn",
|
|
1014
|
+
"@next/next/no-img-element": "warn",
|
|
1015
|
+
"@next/next/no-page-custom-font": "warn",
|
|
1016
|
+
"@next/next/no-styled-jsx-in-document": "warn",
|
|
1017
|
+
"@next/next/no-title-in-document-head": "warn",
|
|
1018
|
+
"@next/next/no-typos": "warn",
|
|
1019
|
+
"@next/next/no-unwanted-polyfillio": "warn",
|
|
1020
|
+
"@next/next/inline-script-id": "error",
|
|
1021
|
+
"@next/next/no-assign-module-variable": "error",
|
|
1022
|
+
"@next/next/no-document-import-in-page": "error",
|
|
1023
|
+
"@next/next/no-duplicate-head": "error",
|
|
1024
|
+
"@next/next/no-head-import-in-document": "error",
|
|
1025
|
+
"@next/next/no-script-component-in-head": "error",
|
|
1026
|
+
"@next/next/no-html-link-for-pages": "error",
|
|
1027
|
+
"@next/next/no-sync-scripts": "error"
|
|
1022
1028
|
}
|
|
1023
1029
|
}];
|
|
1024
1030
|
}
|
|
@@ -1459,7 +1465,7 @@ function typescript(options = {}) {
|
|
|
1459
1465
|
languageOptions: {
|
|
1460
1466
|
sourceType: "module",
|
|
1461
1467
|
ecmaVersion: "latest",
|
|
1462
|
-
parser:
|
|
1468
|
+
parser: parsers["parserTypescript"],
|
|
1463
1469
|
parserOptions: {
|
|
1464
1470
|
ecmaVersion: "latest",
|
|
1465
1471
|
extraFileExtensions,
|
|
@@ -1585,8 +1591,14 @@ function enabled(options, defaults = false) {
|
|
|
1585
1591
|
}
|
|
1586
1592
|
function configOptions(options, defaultOptions) {
|
|
1587
1593
|
const isInEditor = isInEditorEnv();
|
|
1588
|
-
if (options === void 0) return {
|
|
1589
|
-
|
|
1594
|
+
if (options === void 0) return {
|
|
1595
|
+
...defaultOptions,
|
|
1596
|
+
isInEditor
|
|
1597
|
+
};
|
|
1598
|
+
if (typeof options === "boolean") return {
|
|
1599
|
+
...defaultOptions,
|
|
1600
|
+
isInEditor
|
|
1601
|
+
};
|
|
1590
1602
|
return {
|
|
1591
1603
|
...defaultOptions,
|
|
1592
1604
|
...options,
|
|
@@ -1615,10 +1627,11 @@ async function config(options, ...userConfigs) {
|
|
|
1615
1627
|
}
|
|
1616
1628
|
if (enabled(options?.react, isPackageExists("react") || isPackageExists("@types/react"))) {
|
|
1617
1629
|
const enableReactCompiler = isPackageExists("babel-plugin-react-compiler") || isPackageExists("react-compiler-webpack");
|
|
1618
|
-
|
|
1630
|
+
const reactOptions = configOptions(options?.react, {
|
|
1619
1631
|
typeCheck: enableTypeScript,
|
|
1620
1632
|
reactCompiler: enableReactCompiler
|
|
1621
|
-
})
|
|
1633
|
+
});
|
|
1634
|
+
configs$2.push(jsx(), react(reactOptions));
|
|
1622
1635
|
}
|
|
1623
1636
|
if (enabled(options?.nextjs, isPackageExists("next"))) configs$2.push(nextJs());
|
|
1624
1637
|
if (enabled(options?.node, isPackageExists("@types/node"))) configs$2.push(nodeJs(configOptions(options?.node)));
|
|
@@ -1626,7 +1639,8 @@ async function config(options, ...userConfigs) {
|
|
|
1626
1639
|
configs$2.push(regexp(), unicorn(), disables());
|
|
1627
1640
|
if (enabled(options?.format, isPackageExists("dprint"))) {
|
|
1628
1641
|
const jsonOptions = configOptions(options?.json);
|
|
1629
|
-
|
|
1642
|
+
const formatterOptions = configOptions(options?.format, { extraJsonFiles: jsonOptions.extraFiles });
|
|
1643
|
+
configs$2.push(formatters(formatterOptions));
|
|
1630
1644
|
}
|
|
1631
1645
|
let composer = new FlatConfigComposer(...configs$2);
|
|
1632
1646
|
const _userConfigs = userConfigs;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@biscuittin/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "A collection of ESLint configurations for Biscuit Tin projects.",
|
|
6
6
|
"author": "Biscuit Tin <opensource@biscuitt.in>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,46 +60,46 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
63
|
-
"@eslint-sukka/eslint-plugin-react-jsx-a11y": "^6.
|
|
64
|
-
"@eslint/js": "^9.
|
|
63
|
+
"@eslint-sukka/eslint-plugin-react-jsx-a11y": "^6.23.1",
|
|
64
|
+
"@eslint/js": "^9.33.0",
|
|
65
65
|
"@eslint/json": "^0.13.1",
|
|
66
|
-
"@next/eslint-plugin-next": "^15.
|
|
66
|
+
"@next/eslint-plugin-next": "^15.5.0",
|
|
67
67
|
"@package-json/types": "^0.0.11",
|
|
68
|
-
"@stylistic/eslint-plugin": "^5.2.
|
|
68
|
+
"@stylistic/eslint-plugin": "^5.2.3",
|
|
69
69
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
70
70
|
"eslint-flat-config-utils": "^2.1.1",
|
|
71
71
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
72
72
|
"eslint-plugin-antfu": "^3.1.1",
|
|
73
73
|
"eslint-plugin-autofix": "^2.2.0",
|
|
74
|
-
"eslint-plugin-better-tailwindcss": "^3.7.
|
|
74
|
+
"eslint-plugin-better-tailwindcss": "^3.7.5",
|
|
75
75
|
"eslint-plugin-format": "^1.0.1",
|
|
76
76
|
"eslint-plugin-import-x": "^4.16.1",
|
|
77
77
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
78
78
|
"eslint-plugin-n": "^17.21.3",
|
|
79
79
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
80
80
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
81
|
-
"eslint-plugin-react-dom": "^1.52.
|
|
81
|
+
"eslint-plugin-react-dom": "^1.52.6",
|
|
82
82
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
83
|
-
"eslint-plugin-react-hooks-extra": "^1.52.
|
|
84
|
-
"eslint-plugin-react-naming-convention": "^1.52.
|
|
83
|
+
"eslint-plugin-react-hooks-extra": "^1.52.6",
|
|
84
|
+
"eslint-plugin-react-naming-convention": "^1.52.6",
|
|
85
85
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
86
|
-
"eslint-plugin-react-web-api": "^1.52.
|
|
87
|
-
"eslint-plugin-react-x": "^1.52.
|
|
88
|
-
"eslint-plugin-regexp": "^2.
|
|
86
|
+
"eslint-plugin-react-web-api": "^1.52.6",
|
|
87
|
+
"eslint-plugin-react-x": "^1.52.6",
|
|
88
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
89
89
|
"eslint-plugin-unicorn": "^60.0.0",
|
|
90
|
-
"eslint-plugin-unused-imports": "^4.
|
|
90
|
+
"eslint-plugin-unused-imports": "^4.2.0",
|
|
91
91
|
"find-up": "^7.0.0",
|
|
92
92
|
"globals": "^16.3.0",
|
|
93
93
|
"jsonc-eslint-parser": "^2.4.0",
|
|
94
|
-
"local-pkg": "^1.1.
|
|
95
|
-
"typescript-eslint": "^8.
|
|
94
|
+
"local-pkg": "^1.1.2",
|
|
95
|
+
"typescript-eslint": "^8.40.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@eslint/config-inspector": "^1.
|
|
99
|
-
"@typescript-eslint/parser": "^8.
|
|
98
|
+
"@eslint/config-inspector": "^1.2.0",
|
|
99
|
+
"@typescript-eslint/parser": "^8.40.0",
|
|
100
100
|
"dprint": "^0.50.1",
|
|
101
|
-
"eslint": "^9.
|
|
102
|
-
"tailwindcss": "^4.1.
|
|
101
|
+
"eslint": "^9.33.0",
|
|
102
|
+
"tailwindcss": "^4.1.12",
|
|
103
103
|
"ts-api-utils": "^2.1.0",
|
|
104
104
|
"typescript": "^5.8.3"
|
|
105
105
|
},
|
package/typegen.d.ts
CHANGED
|
@@ -9323,6 +9323,8 @@ type AutofixOneVar = []|[(("always" | "never" | "consecutive") | {
|
|
|
9323
9323
|
var?: ("always" | "never" | "consecutive")
|
|
9324
9324
|
let?: ("always" | "never" | "consecutive")
|
|
9325
9325
|
const?: ("always" | "never" | "consecutive")
|
|
9326
|
+
using?: ("always" | "never" | "consecutive")
|
|
9327
|
+
awaitUsing?: ("always" | "never" | "consecutive")
|
|
9326
9328
|
} | {
|
|
9327
9329
|
initialized?: ("always" | "never" | "consecutive")
|
|
9328
9330
|
uninitialized?: ("always" | "never" | "consecutive")
|
|
@@ -12004,10 +12006,18 @@ type NoRestrictedExports = []|[({
|
|
|
12004
12006
|
}
|
|
12005
12007
|
})]
|
|
12006
12008
|
// ----- no-restricted-globals -----
|
|
12007
|
-
type NoRestrictedGlobals = (string | {
|
|
12009
|
+
type NoRestrictedGlobals = ((string | {
|
|
12008
12010
|
name: string
|
|
12009
12011
|
message?: string
|
|
12010
|
-
})[]
|
|
12012
|
+
})[] | []|[{
|
|
12013
|
+
|
|
12014
|
+
globals: (string | {
|
|
12015
|
+
name: string
|
|
12016
|
+
message?: string
|
|
12017
|
+
})[]
|
|
12018
|
+
checkGlobalObject?: boolean
|
|
12019
|
+
globalObjects?: string[]
|
|
12020
|
+
}])
|
|
12011
12021
|
// ----- no-restricted-imports -----
|
|
12012
12022
|
type NoRestrictedImports = ((string | {
|
|
12013
12023
|
name: string
|
|
@@ -12543,6 +12553,8 @@ type OneVar = []|[(("always" | "never" | "consecutive") | {
|
|
|
12543
12553
|
var?: ("always" | "never" | "consecutive")
|
|
12544
12554
|
let?: ("always" | "never" | "consecutive")
|
|
12545
12555
|
const?: ("always" | "never" | "consecutive")
|
|
12556
|
+
using?: ("always" | "never" | "consecutive")
|
|
12557
|
+
awaitUsing?: ("always" | "never" | "consecutive")
|
|
12546
12558
|
} | {
|
|
12547
12559
|
initialized?: ("always" | "never" | "consecutive")
|
|
12548
12560
|
uninitialized?: ("always" | "never" | "consecutive")
|