@debbl/eslint-config 3.10.0 → 3.10.2
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 +65 -62
- package/dist/index.d.cts +2 -10
- package/dist/index.d.ts +2 -10
- package/dist/index.js +65 -61
- package/package.json +24 -24
package/dist/index.cjs
CHANGED
|
@@ -57,7 +57,6 @@ __export(index_exports, {
|
|
|
57
57
|
GLOB_YAML: () => GLOB_YAML,
|
|
58
58
|
combine: () => combine,
|
|
59
59
|
comments: () => comments,
|
|
60
|
-
config: () => config,
|
|
61
60
|
default: () => index_default,
|
|
62
61
|
defineConfig: () => defineConfig,
|
|
63
62
|
getConfigOptions: () => getConfigOptions,
|
|
@@ -246,10 +245,7 @@ async function imports() {
|
|
|
246
245
|
"import/no-named-default": "error",
|
|
247
246
|
"import/no-self-import": "error",
|
|
248
247
|
"import/no-webpack-loader-syntax": "error",
|
|
249
|
-
"import/newline-after-import": [
|
|
250
|
-
"error",
|
|
251
|
-
{ considerComments: true, count: 1 }
|
|
252
|
-
],
|
|
248
|
+
"import/newline-after-import": ["error", { count: 1 }],
|
|
253
249
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
|
254
250
|
}
|
|
255
251
|
}
|
|
@@ -759,7 +755,6 @@ async function perfectionist() {
|
|
|
759
755
|
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
760
756
|
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
761
757
|
interopDefault(import("eslint-plugin-prettier")),
|
|
762
|
-
// @ts-expect-error missing types
|
|
763
758
|
interopDefault(import("eslint-config-prettier"))
|
|
764
759
|
]);
|
|
765
760
|
const defaultPrettierOptions = {
|
|
@@ -1246,8 +1241,8 @@ var typescript = async (options) => {
|
|
|
1246
1241
|
prefer: "type-imports"
|
|
1247
1242
|
}
|
|
1248
1243
|
],
|
|
1249
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1250
1244
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
1245
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1251
1246
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1252
1247
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1253
1248
|
"@typescript-eslint/no-empty-object-type": [
|
|
@@ -1398,9 +1393,9 @@ var vue = async (options = {}) => {
|
|
|
1398
1393
|
processor: pluginVue.processors[".vue"],
|
|
1399
1394
|
rules: {
|
|
1400
1395
|
...pluginVue.configs.base.rules,
|
|
1401
|
-
...pluginVue.configs["
|
|
1402
|
-
...pluginVue.configs["
|
|
1403
|
-
...pluginVue.configs["
|
|
1396
|
+
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1397
|
+
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1398
|
+
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1404
1399
|
"node/prefer-global/process": "off",
|
|
1405
1400
|
"vue/block-order": [
|
|
1406
1401
|
"error",
|
|
@@ -1601,23 +1596,28 @@ var react = async (options) => {
|
|
|
1601
1596
|
compiler: enableCompiler = false,
|
|
1602
1597
|
overrides = {}
|
|
1603
1598
|
} = options;
|
|
1604
|
-
const [
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1599
|
+
const [pluginsReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
1600
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1601
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1602
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1603
|
+
]);
|
|
1604
|
+
const plugins = pluginsReact.configs.all.plugins;
|
|
1605
|
+
const {
|
|
1606
|
+
"@eslint-react": pluginReactX,
|
|
1607
|
+
"@eslint-react/dom": pluginReactDom,
|
|
1608
|
+
"@eslint-react/hooks-extra": pluginReactHooksExtra,
|
|
1609
|
+
"@eslint-react/naming-convention": pluginReactNamingConvention,
|
|
1610
|
+
"@eslint-react/web-api": pluginReactWebApi
|
|
1611
|
+
} = plugins;
|
|
1612
1612
|
const _react = [
|
|
1613
1613
|
{
|
|
1614
1614
|
name: "eslint/react/setup",
|
|
1615
1615
|
plugins: {
|
|
1616
|
-
"react":
|
|
1617
|
-
"react-dom":
|
|
1618
|
-
"react-hooks-extra":
|
|
1619
|
-
"react-naming-convention":
|
|
1620
|
-
"react-web-api":
|
|
1616
|
+
"react": pluginReactX,
|
|
1617
|
+
"react-dom": pluginReactDom,
|
|
1618
|
+
"react-hooks-extra": pluginReactHooksExtra,
|
|
1619
|
+
"react-naming-convention": pluginReactNamingConvention,
|
|
1620
|
+
"react-web-api": pluginReactWebApi,
|
|
1621
1621
|
"react-hooks": pluginReactHooks,
|
|
1622
1622
|
"react-refresh": pluginReactRefresh,
|
|
1623
1623
|
...enableCompiler ? {
|
|
@@ -1645,35 +1645,7 @@ var react = async (options) => {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
},
|
|
1647
1647
|
rules: {
|
|
1648
|
-
|
|
1649
|
-
// recommended rules from @eslint-react/dom
|
|
1650
|
-
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
1651
|
-
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1652
|
-
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1653
|
-
"react-dom/no-find-dom-node": "error",
|
|
1654
|
-
"react-dom/no-missing-button-type": "warn",
|
|
1655
|
-
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1656
|
-
"react-dom/no-namespace": "error",
|
|
1657
|
-
"react-dom/no-render-return-value": "error",
|
|
1658
|
-
"react-dom/no-script-url": "warn",
|
|
1659
|
-
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1660
|
-
"react-dom/no-unsafe-target-blank": "warn",
|
|
1661
|
-
// recommended rules react-hooks
|
|
1662
|
-
"react-hooks/exhaustive-deps": "warn",
|
|
1663
|
-
"react-hooks/rules-of-hooks": "error",
|
|
1664
|
-
// React Refresh
|
|
1665
|
-
"react-refresh/only-export-components": "warn",
|
|
1666
|
-
// React Compiler
|
|
1667
|
-
...enableCompiler ? {
|
|
1668
|
-
"react-compiler/react-compiler": "error"
|
|
1669
|
-
} : {},
|
|
1670
|
-
// recommended rules from @eslint-react/web-api
|
|
1671
|
-
"react-web-api/no-leaked-event-listener": "warn",
|
|
1672
|
-
"react-web-api/no-leaked-interval": "warn",
|
|
1673
|
-
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1674
|
-
"react-web-api/no-leaked-timeout": "warn",
|
|
1675
|
-
// recommended rules from @eslint-react
|
|
1676
|
-
"react/ensure-forward-ref-using-ref": "warn",
|
|
1648
|
+
// recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
|
|
1677
1649
|
"react/jsx-no-duplicate-props": "warn",
|
|
1678
1650
|
"react/jsx-uses-vars": "warn",
|
|
1679
1651
|
"react/no-access-state-in-setstate": "error",
|
|
@@ -1692,11 +1664,11 @@ var react = async (options) => {
|
|
|
1692
1664
|
"react/no-create-ref": "error",
|
|
1693
1665
|
"react/no-default-props": "error",
|
|
1694
1666
|
"react/no-direct-mutation-state": "error",
|
|
1695
|
-
"react/no-duplicate-key": "
|
|
1667
|
+
"react/no-duplicate-key": "warn",
|
|
1696
1668
|
"react/no-forward-ref": "warn",
|
|
1697
1669
|
"react/no-implicit-key": "warn",
|
|
1698
1670
|
"react/no-missing-key": "error",
|
|
1699
|
-
"react/no-nested-
|
|
1671
|
+
"react/no-nested-component-definitions": "error",
|
|
1700
1672
|
"react/no-prop-types": "error",
|
|
1701
1673
|
"react/no-redundant-should-component-update": "error",
|
|
1702
1674
|
"react/no-set-state-in-component-did-mount": "warn",
|
|
@@ -1710,9 +1682,42 @@ var react = async (options) => {
|
|
|
1710
1682
|
"react/no-unstable-default-props": "warn",
|
|
1711
1683
|
"react/no-unused-class-component-members": "warn",
|
|
1712
1684
|
"react/no-unused-state": "warn",
|
|
1713
|
-
"react/
|
|
1714
|
-
"react/
|
|
1715
|
-
|
|
1685
|
+
"react/no-use-context": "warn",
|
|
1686
|
+
"react/no-useless-forward-ref": "warn",
|
|
1687
|
+
// recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
1688
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1689
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1690
|
+
"react-dom/no-find-dom-node": "error",
|
|
1691
|
+
"react-dom/no-flush-sync": "error",
|
|
1692
|
+
"react-dom/no-hydrate": "error",
|
|
1693
|
+
"react-dom/no-missing-button-type": "warn",
|
|
1694
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1695
|
+
"react-dom/no-namespace": "error",
|
|
1696
|
+
"react-dom/no-render": "error",
|
|
1697
|
+
"react-dom/no-render-return-value": "error",
|
|
1698
|
+
"react-dom/no-script-url": "warn",
|
|
1699
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1700
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
1701
|
+
"react-dom/no-use-form-state": "error",
|
|
1702
|
+
"react-dom/no-void-elements-with-children": "error",
|
|
1703
|
+
// recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
|
|
1704
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
1705
|
+
"react-hooks/rules-of-hooks": "error",
|
|
1706
|
+
// recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
1707
|
+
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1708
|
+
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
|
|
1709
|
+
"react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
1710
|
+
// recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
1711
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1712
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1713
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1714
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1715
|
+
// React Refresh
|
|
1716
|
+
"react-refresh/only-export-components": "warn",
|
|
1717
|
+
// React Compiler
|
|
1718
|
+
...enableCompiler ? {
|
|
1719
|
+
"react-compiler/react-compiler": "error"
|
|
1720
|
+
} : {},
|
|
1716
1721
|
"jsx-quotes": ["error", "prefer-double"],
|
|
1717
1722
|
"react/react-in-jsx-scope": "off",
|
|
1718
1723
|
"react/jsx-indent": [1, 2],
|
|
@@ -1748,7 +1753,7 @@ async function tailwindcss() {
|
|
|
1748
1753
|
}
|
|
1749
1754
|
|
|
1750
1755
|
// src/factory.ts
|
|
1751
|
-
function defineConfig(options = {}) {
|
|
1756
|
+
function defineConfig(options = {}, ...userConfigs) {
|
|
1752
1757
|
const {
|
|
1753
1758
|
ignores: enableIgnores = true,
|
|
1754
1759
|
vue: enableVue,
|
|
@@ -1825,13 +1830,12 @@ function defineConfig(options = {}) {
|
|
|
1825
1830
|
})
|
|
1826
1831
|
);
|
|
1827
1832
|
}
|
|
1828
|
-
const merged = combine(...configs,
|
|
1833
|
+
const merged = combine(...configs, ...userConfigs);
|
|
1829
1834
|
return merged;
|
|
1830
1835
|
}
|
|
1831
|
-
var config = defineConfig;
|
|
1832
1836
|
|
|
1833
1837
|
// src/index.ts
|
|
1834
|
-
var index_default =
|
|
1838
|
+
var index_default = defineConfig;
|
|
1835
1839
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1836
1840
|
0 && (module.exports = {
|
|
1837
1841
|
GLOB_ALL_SRC,
|
|
@@ -1861,7 +1865,6 @@ var index_default = config;
|
|
|
1861
1865
|
GLOB_YAML,
|
|
1862
1866
|
combine,
|
|
1863
1867
|
comments,
|
|
1864
|
-
config,
|
|
1865
1868
|
defineConfig,
|
|
1866
1869
|
getConfigOptions,
|
|
1867
1870
|
ignores,
|
package/dist/index.d.cts
CHANGED
|
@@ -210,20 +210,12 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
210
210
|
* @default false
|
|
211
211
|
*/
|
|
212
212
|
tailwindcss?: boolean | "prettier";
|
|
213
|
-
/**
|
|
214
|
-
* Custom config
|
|
215
|
-
*/
|
|
216
|
-
customConfig?: ConfigItem[] | ConfigItem;
|
|
217
213
|
}
|
|
218
214
|
|
|
219
215
|
/**
|
|
220
216
|
* Construct an array of ESLint flat config items.
|
|
221
217
|
*/
|
|
222
|
-
declare function defineConfig(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
223
|
-
/**
|
|
224
|
-
* @deprecated Use `defineConfig` instead.
|
|
225
|
-
*/
|
|
226
|
-
declare const config: typeof defineConfig;
|
|
218
|
+
declare function defineConfig(options?: OptionsConfig, ...userConfigs: ConfigItem[]): Promise<ConfigItem[]>;
|
|
227
219
|
|
|
228
220
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
229
221
|
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -285,4 +277,4 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
285
277
|
} ? U : T>;
|
|
286
278
|
declare function getConfigOptions<T>(options: T): {};
|
|
287
279
|
|
|
288
|
-
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_ASTRO_TS, 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_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments,
|
|
280
|
+
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_ASTRO_TS, 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_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments, defineConfig as default, defineConfig, getConfigOptions, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -210,20 +210,12 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
210
210
|
* @default false
|
|
211
211
|
*/
|
|
212
212
|
tailwindcss?: boolean | "prettier";
|
|
213
|
-
/**
|
|
214
|
-
* Custom config
|
|
215
|
-
*/
|
|
216
|
-
customConfig?: ConfigItem[] | ConfigItem;
|
|
217
213
|
}
|
|
218
214
|
|
|
219
215
|
/**
|
|
220
216
|
* Construct an array of ESLint flat config items.
|
|
221
217
|
*/
|
|
222
|
-
declare function defineConfig(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
223
|
-
/**
|
|
224
|
-
* @deprecated Use `defineConfig` instead.
|
|
225
|
-
*/
|
|
226
|
-
declare const config: typeof defineConfig;
|
|
218
|
+
declare function defineConfig(options?: OptionsConfig, ...userConfigs: ConfigItem[]): Promise<ConfigItem[]>;
|
|
227
219
|
|
|
228
220
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
229
221
|
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -285,4 +277,4 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
285
277
|
} ? U : T>;
|
|
286
278
|
declare function getConfigOptions<T>(options: T): {};
|
|
287
279
|
|
|
288
|
-
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_ASTRO_TS, 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_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments,
|
|
280
|
+
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, GLOB_ASTRO_TS, 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_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type GetConfigOption, type IgnoresConfig, type JavascriptConfig, type JsoncConfig, type MarkdownConfig, type OptionsComponentExts, type OptionsConfig, type OptionsHasTypeScript, type OptionsOverrides, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PrettierConfig, type PrettierRequiredOptions, type TestConfig, type TomlConfig, type TypeScriptConfig, type VueConfig, type YmlConfig, combine, comments, defineConfig as default, defineConfig, getConfigOptions, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -161,10 +161,7 @@ async function imports() {
|
|
|
161
161
|
"import/no-named-default": "error",
|
|
162
162
|
"import/no-self-import": "error",
|
|
163
163
|
"import/no-webpack-loader-syntax": "error",
|
|
164
|
-
"import/newline-after-import": [
|
|
165
|
-
"error",
|
|
166
|
-
{ considerComments: true, count: 1 }
|
|
167
|
-
],
|
|
164
|
+
"import/newline-after-import": ["error", { count: 1 }],
|
|
168
165
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"]
|
|
169
166
|
}
|
|
170
167
|
}
|
|
@@ -674,7 +671,6 @@ async function perfectionist() {
|
|
|
674
671
|
var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
|
|
675
672
|
const [pluginPrettier, configPrettier] = await Promise.all([
|
|
676
673
|
interopDefault(import("eslint-plugin-prettier")),
|
|
677
|
-
// @ts-expect-error missing types
|
|
678
674
|
interopDefault(import("eslint-config-prettier"))
|
|
679
675
|
]);
|
|
680
676
|
const defaultPrettierOptions = {
|
|
@@ -1161,8 +1157,8 @@ var typescript = async (options) => {
|
|
|
1161
1157
|
prefer: "type-imports"
|
|
1162
1158
|
}
|
|
1163
1159
|
],
|
|
1164
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1165
1160
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
1161
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1166
1162
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1167
1163
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1168
1164
|
"@typescript-eslint/no-empty-object-type": [
|
|
@@ -1313,9 +1309,9 @@ var vue = async (options = {}) => {
|
|
|
1313
1309
|
processor: pluginVue.processors[".vue"],
|
|
1314
1310
|
rules: {
|
|
1315
1311
|
...pluginVue.configs.base.rules,
|
|
1316
|
-
...pluginVue.configs["
|
|
1317
|
-
...pluginVue.configs["
|
|
1318
|
-
...pluginVue.configs["
|
|
1312
|
+
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1313
|
+
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1314
|
+
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
1319
1315
|
"node/prefer-global/process": "off",
|
|
1320
1316
|
"vue/block-order": [
|
|
1321
1317
|
"error",
|
|
@@ -1516,23 +1512,28 @@ var react = async (options) => {
|
|
|
1516
1512
|
compiler: enableCompiler = false,
|
|
1517
1513
|
overrides = {}
|
|
1518
1514
|
} = options;
|
|
1519
|
-
const [
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1515
|
+
const [pluginsReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
1516
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1517
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1518
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1519
|
+
]);
|
|
1520
|
+
const plugins = pluginsReact.configs.all.plugins;
|
|
1521
|
+
const {
|
|
1522
|
+
"@eslint-react": pluginReactX,
|
|
1523
|
+
"@eslint-react/dom": pluginReactDom,
|
|
1524
|
+
"@eslint-react/hooks-extra": pluginReactHooksExtra,
|
|
1525
|
+
"@eslint-react/naming-convention": pluginReactNamingConvention,
|
|
1526
|
+
"@eslint-react/web-api": pluginReactWebApi
|
|
1527
|
+
} = plugins;
|
|
1527
1528
|
const _react = [
|
|
1528
1529
|
{
|
|
1529
1530
|
name: "eslint/react/setup",
|
|
1530
1531
|
plugins: {
|
|
1531
|
-
"react":
|
|
1532
|
-
"react-dom":
|
|
1533
|
-
"react-hooks-extra":
|
|
1534
|
-
"react-naming-convention":
|
|
1535
|
-
"react-web-api":
|
|
1532
|
+
"react": pluginReactX,
|
|
1533
|
+
"react-dom": pluginReactDom,
|
|
1534
|
+
"react-hooks-extra": pluginReactHooksExtra,
|
|
1535
|
+
"react-naming-convention": pluginReactNamingConvention,
|
|
1536
|
+
"react-web-api": pluginReactWebApi,
|
|
1536
1537
|
"react-hooks": pluginReactHooks,
|
|
1537
1538
|
"react-refresh": pluginReactRefresh,
|
|
1538
1539
|
...enableCompiler ? {
|
|
@@ -1560,35 +1561,7 @@ var react = async (options) => {
|
|
|
1560
1561
|
}
|
|
1561
1562
|
},
|
|
1562
1563
|
rules: {
|
|
1563
|
-
|
|
1564
|
-
// recommended rules from @eslint-react/dom
|
|
1565
|
-
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
1566
|
-
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1567
|
-
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1568
|
-
"react-dom/no-find-dom-node": "error",
|
|
1569
|
-
"react-dom/no-missing-button-type": "warn",
|
|
1570
|
-
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1571
|
-
"react-dom/no-namespace": "error",
|
|
1572
|
-
"react-dom/no-render-return-value": "error",
|
|
1573
|
-
"react-dom/no-script-url": "warn",
|
|
1574
|
-
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1575
|
-
"react-dom/no-unsafe-target-blank": "warn",
|
|
1576
|
-
// recommended rules react-hooks
|
|
1577
|
-
"react-hooks/exhaustive-deps": "warn",
|
|
1578
|
-
"react-hooks/rules-of-hooks": "error",
|
|
1579
|
-
// React Refresh
|
|
1580
|
-
"react-refresh/only-export-components": "warn",
|
|
1581
|
-
// React Compiler
|
|
1582
|
-
...enableCompiler ? {
|
|
1583
|
-
"react-compiler/react-compiler": "error"
|
|
1584
|
-
} : {},
|
|
1585
|
-
// recommended rules from @eslint-react/web-api
|
|
1586
|
-
"react-web-api/no-leaked-event-listener": "warn",
|
|
1587
|
-
"react-web-api/no-leaked-interval": "warn",
|
|
1588
|
-
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1589
|
-
"react-web-api/no-leaked-timeout": "warn",
|
|
1590
|
-
// recommended rules from @eslint-react
|
|
1591
|
-
"react/ensure-forward-ref-using-ref": "warn",
|
|
1564
|
+
// recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
|
|
1592
1565
|
"react/jsx-no-duplicate-props": "warn",
|
|
1593
1566
|
"react/jsx-uses-vars": "warn",
|
|
1594
1567
|
"react/no-access-state-in-setstate": "error",
|
|
@@ -1607,11 +1580,11 @@ var react = async (options) => {
|
|
|
1607
1580
|
"react/no-create-ref": "error",
|
|
1608
1581
|
"react/no-default-props": "error",
|
|
1609
1582
|
"react/no-direct-mutation-state": "error",
|
|
1610
|
-
"react/no-duplicate-key": "
|
|
1583
|
+
"react/no-duplicate-key": "warn",
|
|
1611
1584
|
"react/no-forward-ref": "warn",
|
|
1612
1585
|
"react/no-implicit-key": "warn",
|
|
1613
1586
|
"react/no-missing-key": "error",
|
|
1614
|
-
"react/no-nested-
|
|
1587
|
+
"react/no-nested-component-definitions": "error",
|
|
1615
1588
|
"react/no-prop-types": "error",
|
|
1616
1589
|
"react/no-redundant-should-component-update": "error",
|
|
1617
1590
|
"react/no-set-state-in-component-did-mount": "warn",
|
|
@@ -1625,9 +1598,42 @@ var react = async (options) => {
|
|
|
1625
1598
|
"react/no-unstable-default-props": "warn",
|
|
1626
1599
|
"react/no-unused-class-component-members": "warn",
|
|
1627
1600
|
"react/no-unused-state": "warn",
|
|
1628
|
-
"react/
|
|
1629
|
-
"react/
|
|
1630
|
-
|
|
1601
|
+
"react/no-use-context": "warn",
|
|
1602
|
+
"react/no-useless-forward-ref": "warn",
|
|
1603
|
+
// recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rules
|
|
1604
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1605
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1606
|
+
"react-dom/no-find-dom-node": "error",
|
|
1607
|
+
"react-dom/no-flush-sync": "error",
|
|
1608
|
+
"react-dom/no-hydrate": "error",
|
|
1609
|
+
"react-dom/no-missing-button-type": "warn",
|
|
1610
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1611
|
+
"react-dom/no-namespace": "error",
|
|
1612
|
+
"react-dom/no-render": "error",
|
|
1613
|
+
"react-dom/no-render-return-value": "error",
|
|
1614
|
+
"react-dom/no-script-url": "warn",
|
|
1615
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1616
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
1617
|
+
"react-dom/no-use-form-state": "error",
|
|
1618
|
+
"react-dom/no-void-elements-with-children": "error",
|
|
1619
|
+
// recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
|
|
1620
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
1621
|
+
"react-hooks/rules-of-hooks": "error",
|
|
1622
|
+
// recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
|
|
1623
|
+
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
1624
|
+
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
|
|
1625
|
+
"react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
|
|
1626
|
+
// recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
|
|
1627
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1628
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1629
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1630
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1631
|
+
// React Refresh
|
|
1632
|
+
"react-refresh/only-export-components": "warn",
|
|
1633
|
+
// React Compiler
|
|
1634
|
+
...enableCompiler ? {
|
|
1635
|
+
"react-compiler/react-compiler": "error"
|
|
1636
|
+
} : {},
|
|
1631
1637
|
"jsx-quotes": ["error", "prefer-double"],
|
|
1632
1638
|
"react/react-in-jsx-scope": "off",
|
|
1633
1639
|
"react/jsx-indent": [1, 2],
|
|
@@ -1663,7 +1669,7 @@ async function tailwindcss() {
|
|
|
1663
1669
|
}
|
|
1664
1670
|
|
|
1665
1671
|
// src/factory.ts
|
|
1666
|
-
function defineConfig(options = {}) {
|
|
1672
|
+
function defineConfig(options = {}, ...userConfigs) {
|
|
1667
1673
|
const {
|
|
1668
1674
|
ignores: enableIgnores = true,
|
|
1669
1675
|
vue: enableVue,
|
|
@@ -1740,13 +1746,12 @@ function defineConfig(options = {}) {
|
|
|
1740
1746
|
})
|
|
1741
1747
|
);
|
|
1742
1748
|
}
|
|
1743
|
-
const merged = combine(...configs,
|
|
1749
|
+
const merged = combine(...configs, ...userConfigs);
|
|
1744
1750
|
return merged;
|
|
1745
1751
|
}
|
|
1746
|
-
var config = defineConfig;
|
|
1747
1752
|
|
|
1748
1753
|
// src/index.ts
|
|
1749
|
-
var index_default =
|
|
1754
|
+
var index_default = defineConfig;
|
|
1750
1755
|
export {
|
|
1751
1756
|
GLOB_ALL_SRC,
|
|
1752
1757
|
GLOB_ASTRO_TS,
|
|
@@ -1775,7 +1780,6 @@ export {
|
|
|
1775
1780
|
GLOB_YAML,
|
|
1776
1781
|
combine,
|
|
1777
1782
|
comments,
|
|
1778
|
-
config,
|
|
1779
1783
|
index_default as default,
|
|
1780
1784
|
defineConfig,
|
|
1781
1785
|
getConfigOptions,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.10.
|
|
4
|
+
"version": "3.10.2",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Brendan Dash <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -27,55 +27,55 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
30
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
31
|
-
"@eslint/markdown": "^6.
|
|
32
|
-
"@next/eslint-plugin-next": "^15.2.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
30
|
+
"@eslint-react/eslint-plugin": "^1.40.3",
|
|
31
|
+
"@eslint/markdown": "^6.3.0",
|
|
32
|
+
"@next/eslint-plugin-next": "^15.2.4",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
35
|
+
"@vitest/eslint-plugin": "^1.1.39",
|
|
36
36
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
37
|
-
"eslint-config-prettier": "^10.
|
|
38
|
-
"eslint-plugin-import-x": "^4.
|
|
39
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
40
|
-
"eslint-plugin-jsonc": "^2.
|
|
41
|
-
"eslint-plugin-n": "^17.
|
|
37
|
+
"eslint-config-prettier": "^10.1.1",
|
|
38
|
+
"eslint-plugin-import-x": "^4.10.0",
|
|
39
|
+
"eslint-plugin-jsdoc": "^50.6.9",
|
|
40
|
+
"eslint-plugin-jsonc": "^2.20.0",
|
|
41
|
+
"eslint-plugin-n": "^17.17.0",
|
|
42
42
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
43
|
-
"eslint-plugin-perfectionist": "^4.
|
|
44
|
-
"eslint-plugin-prettier": "^5.2.
|
|
43
|
+
"eslint-plugin-perfectionist": "^4.11.0",
|
|
44
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
45
45
|
"eslint-plugin-react-compiler": "latest",
|
|
46
46
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
47
47
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
48
48
|
"eslint-plugin-solid": "^0.14.5",
|
|
49
49
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
50
50
|
"eslint-plugin-toml": "^0.12.0",
|
|
51
|
-
"eslint-plugin-unicorn": "^
|
|
51
|
+
"eslint-plugin-unicorn": "^58.0.0",
|
|
52
52
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
53
|
-
"eslint-plugin-vue": "^
|
|
53
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
54
54
|
"eslint-plugin-yml": "^1.17.0",
|
|
55
55
|
"globals": "^16.0.0",
|
|
56
56
|
"jsonc-eslint-parser": "^2.4.0",
|
|
57
57
|
"prettier": "^3.5.3",
|
|
58
58
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
59
59
|
"toml-eslint-parser": "^0.10.0",
|
|
60
|
-
"vue-eslint-parser": "^
|
|
60
|
+
"vue-eslint-parser": "^10.1.2",
|
|
61
61
|
"yaml-eslint-parser": "^1.3.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@eslint/config-inspector": "^1.0.
|
|
64
|
+
"@eslint/config-inspector": "^1.0.2",
|
|
65
65
|
"@types/eslint": "^9.6.1",
|
|
66
66
|
"@types/fs-extra": "^11.0.4",
|
|
67
|
-
"@types/node": "^22.
|
|
68
|
-
"@types/react": "^19.0
|
|
69
|
-
"bumpp": "^10.0
|
|
70
|
-
"eslint": "^9.
|
|
67
|
+
"@types/node": "^22.14.0",
|
|
68
|
+
"@types/react": "^19.1.0",
|
|
69
|
+
"bumpp": "^10.1.0",
|
|
70
|
+
"eslint": "^9.23.0",
|
|
71
71
|
"execa": "^9.5.2",
|
|
72
72
|
"fast-glob": "^3.3.3",
|
|
73
73
|
"fs-extra": "^11.3.0",
|
|
74
|
-
"react": "^19.
|
|
74
|
+
"react": "^19.1.0",
|
|
75
75
|
"sucrase": "^3.35.0",
|
|
76
76
|
"tsup": "^8.4.0",
|
|
77
77
|
"typescript": "^5.8.2",
|
|
78
|
-
"vitest": "^3.
|
|
78
|
+
"vitest": "^3.1.1"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsup",
|