@biscuittin/eslint-config 0.0.5 → 0.0.6
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 +16 -32
- package/dist/index.js +17 -33
- package/package.json +2 -2
- package/typegen.d.ts +8 -0
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var fsp = require('node:fs/promises');
|
|
|
31
31
|
var parserJsonc = require('jsonc-eslint-parser');
|
|
32
32
|
var gitignore = require('eslint-config-flat-gitignore');
|
|
33
33
|
var js = require('@eslint/js');
|
|
34
|
+
var nodeResolver_js = require('eslint-plugin-import-x/node-resolver.js');
|
|
34
35
|
var globals = require('globals');
|
|
35
36
|
var eslintImportResolverTypescript = require('eslint-import-resolver-typescript');
|
|
36
37
|
var eslintFlatConfigUtils = require('eslint-flat-config-utils');
|
|
@@ -606,10 +607,6 @@ function imports(options = {}) {
|
|
|
606
607
|
"unused-imports": plugins["pluginUnusedImports"],
|
|
607
608
|
antfu: plugins["pluginAntfu"],
|
|
608
609
|
perfectionist: plugins["pluginPerfectionist"]
|
|
609
|
-
},
|
|
610
|
-
languageOptions: {
|
|
611
|
-
sourceType: "module",
|
|
612
|
-
ecmaVersion: "latest"
|
|
613
610
|
}
|
|
614
611
|
},
|
|
615
612
|
{
|
|
@@ -671,9 +668,10 @@ function imports(options = {}) {
|
|
|
671
668
|
}
|
|
672
669
|
|
|
673
670
|
const name$9 = getFlatConfigName("javascript");
|
|
674
|
-
const files$5 = [
|
|
671
|
+
const files$5 = [GLOB_JS, GLOB_JSX];
|
|
675
672
|
const commonjsGlobalsOffList = Object.keys(globals__default.default.commonjs).map((key) => ({ [key]: "off" }));
|
|
676
673
|
const commonjsGlobalsOff = Object.assign({}, ...commonjsGlobalsOffList);
|
|
674
|
+
const extensions = [".js", ".jsx", ".cjs", ".mjs"];
|
|
677
675
|
function javascript(options = {}) {
|
|
678
676
|
const { env = { browser: true }, module = true } = options;
|
|
679
677
|
const sourceType = module ? "module" : "commonjs";
|
|
@@ -709,7 +707,10 @@ function javascript(options = {}) {
|
|
|
709
707
|
}
|
|
710
708
|
},
|
|
711
709
|
settings: {
|
|
712
|
-
"import-x/extensions":
|
|
710
|
+
"import-x/extensions": extensions,
|
|
711
|
+
"import-x/resolver-next": [
|
|
712
|
+
nodeResolver_js.createNodeResolver({ extensions })
|
|
713
|
+
]
|
|
713
714
|
}
|
|
714
715
|
},
|
|
715
716
|
{
|
|
@@ -1496,6 +1497,7 @@ const typescriptStylisticTypeCheckedRules = Object.assign(
|
|
|
1496
1497
|
{},
|
|
1497
1498
|
...typescriptStylisticTypeCheckedRuleList
|
|
1498
1499
|
);
|
|
1500
|
+
const externalModuleFolders = ["node_modules", "node_modules/@types"];
|
|
1499
1501
|
function typescript(options = {}) {
|
|
1500
1502
|
const {
|
|
1501
1503
|
isInEditor = false,
|
|
@@ -1510,6 +1512,10 @@ function typescript(options = {}) {
|
|
|
1510
1512
|
GLOB_TSX,
|
|
1511
1513
|
...extraFileExtensions.map((extension) => `**/*${extension}`)
|
|
1512
1514
|
];
|
|
1515
|
+
const extensions = [".cjs", ".mjs", ".cts", ".mts", ...eslintImportResolverTypescript.defaultExtensions, ...extraFileExtensions];
|
|
1516
|
+
if (process__default.default.versions["pnp"]) {
|
|
1517
|
+
externalModuleFolders.push(".yarn");
|
|
1518
|
+
}
|
|
1513
1519
|
const tsProjectOptions = tsconfigPath === true ? {
|
|
1514
1520
|
projectService: {
|
|
1515
1521
|
allowDefaultProject,
|
|
@@ -1542,18 +1548,8 @@ function typescript(options = {}) {
|
|
|
1542
1548
|
}
|
|
1543
1549
|
},
|
|
1544
1550
|
settings: {
|
|
1545
|
-
"import-x/extensions":
|
|
1546
|
-
|
|
1547
|
-
".jsx",
|
|
1548
|
-
".cjs",
|
|
1549
|
-
".mjs",
|
|
1550
|
-
".ts",
|
|
1551
|
-
".tsx",
|
|
1552
|
-
".cts",
|
|
1553
|
-
".mts",
|
|
1554
|
-
...extraFileExtensions
|
|
1555
|
-
],
|
|
1556
|
-
"import-x/external-module-folders": ["node_modules", "node_modules/@types"],
|
|
1551
|
+
"import-x/extensions": extensions,
|
|
1552
|
+
"import-x/external-module-folders": externalModuleFolders,
|
|
1557
1553
|
"import-x/parsers": {
|
|
1558
1554
|
"@typescript-eslint/parser": [".ts", ".tsx", ".cts", ".mts", ...extraFileExtensions]
|
|
1559
1555
|
},
|
|
@@ -1563,16 +1559,7 @@ function typescript(options = {}) {
|
|
|
1563
1559
|
eslintImportResolverTypescript.createTypeScriptImportResolver({
|
|
1564
1560
|
alwaysTryTypes: true,
|
|
1565
1561
|
project: tsconfigPath === true ? void 0 : tsconfigPath,
|
|
1566
|
-
extensions
|
|
1567
|
-
".ts",
|
|
1568
|
-
".tsx",
|
|
1569
|
-
".d.ts",
|
|
1570
|
-
".js",
|
|
1571
|
-
".jsx",
|
|
1572
|
-
".json",
|
|
1573
|
-
".node",
|
|
1574
|
-
...extraFileExtensions
|
|
1575
|
-
]
|
|
1562
|
+
extensions
|
|
1576
1563
|
})
|
|
1577
1564
|
]
|
|
1578
1565
|
}
|
|
@@ -1730,9 +1717,6 @@ function configOptions(options, defaultOptions) {
|
|
|
1730
1717
|
if (typeof options === "boolean") return { isInEditor };
|
|
1731
1718
|
return { ...defaultOptions, ...options, isInEditor };
|
|
1732
1719
|
}
|
|
1733
|
-
const pluginRenaming = {
|
|
1734
|
-
"import-x": "import"
|
|
1735
|
-
};
|
|
1736
1720
|
async function config(options, ...userConfigs) {
|
|
1737
1721
|
const configs = [];
|
|
1738
1722
|
const enableTypeScript = enabled(options?.typescript, localPkg.isPackageExists("typescript"));
|
|
@@ -1783,7 +1767,7 @@ async function config(options, ...userConfigs) {
|
|
|
1783
1767
|
}
|
|
1784
1768
|
let composer = new eslintFlatConfigUtils.FlatConfigComposer(...configs);
|
|
1785
1769
|
const _userConfigs = userConfigs;
|
|
1786
|
-
composer = composer.append(..._userConfigs)
|
|
1770
|
+
composer = composer.append(..._userConfigs);
|
|
1787
1771
|
return composer;
|
|
1788
1772
|
}
|
|
1789
1773
|
|
package/dist/index.js
CHANGED
|
@@ -27,9 +27,10 @@ import fsp from 'node:fs/promises';
|
|
|
27
27
|
import * as parserJsonc from 'jsonc-eslint-parser';
|
|
28
28
|
import gitignore from 'eslint-config-flat-gitignore';
|
|
29
29
|
import js from '@eslint/js';
|
|
30
|
+
import { createNodeResolver } from 'eslint-plugin-import-x/node-resolver.js';
|
|
30
31
|
import globals from 'globals';
|
|
31
32
|
export { default as globals } from 'globals';
|
|
32
|
-
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
33
|
+
import { defaultExtensions, createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
33
34
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
34
35
|
import { isPackageExists } from 'local-pkg';
|
|
35
36
|
|
|
@@ -555,10 +556,6 @@ function imports(options = {}) {
|
|
|
555
556
|
"unused-imports": plugins["pluginUnusedImports"],
|
|
556
557
|
antfu: plugins["pluginAntfu"],
|
|
557
558
|
perfectionist: plugins["pluginPerfectionist"]
|
|
558
|
-
},
|
|
559
|
-
languageOptions: {
|
|
560
|
-
sourceType: "module",
|
|
561
|
-
ecmaVersion: "latest"
|
|
562
559
|
}
|
|
563
560
|
},
|
|
564
561
|
{
|
|
@@ -620,9 +617,10 @@ function imports(options = {}) {
|
|
|
620
617
|
}
|
|
621
618
|
|
|
622
619
|
const name$9 = getFlatConfigName("javascript");
|
|
623
|
-
const files$5 = [
|
|
620
|
+
const files$5 = [GLOB_JS, GLOB_JSX];
|
|
624
621
|
const commonjsGlobalsOffList = Object.keys(globals.commonjs).map((key) => ({ [key]: "off" }));
|
|
625
622
|
const commonjsGlobalsOff = Object.assign({}, ...commonjsGlobalsOffList);
|
|
623
|
+
const extensions = [".js", ".jsx", ".cjs", ".mjs"];
|
|
626
624
|
function javascript(options = {}) {
|
|
627
625
|
const { env = { browser: true }, module = true } = options;
|
|
628
626
|
const sourceType = module ? "module" : "commonjs";
|
|
@@ -658,7 +656,10 @@ function javascript(options = {}) {
|
|
|
658
656
|
}
|
|
659
657
|
},
|
|
660
658
|
settings: {
|
|
661
|
-
"import-x/extensions":
|
|
659
|
+
"import-x/extensions": extensions,
|
|
660
|
+
"import-x/resolver-next": [
|
|
661
|
+
createNodeResolver({ extensions })
|
|
662
|
+
]
|
|
662
663
|
}
|
|
663
664
|
},
|
|
664
665
|
{
|
|
@@ -1445,6 +1446,7 @@ const typescriptStylisticTypeCheckedRules = Object.assign(
|
|
|
1445
1446
|
{},
|
|
1446
1447
|
...typescriptStylisticTypeCheckedRuleList
|
|
1447
1448
|
);
|
|
1449
|
+
const externalModuleFolders = ["node_modules", "node_modules/@types"];
|
|
1448
1450
|
function typescript(options = {}) {
|
|
1449
1451
|
const {
|
|
1450
1452
|
isInEditor = false,
|
|
@@ -1459,6 +1461,10 @@ function typescript(options = {}) {
|
|
|
1459
1461
|
GLOB_TSX,
|
|
1460
1462
|
...extraFileExtensions.map((extension) => `**/*${extension}`)
|
|
1461
1463
|
];
|
|
1464
|
+
const extensions = [".cjs", ".mjs", ".cts", ".mts", ...defaultExtensions, ...extraFileExtensions];
|
|
1465
|
+
if (process.versions["pnp"]) {
|
|
1466
|
+
externalModuleFolders.push(".yarn");
|
|
1467
|
+
}
|
|
1462
1468
|
const tsProjectOptions = tsconfigPath === true ? {
|
|
1463
1469
|
projectService: {
|
|
1464
1470
|
allowDefaultProject,
|
|
@@ -1491,18 +1497,8 @@ function typescript(options = {}) {
|
|
|
1491
1497
|
}
|
|
1492
1498
|
},
|
|
1493
1499
|
settings: {
|
|
1494
|
-
"import-x/extensions":
|
|
1495
|
-
|
|
1496
|
-
".jsx",
|
|
1497
|
-
".cjs",
|
|
1498
|
-
".mjs",
|
|
1499
|
-
".ts",
|
|
1500
|
-
".tsx",
|
|
1501
|
-
".cts",
|
|
1502
|
-
".mts",
|
|
1503
|
-
...extraFileExtensions
|
|
1504
|
-
],
|
|
1505
|
-
"import-x/external-module-folders": ["node_modules", "node_modules/@types"],
|
|
1500
|
+
"import-x/extensions": extensions,
|
|
1501
|
+
"import-x/external-module-folders": externalModuleFolders,
|
|
1506
1502
|
"import-x/parsers": {
|
|
1507
1503
|
"@typescript-eslint/parser": [".ts", ".tsx", ".cts", ".mts", ...extraFileExtensions]
|
|
1508
1504
|
},
|
|
@@ -1512,16 +1508,7 @@ function typescript(options = {}) {
|
|
|
1512
1508
|
createTypeScriptImportResolver({
|
|
1513
1509
|
alwaysTryTypes: true,
|
|
1514
1510
|
project: tsconfigPath === true ? void 0 : tsconfigPath,
|
|
1515
|
-
extensions
|
|
1516
|
-
".ts",
|
|
1517
|
-
".tsx",
|
|
1518
|
-
".d.ts",
|
|
1519
|
-
".js",
|
|
1520
|
-
".jsx",
|
|
1521
|
-
".json",
|
|
1522
|
-
".node",
|
|
1523
|
-
...extraFileExtensions
|
|
1524
|
-
]
|
|
1511
|
+
extensions
|
|
1525
1512
|
})
|
|
1526
1513
|
]
|
|
1527
1514
|
}
|
|
@@ -1679,9 +1666,6 @@ function configOptions(options, defaultOptions) {
|
|
|
1679
1666
|
if (typeof options === "boolean") return { isInEditor };
|
|
1680
1667
|
return { ...defaultOptions, ...options, isInEditor };
|
|
1681
1668
|
}
|
|
1682
|
-
const pluginRenaming = {
|
|
1683
|
-
"import-x": "import"
|
|
1684
|
-
};
|
|
1685
1669
|
async function config(options, ...userConfigs) {
|
|
1686
1670
|
const configs = [];
|
|
1687
1671
|
const enableTypeScript = enabled(options?.typescript, isPackageExists("typescript"));
|
|
@@ -1732,7 +1716,7 @@ async function config(options, ...userConfigs) {
|
|
|
1732
1716
|
}
|
|
1733
1717
|
let composer = new FlatConfigComposer(...configs);
|
|
1734
1718
|
const _userConfigs = userConfigs;
|
|
1735
|
-
composer = composer.append(..._userConfigs)
|
|
1719
|
+
composer = composer.append(..._userConfigs);
|
|
1736
1720
|
return composer;
|
|
1737
1721
|
}
|
|
1738
1722
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@biscuittin/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"description": "A collection of ESLint configurations for Biscuit Tin projects.",
|
|
6
6
|
"author": "Biscuit Tin <opensource@biscuitt.in>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
73
73
|
"eslint-plugin-n": "^17.16.2",
|
|
74
74
|
"eslint-plugin-perfectionist": "^4.10.1",
|
|
75
|
-
"eslint-plugin-react-compiler": "19.0.0-beta-
|
|
75
|
+
"eslint-plugin-react-compiler": "19.0.0-beta-aeaed83-20250323",
|
|
76
76
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
77
77
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
78
78
|
"eslint-plugin-regexp": "^2.7.0",
|
package/typegen.d.ts
CHANGED
|
@@ -4350,6 +4350,10 @@ export interface RuleOptions {
|
|
|
4350
4350
|
* @see https://eslint.org/docs/rules/radix
|
|
4351
4351
|
*/
|
|
4352
4352
|
'radix'?: Linter.RuleEntry<Radix>
|
|
4353
|
+
/**
|
|
4354
|
+
* Surfaces diagnostics from React Forget
|
|
4355
|
+
*/
|
|
4356
|
+
'react-compiler/react-compiler'?: Linter.RuleEntry<ReactCompilerReactCompiler>
|
|
4353
4357
|
/**
|
|
4354
4358
|
* verifies the list of dependencies for Hooks like useEffect and similar
|
|
4355
4359
|
* @see https://github.com/facebook/react/issues/14920
|
|
@@ -11975,6 +11979,10 @@ type Quotes = []|[("single" | "double" | "backtick")]|[("single" | "double" | "b
|
|
|
11975
11979
|
})]
|
|
11976
11980
|
// ----- radix -----
|
|
11977
11981
|
type Radix = []|[("always" | "as-needed")]
|
|
11982
|
+
// ----- react-compiler/react-compiler -----
|
|
11983
|
+
type ReactCompilerReactCompiler = []|[{
|
|
11984
|
+
[k: string]: unknown | undefined
|
|
11985
|
+
}]
|
|
11978
11986
|
// ----- react-hooks/exhaustive-deps -----
|
|
11979
11987
|
type ReactHooksExhaustiveDeps = []|[{
|
|
11980
11988
|
additionalHooks?: string
|