@debbl/eslint-config 3.2.3 → 3.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 +19 -14
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +19 -14
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -946,6 +946,7 @@ var typeAwareRules = {
|
|
|
946
946
|
"@typescript-eslint/no-unsafe-return": "error",
|
|
947
947
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
948
948
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
949
|
+
"@typescript-eslint/strict-boolean-expressions": "error",
|
|
949
950
|
"@typescript-eslint/unbound-method": "error"
|
|
950
951
|
};
|
|
951
952
|
var typescript = async (options) => {
|
|
@@ -953,7 +954,8 @@ var typescript = async (options) => {
|
|
|
953
954
|
overrides = {},
|
|
954
955
|
componentExts = [],
|
|
955
956
|
parserOptions = {},
|
|
956
|
-
tsconfigPath
|
|
957
|
+
tsconfigPath,
|
|
958
|
+
enableSolid = false
|
|
957
959
|
} = options ?? {};
|
|
958
960
|
const [pluginTs, parserTs] = await Promise.all([
|
|
959
961
|
interopDefault(import("@typescript-eslint/eslint-plugin")),
|
|
@@ -964,7 +966,10 @@ var typescript = async (options) => {
|
|
|
964
966
|
// Install the plugins without globs, so they can be configured separately.
|
|
965
967
|
name: "eslint/typescript/setup",
|
|
966
968
|
plugins: {
|
|
967
|
-
"@typescript-eslint": pluginTs
|
|
969
|
+
"@typescript-eslint": pluginTs,
|
|
970
|
+
...enableSolid ? {
|
|
971
|
+
solid: await interopDefault(import("eslint-plugin-solid"))
|
|
972
|
+
} : {}
|
|
968
973
|
}
|
|
969
974
|
},
|
|
970
975
|
{
|
|
@@ -985,6 +990,10 @@ var typescript = async (options) => {
|
|
|
985
990
|
rules: {
|
|
986
991
|
...pluginTs.configs["eslint-recommended"].overrides[0].rules,
|
|
987
992
|
...pluginTs.configs.strict.rules,
|
|
993
|
+
...enableSolid ? {
|
|
994
|
+
"solid/jsx-no-undef": ["error", { typescriptEnabled: true }],
|
|
995
|
+
"solid/no-unknown-namespaces": "off"
|
|
996
|
+
} : {},
|
|
988
997
|
"no-dupe-class-members": "off",
|
|
989
998
|
"no-invalid-this": "off",
|
|
990
999
|
"no-loss-of-precision": "off",
|
|
@@ -1512,7 +1521,11 @@ async function next() {
|
|
|
1512
1521
|
"react-refresh/only-export-components": [
|
|
1513
1522
|
"warn",
|
|
1514
1523
|
{
|
|
1515
|
-
allowExportNames: [
|
|
1524
|
+
allowExportNames: [
|
|
1525
|
+
"metadata",
|
|
1526
|
+
"generateMetadata",
|
|
1527
|
+
"generateStaticParams"
|
|
1528
|
+
]
|
|
1516
1529
|
}
|
|
1517
1530
|
]
|
|
1518
1531
|
}
|
|
@@ -1570,17 +1583,7 @@ var react = async (options) => {
|
|
|
1570
1583
|
...pluginReact.configs.recommended.rules,
|
|
1571
1584
|
...pluginReactHooks.configs.recommended.rules,
|
|
1572
1585
|
// React Refresh
|
|
1573
|
-
"react-refresh/only-export-components":
|
|
1574
|
-
"warn",
|
|
1575
|
-
{
|
|
1576
|
-
allowExportNames: [
|
|
1577
|
-
// remix
|
|
1578
|
-
...["meta", "links", "headers", "loader", "action"],
|
|
1579
|
-
// nextjs
|
|
1580
|
-
...["generateMetadata", "generateStaticParams"]
|
|
1581
|
-
]
|
|
1582
|
-
}
|
|
1583
|
-
],
|
|
1586
|
+
"react-refresh/only-export-components": "warn",
|
|
1584
1587
|
// React Compiler
|
|
1585
1588
|
...enableCompiler ? {
|
|
1586
1589
|
"react-compiler/react-compiler": "error"
|
|
@@ -1628,6 +1631,7 @@ function config(options = {}) {
|
|
|
1628
1631
|
ignores: enableGitignore = true,
|
|
1629
1632
|
vue: enableVue,
|
|
1630
1633
|
react: enableReact,
|
|
1634
|
+
solid: enableSolid,
|
|
1631
1635
|
typescript: enableTypeScript,
|
|
1632
1636
|
tailwindcss: enableTailwindcss,
|
|
1633
1637
|
componentExts = []
|
|
@@ -1649,6 +1653,7 @@ function config(options = {}) {
|
|
|
1649
1653
|
configs.push(
|
|
1650
1654
|
typescript({
|
|
1651
1655
|
...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
|
|
1656
|
+
enableSolid,
|
|
1652
1657
|
componentExts
|
|
1653
1658
|
})
|
|
1654
1659
|
);
|
package/dist/index.d.cts
CHANGED
|
@@ -47,7 +47,9 @@ declare function sortPackageJson(): Promise<ConfigItem[]>;
|
|
|
47
47
|
*/
|
|
48
48
|
declare function sortTsconfig(): Promise<ConfigItem[]>;
|
|
49
49
|
|
|
50
|
-
type TypeScriptConfig = (options?: OptionsComponentExts & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsOverrides
|
|
50
|
+
type TypeScriptConfig = (options?: OptionsComponentExts & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsOverrides & {
|
|
51
|
+
enableSolid?: boolean;
|
|
52
|
+
}) => ReturnType<ConfigFn>;
|
|
51
53
|
declare const typescript: TypeScriptConfig;
|
|
52
54
|
|
|
53
55
|
declare function unicorn(): Promise<ConfigItem[]>;
|
|
@@ -155,6 +157,12 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
155
157
|
* @default false
|
|
156
158
|
*/
|
|
157
159
|
react?: boolean | GetConfigOption<ReactConfig>;
|
|
160
|
+
/**
|
|
161
|
+
* Enable solid support, Passing an object to enable Next.js support.
|
|
162
|
+
*
|
|
163
|
+
* @default false
|
|
164
|
+
*/
|
|
165
|
+
solid?: boolean;
|
|
158
166
|
/**
|
|
159
167
|
* Enable JSONC support.
|
|
160
168
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,9 @@ declare function sortPackageJson(): Promise<ConfigItem[]>;
|
|
|
47
47
|
*/
|
|
48
48
|
declare function sortTsconfig(): Promise<ConfigItem[]>;
|
|
49
49
|
|
|
50
|
-
type TypeScriptConfig = (options?: OptionsComponentExts & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsOverrides
|
|
50
|
+
type TypeScriptConfig = (options?: OptionsComponentExts & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsOverrides & {
|
|
51
|
+
enableSolid?: boolean;
|
|
52
|
+
}) => ReturnType<ConfigFn>;
|
|
51
53
|
declare const typescript: TypeScriptConfig;
|
|
52
54
|
|
|
53
55
|
declare function unicorn(): Promise<ConfigItem[]>;
|
|
@@ -155,6 +157,12 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
155
157
|
* @default false
|
|
156
158
|
*/
|
|
157
159
|
react?: boolean | GetConfigOption<ReactConfig>;
|
|
160
|
+
/**
|
|
161
|
+
* Enable solid support, Passing an object to enable Next.js support.
|
|
162
|
+
*
|
|
163
|
+
* @default false
|
|
164
|
+
*/
|
|
165
|
+
solid?: boolean;
|
|
158
166
|
/**
|
|
159
167
|
* Enable JSONC support.
|
|
160
168
|
*
|
package/dist/index.js
CHANGED
|
@@ -864,6 +864,7 @@ var typeAwareRules = {
|
|
|
864
864
|
"@typescript-eslint/no-unsafe-return": "error",
|
|
865
865
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
866
866
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
867
|
+
"@typescript-eslint/strict-boolean-expressions": "error",
|
|
867
868
|
"@typescript-eslint/unbound-method": "error"
|
|
868
869
|
};
|
|
869
870
|
var typescript = async (options) => {
|
|
@@ -871,7 +872,8 @@ var typescript = async (options) => {
|
|
|
871
872
|
overrides = {},
|
|
872
873
|
componentExts = [],
|
|
873
874
|
parserOptions = {},
|
|
874
|
-
tsconfigPath
|
|
875
|
+
tsconfigPath,
|
|
876
|
+
enableSolid = false
|
|
875
877
|
} = options ?? {};
|
|
876
878
|
const [pluginTs, parserTs] = await Promise.all([
|
|
877
879
|
interopDefault(import("@typescript-eslint/eslint-plugin")),
|
|
@@ -882,7 +884,10 @@ var typescript = async (options) => {
|
|
|
882
884
|
// Install the plugins without globs, so they can be configured separately.
|
|
883
885
|
name: "eslint/typescript/setup",
|
|
884
886
|
plugins: {
|
|
885
|
-
"@typescript-eslint": pluginTs
|
|
887
|
+
"@typescript-eslint": pluginTs,
|
|
888
|
+
...enableSolid ? {
|
|
889
|
+
solid: await interopDefault(import("eslint-plugin-solid"))
|
|
890
|
+
} : {}
|
|
886
891
|
}
|
|
887
892
|
},
|
|
888
893
|
{
|
|
@@ -903,6 +908,10 @@ var typescript = async (options) => {
|
|
|
903
908
|
rules: {
|
|
904
909
|
...pluginTs.configs["eslint-recommended"].overrides[0].rules,
|
|
905
910
|
...pluginTs.configs.strict.rules,
|
|
911
|
+
...enableSolid ? {
|
|
912
|
+
"solid/jsx-no-undef": ["error", { typescriptEnabled: true }],
|
|
913
|
+
"solid/no-unknown-namespaces": "off"
|
|
914
|
+
} : {},
|
|
906
915
|
"no-dupe-class-members": "off",
|
|
907
916
|
"no-invalid-this": "off",
|
|
908
917
|
"no-loss-of-precision": "off",
|
|
@@ -1430,7 +1439,11 @@ async function next() {
|
|
|
1430
1439
|
"react-refresh/only-export-components": [
|
|
1431
1440
|
"warn",
|
|
1432
1441
|
{
|
|
1433
|
-
allowExportNames: [
|
|
1442
|
+
allowExportNames: [
|
|
1443
|
+
"metadata",
|
|
1444
|
+
"generateMetadata",
|
|
1445
|
+
"generateStaticParams"
|
|
1446
|
+
]
|
|
1434
1447
|
}
|
|
1435
1448
|
]
|
|
1436
1449
|
}
|
|
@@ -1488,17 +1501,7 @@ var react = async (options) => {
|
|
|
1488
1501
|
...pluginReact.configs.recommended.rules,
|
|
1489
1502
|
...pluginReactHooks.configs.recommended.rules,
|
|
1490
1503
|
// React Refresh
|
|
1491
|
-
"react-refresh/only-export-components":
|
|
1492
|
-
"warn",
|
|
1493
|
-
{
|
|
1494
|
-
allowExportNames: [
|
|
1495
|
-
// remix
|
|
1496
|
-
...["meta", "links", "headers", "loader", "action"],
|
|
1497
|
-
// nextjs
|
|
1498
|
-
...["generateMetadata", "generateStaticParams"]
|
|
1499
|
-
]
|
|
1500
|
-
}
|
|
1501
|
-
],
|
|
1504
|
+
"react-refresh/only-export-components": "warn",
|
|
1502
1505
|
// React Compiler
|
|
1503
1506
|
...enableCompiler ? {
|
|
1504
1507
|
"react-compiler/react-compiler": "error"
|
|
@@ -1546,6 +1549,7 @@ function config(options = {}) {
|
|
|
1546
1549
|
ignores: enableGitignore = true,
|
|
1547
1550
|
vue: enableVue,
|
|
1548
1551
|
react: enableReact,
|
|
1552
|
+
solid: enableSolid,
|
|
1549
1553
|
typescript: enableTypeScript,
|
|
1550
1554
|
tailwindcss: enableTailwindcss,
|
|
1551
1555
|
componentExts = []
|
|
@@ -1567,6 +1571,7 @@ function config(options = {}) {
|
|
|
1567
1571
|
configs.push(
|
|
1568
1572
|
typescript({
|
|
1569
1573
|
...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
|
|
1574
|
+
enableSolid,
|
|
1570
1575
|
componentExts
|
|
1571
1576
|
})
|
|
1572
1577
|
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"eslint-plugin-react-compiler": "0.0.0-experimental-a97cca1-20240529",
|
|
46
46
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
47
47
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
48
|
+
"eslint-plugin-solid": "^0.14.0",
|
|
48
49
|
"eslint-plugin-tailwindcss": "^3.17.0",
|
|
49
50
|
"eslint-plugin-toml": "^0.11.0",
|
|
50
51
|
"eslint-plugin-unicorn": "^53.0.0",
|