@debbl/eslint-config 3.8.4 → 3.8.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/README.md +7 -108
- package/dist/index.cjs +104 -19
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +104 -19
- package/package.json +39 -33
package/README.md
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.com/package/@debbl/eslint-config)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Credits
|
|
6
6
|
|
|
7
7
|
> https://github.com/antfu/eslint-config
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
pnpm i eslint @debbl/eslint-config -D
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Config `eslint.config.js`
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### Default config
|
|
18
18
|
|
|
19
19
|
- ignores
|
|
20
20
|
- javascript
|
|
@@ -37,7 +37,7 @@ import { defineConfig } from "@debbl/eslint-config";
|
|
|
37
37
|
export default defineConfig();
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
##
|
|
40
|
+
## Config `Prettier`, will override default rules
|
|
41
41
|
|
|
42
42
|
```js
|
|
43
43
|
import { defineConfig } from "@debbl/eslint-config";
|
|
@@ -50,107 +50,6 @@ export default defineConfig({
|
|
|
50
50
|
});
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## Full OptionConfig
|
|
54
54
|
|
|
55
|
-
[types.ts](./src/types.ts#
|
|
56
|
-
|
|
57
|
-
```ts
|
|
58
|
-
export interface OptionsConfig extends OptionsComponentExts {
|
|
59
|
-
/**
|
|
60
|
-
* Enable gitignore support.
|
|
61
|
-
* Passing an object to configure the options.
|
|
62
|
-
* @default true
|
|
63
|
-
*/
|
|
64
|
-
ignores?: boolean | GetConfigOption<IgnoresConfig>;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Enable JavaScript support.
|
|
68
|
-
* Passing an object to configure the options.
|
|
69
|
-
* @default true
|
|
70
|
-
*/
|
|
71
|
-
javascript?: GetConfigOption<JavascriptConfig>;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Enable TypeScript support.
|
|
75
|
-
*
|
|
76
|
-
* Passing an object to enable TypeScript Language Server support.
|
|
77
|
-
*
|
|
78
|
-
* @default false
|
|
79
|
-
*/
|
|
80
|
-
typescript?: boolean | GetConfigOption<TypeScriptConfig>;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Enable test support.
|
|
84
|
-
*
|
|
85
|
-
* @default true
|
|
86
|
-
*/
|
|
87
|
-
test?: boolean | GetConfigOption<TestConfig>;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Enable Vue support.
|
|
91
|
-
*
|
|
92
|
-
* @default false
|
|
93
|
-
*/
|
|
94
|
-
vue?: boolean | GetConfigOption<VueConfig>;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Enable React support, Passing an object to enable Next.js support.
|
|
98
|
-
*
|
|
99
|
-
* @default false
|
|
100
|
-
*/
|
|
101
|
-
react?: boolean | GetConfigOption<ReactConfig>;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Enable solid support, Passing an object to enable Next.js support.
|
|
105
|
-
*
|
|
106
|
-
* @default false
|
|
107
|
-
*/
|
|
108
|
-
solid?: boolean;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Enable JSONC support.
|
|
112
|
-
*
|
|
113
|
-
* @default true
|
|
114
|
-
*/
|
|
115
|
-
jsonc?: boolean | GetConfigOption<JsoncConfig>;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Enable YML support.
|
|
119
|
-
*
|
|
120
|
-
* @default true
|
|
121
|
-
*/
|
|
122
|
-
yml?: boolean | GetConfigOption<YmlConfig>;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Enable TOML support.
|
|
126
|
-
* @default true
|
|
127
|
-
*/
|
|
128
|
-
toml?: boolean | GetConfigOption<TomlConfig>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Enable Markdown support.
|
|
132
|
-
*
|
|
133
|
-
* @default true
|
|
134
|
-
*/
|
|
135
|
-
markdown?: boolean | GetConfigOption<MarkdownConfig>;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Enable prettier rules.
|
|
139
|
-
*
|
|
140
|
-
* @default true
|
|
141
|
-
*/
|
|
142
|
-
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, "tailwindcss">;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Enable Tailwind CSS support.
|
|
146
|
-
* if set to "prettier", it will use `prettier-plugin-tailwindcss` @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
147
|
-
* @default false
|
|
148
|
-
*/
|
|
149
|
-
tailwindcss?: boolean | "prettier";
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Custom config
|
|
153
|
-
*/
|
|
154
|
-
customConfig?: ConfigItem[] | ConfigItem;
|
|
155
|
-
}
|
|
156
|
-
```
|
|
55
|
+
[types.ts](./src/types.ts#L65)
|
package/dist/index.cjs
CHANGED
|
@@ -115,7 +115,7 @@ async function interopDefault(m) {
|
|
|
115
115
|
async function comments() {
|
|
116
116
|
const pluginComments = await interopDefault(
|
|
117
117
|
// @ts-expect-error missing types
|
|
118
|
-
import("eslint-plugin-eslint-comments")
|
|
118
|
+
import("@eslint-community/eslint-plugin-eslint-comments")
|
|
119
119
|
);
|
|
120
120
|
return [
|
|
121
121
|
{
|
|
@@ -602,31 +602,47 @@ var jsonc = async (options) => {
|
|
|
602
602
|
};
|
|
603
603
|
|
|
604
604
|
// src/configs/markdown.ts
|
|
605
|
-
|
|
606
|
-
const
|
|
607
|
-
const [pluginMdx, pluginMarkdown] = await Promise.all([
|
|
608
|
-
interopDefault(import("eslint-plugin-mdx")),
|
|
609
|
-
interopDefault(import("@eslint/markdown"))
|
|
610
|
-
]);
|
|
605
|
+
async function mdx() {
|
|
606
|
+
const pluginMdx = await interopDefault(import("eslint-plugin-mdx"));
|
|
611
607
|
return [
|
|
608
|
+
{
|
|
609
|
+
...pluginMdx.flat,
|
|
610
|
+
processor: pluginMdx.createRemarkProcessor({
|
|
611
|
+
lintCodeBlocks: true,
|
|
612
|
+
languageMapper: {}
|
|
613
|
+
})
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
...pluginMdx.flatCodeBlocks,
|
|
617
|
+
rules: {
|
|
618
|
+
...pluginMdx.flatCodeBlocks.rules,
|
|
619
|
+
"no-var": "error",
|
|
620
|
+
"prefer-const": "error"
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
];
|
|
624
|
+
}
|
|
625
|
+
var markdown = async (options) => {
|
|
626
|
+
const {
|
|
627
|
+
mdx: enableMdx = false,
|
|
628
|
+
componentExts = [],
|
|
629
|
+
overrides = {}
|
|
630
|
+
} = options;
|
|
631
|
+
const pluginMarkdown = await interopDefault(import("@eslint/markdown"));
|
|
632
|
+
const _markdown = [
|
|
612
633
|
{
|
|
613
634
|
name: "eslint/markdown/setup",
|
|
614
635
|
plugins: {
|
|
615
|
-
mdx: pluginMdx,
|
|
616
636
|
markdown: pluginMarkdown
|
|
617
637
|
}
|
|
618
638
|
},
|
|
619
639
|
{
|
|
620
640
|
name: "eslint/markdown/processor",
|
|
621
|
-
files: [GLOB_MARKDOWN
|
|
641
|
+
files: [GLOB_MARKDOWN],
|
|
622
642
|
languageOptions: {
|
|
623
643
|
ecmaVersion: "latest",
|
|
624
644
|
parser: parserPlain,
|
|
625
645
|
sourceType: "module"
|
|
626
|
-
},
|
|
627
|
-
processor: "mdx/remark",
|
|
628
|
-
settings: {
|
|
629
|
-
"mdx/code-blocks": true
|
|
630
646
|
}
|
|
631
647
|
},
|
|
632
648
|
{
|
|
@@ -679,6 +695,7 @@ var markdown = async (options) => {
|
|
|
679
695
|
}
|
|
680
696
|
}
|
|
681
697
|
];
|
|
698
|
+
return combine(_markdown, enableMdx ? await mdx() : []);
|
|
682
699
|
};
|
|
683
700
|
|
|
684
701
|
// src/configs/node.ts
|
|
@@ -1073,7 +1090,7 @@ async function sortTsconfig() {
|
|
|
1073
1090
|
var test = async (options) => {
|
|
1074
1091
|
const { overrides = {} } = options;
|
|
1075
1092
|
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
1076
|
-
interopDefault(import("eslint-plugin
|
|
1093
|
+
interopDefault(import("@vitest/eslint-plugin")),
|
|
1077
1094
|
// @ts-expect-error missing types
|
|
1078
1095
|
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
1079
1096
|
]);
|
|
@@ -1563,9 +1580,19 @@ async function next() {
|
|
|
1563
1580
|
"warn",
|
|
1564
1581
|
{
|
|
1565
1582
|
allowExportNames: [
|
|
1583
|
+
"dynamic",
|
|
1584
|
+
"dynamicParams",
|
|
1585
|
+
"revalidate",
|
|
1586
|
+
"fetchCache",
|
|
1587
|
+
"runtime",
|
|
1588
|
+
"preferredRegion",
|
|
1589
|
+
"maxDuration",
|
|
1590
|
+
"config",
|
|
1591
|
+
"generateStaticParams",
|
|
1566
1592
|
"metadata",
|
|
1567
1593
|
"generateMetadata",
|
|
1568
|
-
"
|
|
1594
|
+
"viewport",
|
|
1595
|
+
"generateViewport"
|
|
1569
1596
|
]
|
|
1570
1597
|
}
|
|
1571
1598
|
]
|
|
@@ -1581,18 +1608,21 @@ var react = async (options) => {
|
|
|
1581
1608
|
} = options;
|
|
1582
1609
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1583
1610
|
[
|
|
1584
|
-
interopDefault(import("eslint-plugin
|
|
1611
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1585
1612
|
// @ts-expect-error missing types
|
|
1586
1613
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1587
|
-
// @ts-expect-error missing types
|
|
1588
1614
|
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1589
1615
|
]
|
|
1590
1616
|
);
|
|
1617
|
+
const plugins = pluginReact.configs.all.plugins;
|
|
1591
1618
|
const _react = [
|
|
1592
1619
|
{
|
|
1593
1620
|
name: "eslint/react/setup",
|
|
1594
1621
|
plugins: {
|
|
1595
|
-
"react":
|
|
1622
|
+
"react": plugins["@eslint-react"],
|
|
1623
|
+
"react-dom": plugins["@eslint-react/dom"],
|
|
1624
|
+
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1625
|
+
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1596
1626
|
"react-hooks": pluginReactHooks,
|
|
1597
1627
|
"react-refresh": pluginReactRefresh,
|
|
1598
1628
|
...enableCompiler ? {
|
|
@@ -1620,14 +1650,69 @@ var react = async (options) => {
|
|
|
1620
1650
|
}
|
|
1621
1651
|
},
|
|
1622
1652
|
rules: {
|
|
1623
|
-
...pluginReact.configs.recommended.rules,
|
|
1624
1653
|
...pluginReactHooks.configs.recommended.rules,
|
|
1654
|
+
// recommended rules from @eslint-react/dom
|
|
1655
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
1656
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1657
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1658
|
+
"react-dom/no-find-dom-node": "error",
|
|
1659
|
+
"react-dom/no-missing-button-type": "warn",
|
|
1660
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1661
|
+
"react-dom/no-namespace": "error",
|
|
1662
|
+
"react-dom/no-render-return-value": "error",
|
|
1663
|
+
"react-dom/no-script-url": "warn",
|
|
1664
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1665
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
1666
|
+
// recommended rules react-hooks
|
|
1667
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
1668
|
+
"react-hooks/rules-of-hooks": "error",
|
|
1625
1669
|
// React Refresh
|
|
1626
1670
|
"react-refresh/only-export-components": "warn",
|
|
1627
1671
|
// React Compiler
|
|
1628
1672
|
...enableCompiler ? {
|
|
1629
1673
|
"react-compiler/react-compiler": "error"
|
|
1630
1674
|
} : {},
|
|
1675
|
+
// recommended rules from @eslint-react
|
|
1676
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
1677
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
1678
|
+
"react/jsx-uses-vars": "warn",
|
|
1679
|
+
"react/no-access-state-in-setstate": "error",
|
|
1680
|
+
"react/no-array-index-key": "warn",
|
|
1681
|
+
"react/no-children-count": "warn",
|
|
1682
|
+
"react/no-children-for-each": "warn",
|
|
1683
|
+
"react/no-children-map": "warn",
|
|
1684
|
+
"react/no-children-only": "warn",
|
|
1685
|
+
"react/no-children-to-array": "warn",
|
|
1686
|
+
"react/no-clone-element": "warn",
|
|
1687
|
+
"react/no-comment-textnodes": "warn",
|
|
1688
|
+
"react/no-component-will-mount": "error",
|
|
1689
|
+
"react/no-component-will-receive-props": "error",
|
|
1690
|
+
"react/no-component-will-update": "error",
|
|
1691
|
+
"react/no-context-provider": "warn",
|
|
1692
|
+
"react/no-create-ref": "error",
|
|
1693
|
+
"react/no-default-props": "error",
|
|
1694
|
+
"react/no-direct-mutation-state": "error",
|
|
1695
|
+
"react/no-duplicate-key": "error",
|
|
1696
|
+
"react/no-forward-ref": "warn",
|
|
1697
|
+
"react/no-implicit-key": "warn",
|
|
1698
|
+
"react/no-missing-key": "error",
|
|
1699
|
+
"react/no-nested-components": "error",
|
|
1700
|
+
"react/no-prop-types": "error",
|
|
1701
|
+
"react/no-redundant-should-component-update": "error",
|
|
1702
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
1703
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
1704
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
1705
|
+
"react/no-string-refs": "error",
|
|
1706
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
1707
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1708
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
1709
|
+
"react/no-unstable-context-value": "warn",
|
|
1710
|
+
"react/no-unstable-default-props": "warn",
|
|
1711
|
+
"react/no-unused-class-component-members": "warn",
|
|
1712
|
+
"react/no-unused-state": "warn",
|
|
1713
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
1714
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
1715
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
1631
1716
|
"jsx-quotes": ["error", "prefer-double"],
|
|
1632
1717
|
"react/react-in-jsx-scope": "off",
|
|
1633
1718
|
"react/jsx-indent": [1, 2],
|
package/dist/index.d.cts
CHANGED
|
@@ -24,6 +24,7 @@ declare const jsonc: JsoncConfig;
|
|
|
24
24
|
|
|
25
25
|
type MarkdownConfig = (options: {
|
|
26
26
|
componentExts?: string[];
|
|
27
|
+
mdx?: boolean;
|
|
27
28
|
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
28
29
|
declare const markdown: MarkdownConfig;
|
|
29
30
|
|
|
@@ -194,7 +195,10 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
194
195
|
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, "tailwindcss">;
|
|
195
196
|
/**
|
|
196
197
|
* Enable Tailwind CSS support.
|
|
197
|
-
*
|
|
198
|
+
*
|
|
199
|
+
* if set to "prettier", it will use `prettier-plugin-tailwindcss`
|
|
200
|
+
* @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
201
|
+
*
|
|
198
202
|
* @default false
|
|
199
203
|
*/
|
|
200
204
|
tailwindcss?: boolean | "prettier";
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare const jsonc: JsoncConfig;
|
|
|
24
24
|
|
|
25
25
|
type MarkdownConfig = (options: {
|
|
26
26
|
componentExts?: string[];
|
|
27
|
+
mdx?: boolean;
|
|
27
28
|
} & OptionsOverrides) => ReturnType<ConfigFn>;
|
|
28
29
|
declare const markdown: MarkdownConfig;
|
|
29
30
|
|
|
@@ -194,7 +195,10 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
194
195
|
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, "tailwindcss">;
|
|
195
196
|
/**
|
|
196
197
|
* Enable Tailwind CSS support.
|
|
197
|
-
*
|
|
198
|
+
*
|
|
199
|
+
* if set to "prettier", it will use `prettier-plugin-tailwindcss`
|
|
200
|
+
* @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
201
|
+
*
|
|
198
202
|
* @default false
|
|
199
203
|
*/
|
|
200
204
|
tailwindcss?: boolean | "prettier";
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ async function interopDefault(m) {
|
|
|
32
32
|
async function comments() {
|
|
33
33
|
const pluginComments = await interopDefault(
|
|
34
34
|
// @ts-expect-error missing types
|
|
35
|
-
import("eslint-plugin-eslint-comments")
|
|
35
|
+
import("@eslint-community/eslint-plugin-eslint-comments")
|
|
36
36
|
);
|
|
37
37
|
return [
|
|
38
38
|
{
|
|
@@ -519,31 +519,47 @@ var jsonc = async (options) => {
|
|
|
519
519
|
};
|
|
520
520
|
|
|
521
521
|
// src/configs/markdown.ts
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
const [pluginMdx, pluginMarkdown] = await Promise.all([
|
|
525
|
-
interopDefault(import("eslint-plugin-mdx")),
|
|
526
|
-
interopDefault(import("@eslint/markdown"))
|
|
527
|
-
]);
|
|
522
|
+
async function mdx() {
|
|
523
|
+
const pluginMdx = await interopDefault(import("eslint-plugin-mdx"));
|
|
528
524
|
return [
|
|
525
|
+
{
|
|
526
|
+
...pluginMdx.flat,
|
|
527
|
+
processor: pluginMdx.createRemarkProcessor({
|
|
528
|
+
lintCodeBlocks: true,
|
|
529
|
+
languageMapper: {}
|
|
530
|
+
})
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
...pluginMdx.flatCodeBlocks,
|
|
534
|
+
rules: {
|
|
535
|
+
...pluginMdx.flatCodeBlocks.rules,
|
|
536
|
+
"no-var": "error",
|
|
537
|
+
"prefer-const": "error"
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
];
|
|
541
|
+
}
|
|
542
|
+
var markdown = async (options) => {
|
|
543
|
+
const {
|
|
544
|
+
mdx: enableMdx = false,
|
|
545
|
+
componentExts = [],
|
|
546
|
+
overrides = {}
|
|
547
|
+
} = options;
|
|
548
|
+
const pluginMarkdown = await interopDefault(import("@eslint/markdown"));
|
|
549
|
+
const _markdown = [
|
|
529
550
|
{
|
|
530
551
|
name: "eslint/markdown/setup",
|
|
531
552
|
plugins: {
|
|
532
|
-
mdx: pluginMdx,
|
|
533
553
|
markdown: pluginMarkdown
|
|
534
554
|
}
|
|
535
555
|
},
|
|
536
556
|
{
|
|
537
557
|
name: "eslint/markdown/processor",
|
|
538
|
-
files: [GLOB_MARKDOWN
|
|
558
|
+
files: [GLOB_MARKDOWN],
|
|
539
559
|
languageOptions: {
|
|
540
560
|
ecmaVersion: "latest",
|
|
541
561
|
parser: parserPlain,
|
|
542
562
|
sourceType: "module"
|
|
543
|
-
},
|
|
544
|
-
processor: "mdx/remark",
|
|
545
|
-
settings: {
|
|
546
|
-
"mdx/code-blocks": true
|
|
547
563
|
}
|
|
548
564
|
},
|
|
549
565
|
{
|
|
@@ -596,6 +612,7 @@ var markdown = async (options) => {
|
|
|
596
612
|
}
|
|
597
613
|
}
|
|
598
614
|
];
|
|
615
|
+
return combine(_markdown, enableMdx ? await mdx() : []);
|
|
599
616
|
};
|
|
600
617
|
|
|
601
618
|
// src/configs/node.ts
|
|
@@ -990,7 +1007,7 @@ async function sortTsconfig() {
|
|
|
990
1007
|
var test = async (options) => {
|
|
991
1008
|
const { overrides = {} } = options;
|
|
992
1009
|
const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
|
|
993
|
-
interopDefault(import("eslint-plugin
|
|
1010
|
+
interopDefault(import("@vitest/eslint-plugin")),
|
|
994
1011
|
// @ts-expect-error missing types
|
|
995
1012
|
interopDefault(import("eslint-plugin-no-only-tests"))
|
|
996
1013
|
]);
|
|
@@ -1480,9 +1497,19 @@ async function next() {
|
|
|
1480
1497
|
"warn",
|
|
1481
1498
|
{
|
|
1482
1499
|
allowExportNames: [
|
|
1500
|
+
"dynamic",
|
|
1501
|
+
"dynamicParams",
|
|
1502
|
+
"revalidate",
|
|
1503
|
+
"fetchCache",
|
|
1504
|
+
"runtime",
|
|
1505
|
+
"preferredRegion",
|
|
1506
|
+
"maxDuration",
|
|
1507
|
+
"config",
|
|
1508
|
+
"generateStaticParams",
|
|
1483
1509
|
"metadata",
|
|
1484
1510
|
"generateMetadata",
|
|
1485
|
-
"
|
|
1511
|
+
"viewport",
|
|
1512
|
+
"generateViewport"
|
|
1486
1513
|
]
|
|
1487
1514
|
}
|
|
1488
1515
|
]
|
|
@@ -1498,18 +1525,21 @@ var react = async (options) => {
|
|
|
1498
1525
|
} = options;
|
|
1499
1526
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1500
1527
|
[
|
|
1501
|
-
interopDefault(import("eslint-plugin
|
|
1528
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1502
1529
|
// @ts-expect-error missing types
|
|
1503
1530
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1504
|
-
// @ts-expect-error missing types
|
|
1505
1531
|
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1506
1532
|
]
|
|
1507
1533
|
);
|
|
1534
|
+
const plugins = pluginReact.configs.all.plugins;
|
|
1508
1535
|
const _react = [
|
|
1509
1536
|
{
|
|
1510
1537
|
name: "eslint/react/setup",
|
|
1511
1538
|
plugins: {
|
|
1512
|
-
"react":
|
|
1539
|
+
"react": plugins["@eslint-react"],
|
|
1540
|
+
"react-dom": plugins["@eslint-react/dom"],
|
|
1541
|
+
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1542
|
+
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1513
1543
|
"react-hooks": pluginReactHooks,
|
|
1514
1544
|
"react-refresh": pluginReactRefresh,
|
|
1515
1545
|
...enableCompiler ? {
|
|
@@ -1537,14 +1567,69 @@ var react = async (options) => {
|
|
|
1537
1567
|
}
|
|
1538
1568
|
},
|
|
1539
1569
|
rules: {
|
|
1540
|
-
...pluginReact.configs.recommended.rules,
|
|
1541
1570
|
...pluginReactHooks.configs.recommended.rules,
|
|
1571
|
+
// recommended rules from @eslint-react/dom
|
|
1572
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
1573
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1574
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1575
|
+
"react-dom/no-find-dom-node": "error",
|
|
1576
|
+
"react-dom/no-missing-button-type": "warn",
|
|
1577
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1578
|
+
"react-dom/no-namespace": "error",
|
|
1579
|
+
"react-dom/no-render-return-value": "error",
|
|
1580
|
+
"react-dom/no-script-url": "warn",
|
|
1581
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1582
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
1583
|
+
// recommended rules react-hooks
|
|
1584
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
1585
|
+
"react-hooks/rules-of-hooks": "error",
|
|
1542
1586
|
// React Refresh
|
|
1543
1587
|
"react-refresh/only-export-components": "warn",
|
|
1544
1588
|
// React Compiler
|
|
1545
1589
|
...enableCompiler ? {
|
|
1546
1590
|
"react-compiler/react-compiler": "error"
|
|
1547
1591
|
} : {},
|
|
1592
|
+
// recommended rules from @eslint-react
|
|
1593
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
1594
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
1595
|
+
"react/jsx-uses-vars": "warn",
|
|
1596
|
+
"react/no-access-state-in-setstate": "error",
|
|
1597
|
+
"react/no-array-index-key": "warn",
|
|
1598
|
+
"react/no-children-count": "warn",
|
|
1599
|
+
"react/no-children-for-each": "warn",
|
|
1600
|
+
"react/no-children-map": "warn",
|
|
1601
|
+
"react/no-children-only": "warn",
|
|
1602
|
+
"react/no-children-to-array": "warn",
|
|
1603
|
+
"react/no-clone-element": "warn",
|
|
1604
|
+
"react/no-comment-textnodes": "warn",
|
|
1605
|
+
"react/no-component-will-mount": "error",
|
|
1606
|
+
"react/no-component-will-receive-props": "error",
|
|
1607
|
+
"react/no-component-will-update": "error",
|
|
1608
|
+
"react/no-context-provider": "warn",
|
|
1609
|
+
"react/no-create-ref": "error",
|
|
1610
|
+
"react/no-default-props": "error",
|
|
1611
|
+
"react/no-direct-mutation-state": "error",
|
|
1612
|
+
"react/no-duplicate-key": "error",
|
|
1613
|
+
"react/no-forward-ref": "warn",
|
|
1614
|
+
"react/no-implicit-key": "warn",
|
|
1615
|
+
"react/no-missing-key": "error",
|
|
1616
|
+
"react/no-nested-components": "error",
|
|
1617
|
+
"react/no-prop-types": "error",
|
|
1618
|
+
"react/no-redundant-should-component-update": "error",
|
|
1619
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
1620
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
1621
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
1622
|
+
"react/no-string-refs": "error",
|
|
1623
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
1624
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1625
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
1626
|
+
"react/no-unstable-context-value": "warn",
|
|
1627
|
+
"react/no-unstable-default-props": "warn",
|
|
1628
|
+
"react/no-unused-class-component-members": "warn",
|
|
1629
|
+
"react/no-unused-state": "warn",
|
|
1630
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
1631
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
1632
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
1548
1633
|
"jsx-quotes": ["error", "prefer-double"],
|
|
1549
1634
|
"react/react-in-jsx-scope": "off",
|
|
1550
1635
|
"react/jsx-indent": [1, 2],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.8.
|
|
4
|
+
"version": "3.8.6",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,58 +23,64 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"eslint": ">=8.40.0"
|
|
26
|
+
"eslint": ">=8.40.0",
|
|
27
|
+
"eslint-plugin-mdx": ">=3.1.5"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"eslint-plugin-mdx": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
27
33
|
},
|
|
28
34
|
"dependencies": {
|
|
35
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
36
|
+
"@eslint-react/eslint-plugin": "^1.22.1",
|
|
29
37
|
"@eslint/markdown": "^6.2.1",
|
|
30
|
-
"@next/eslint-plugin-next": "^15.
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
32
|
-
"@typescript-eslint/parser": "^8.
|
|
38
|
+
"@next/eslint-plugin-next": "^15.1.2",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
|
40
|
+
"@typescript-eslint/parser": "^8.18.2",
|
|
41
|
+
"@vitest/eslint-plugin": "^1.1.20",
|
|
33
42
|
"eslint-config-prettier": "^9.1.0",
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"eslint-plugin-
|
|
37
|
-
"eslint-plugin-
|
|
38
|
-
"eslint-plugin-mdx": "^3.1.5",
|
|
39
|
-
"eslint-plugin-n": "^17.13.2",
|
|
43
|
+
"eslint-plugin-import-x": "^4.6.1",
|
|
44
|
+
"eslint-plugin-jsdoc": "^50.6.1",
|
|
45
|
+
"eslint-plugin-jsonc": "^2.18.2",
|
|
46
|
+
"eslint-plugin-n": "^17.15.1",
|
|
40
47
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
41
|
-
"eslint-plugin-perfectionist": "^
|
|
48
|
+
"eslint-plugin-perfectionist": "^4.4.0",
|
|
42
49
|
"eslint-plugin-prettier": "^5.2.1",
|
|
43
|
-
"eslint-plugin-react": "^7.37.2",
|
|
44
50
|
"eslint-plugin-react-compiler": "latest",
|
|
45
|
-
"eslint-plugin-react-hooks": "^5.
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
47
|
-
"eslint-plugin-solid": "^0.14.
|
|
51
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
52
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
53
|
+
"eslint-plugin-solid": "^0.14.5",
|
|
48
54
|
"eslint-plugin-tailwindcss": "^3.17.5",
|
|
49
|
-
"eslint-plugin-toml": "^0.
|
|
50
|
-
"eslint-plugin-unicorn": "^56.0.
|
|
55
|
+
"eslint-plugin-toml": "^0.12.0",
|
|
56
|
+
"eslint-plugin-unicorn": "^56.0.1",
|
|
51
57
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
52
|
-
"eslint-plugin-
|
|
53
|
-
"eslint-plugin-
|
|
54
|
-
"
|
|
55
|
-
"globals": "^15.12.0",
|
|
58
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
59
|
+
"eslint-plugin-yml": "^1.16.0",
|
|
60
|
+
"globals": "^15.14.0",
|
|
56
61
|
"jsonc-eslint-parser": "^2.4.0",
|
|
57
|
-
"prettier": "^3.
|
|
58
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
62
|
+
"prettier": "^3.4.2",
|
|
63
|
+
"prettier-plugin-tailwindcss": "^0.6.9",
|
|
59
64
|
"toml-eslint-parser": "^0.10.0",
|
|
60
65
|
"vue-eslint-parser": "^9.4.3",
|
|
61
66
|
"yaml-eslint-parser": "^1.2.3"
|
|
62
67
|
},
|
|
63
68
|
"devDependencies": {
|
|
64
|
-
"@eslint/config-inspector": "^0.
|
|
69
|
+
"@eslint/config-inspector": "^0.6.0",
|
|
65
70
|
"@types/eslint": "^9.6.1",
|
|
66
|
-
"@types/node": "^22.
|
|
67
|
-
"@types/react": "^
|
|
68
|
-
"bumpp": "^9.
|
|
69
|
-
"eslint": "9.
|
|
70
|
-
"
|
|
71
|
+
"@types/node": "^22.10.2",
|
|
72
|
+
"@types/react": "^19.0.2",
|
|
73
|
+
"bumpp": "^9.9.2",
|
|
74
|
+
"eslint": "^9.17.0",
|
|
75
|
+
"eslint-plugin-mdx": "^3.1.5",
|
|
76
|
+
"execa": "^9.5.2",
|
|
71
77
|
"fast-glob": "^3.3.2",
|
|
72
78
|
"fs-extra": "^11.2.0",
|
|
73
|
-
"react": "^
|
|
79
|
+
"react": "^19.0.0",
|
|
74
80
|
"sucrase": "^3.35.0",
|
|
75
81
|
"tsup": "^8.3.5",
|
|
76
|
-
"typescript": "^5.
|
|
77
|
-
"vitest": "^2.1.
|
|
82
|
+
"typescript": "^5.7.2",
|
|
83
|
+
"vitest": "^2.1.8"
|
|
78
84
|
},
|
|
79
85
|
"scripts": {
|
|
80
86
|
"build": "tsup --format esm,cjs --clean --dts",
|