@debbl/eslint-config 3.8.9 → 3.9.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 +32 -34
- package/dist/index.d.cts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +30 -33
- package/package.json +39 -37
package/dist/index.cjs
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
GLOB_ALL_SRC: () => GLOB_ALL_SRC,
|
|
34
34
|
GLOB_CSS: () => GLOB_CSS,
|
|
35
35
|
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
@@ -57,8 +57,9 @@ __export(src_exports, {
|
|
|
57
57
|
combine: () => combine,
|
|
58
58
|
comments: () => comments,
|
|
59
59
|
config: () => config,
|
|
60
|
-
default: () =>
|
|
60
|
+
default: () => index_default,
|
|
61
61
|
defineConfig: () => defineConfig,
|
|
62
|
+
getConfigOptions: () => getConfigOptions,
|
|
62
63
|
ignores: () => ignores,
|
|
63
64
|
imports: () => imports,
|
|
64
65
|
interopDefault: () => interopDefault,
|
|
@@ -79,7 +80,7 @@ __export(src_exports, {
|
|
|
79
80
|
vue: () => vue,
|
|
80
81
|
yml: () => yml
|
|
81
82
|
});
|
|
82
|
-
module.exports = __toCommonJS(
|
|
83
|
+
module.exports = __toCommonJS(index_exports);
|
|
83
84
|
|
|
84
85
|
// src/utils.ts
|
|
85
86
|
var parserPlain = {
|
|
@@ -110,6 +111,9 @@ async function interopDefault(m) {
|
|
|
110
111
|
const resolved = await m;
|
|
111
112
|
return resolved.default || resolved;
|
|
112
113
|
}
|
|
114
|
+
function getConfigOptions(options) {
|
|
115
|
+
return options ? typeof options !== "boolean" ? options : {} : {};
|
|
116
|
+
}
|
|
113
117
|
|
|
114
118
|
// src/configs/comments.ts
|
|
115
119
|
async function comments() {
|
|
@@ -133,10 +137,6 @@ async function comments() {
|
|
|
133
137
|
];
|
|
134
138
|
}
|
|
135
139
|
|
|
136
|
-
// src/configs/ignores.ts
|
|
137
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
|
138
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
139
|
-
|
|
140
140
|
// src/globs.ts
|
|
141
141
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
142
142
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -205,20 +205,14 @@ var GLOB_EXCLUDE = [
|
|
|
205
205
|
];
|
|
206
206
|
|
|
207
207
|
// src/configs/ignores.ts
|
|
208
|
-
var REGEX_SPLIT_ALL_CRLF = /\r?\n/g;
|
|
209
|
-
var splitPattern = (pattern) => pattern.split(REGEX_SPLIT_ALL_CRLF);
|
|
210
208
|
var ignores = async (options) => {
|
|
211
209
|
const { enableGitignore = true, files = [] } = options;
|
|
212
|
-
|
|
210
|
+
const gitIgnores = [];
|
|
213
211
|
if (enableGitignore) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const gitignorePath = import_node_path.default.join(process.cwd(), ignorePath);
|
|
219
|
-
if (import_node_fs.default.existsSync(gitignorePath)) {
|
|
220
|
-
gitIgnores = splitPattern(import_node_fs.default.readFileSync(gitignorePath).toString()).filter((i) => !(i.startsWith("#") || i.length === 0)).map((i) => i.startsWith("/") ? i.slice(1) : i);
|
|
221
|
-
}
|
|
212
|
+
const gitignore = await interopDefault(
|
|
213
|
+
import("eslint-config-flat-gitignore")
|
|
214
|
+
);
|
|
215
|
+
gitIgnores.push(...gitignore(getConfigOptions(enableGitignore)).ignores);
|
|
222
216
|
}
|
|
223
217
|
let ignores2 = [...GLOB_EXCLUDE, ...gitIgnores];
|
|
224
218
|
if (typeof files === "function") {
|
|
@@ -228,6 +222,7 @@ var ignores = async (options) => {
|
|
|
228
222
|
}
|
|
229
223
|
return [
|
|
230
224
|
{
|
|
225
|
+
name: "eslint/ignores",
|
|
231
226
|
ignores: [...GLOB_EXCLUDE, ...ignores2]
|
|
232
227
|
}
|
|
233
228
|
];
|
|
@@ -1589,7 +1584,6 @@ var react = async (options) => {
|
|
|
1589
1584
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1590
1585
|
[
|
|
1591
1586
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1592
|
-
// @ts-expect-error missing types
|
|
1593
1587
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1594
1588
|
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1595
1589
|
]
|
|
@@ -1603,6 +1597,7 @@ var react = async (options) => {
|
|
|
1603
1597
|
"react-dom": plugins["@eslint-react/dom"],
|
|
1604
1598
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1605
1599
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1600
|
+
"react-web-api": plugins["@eslint-react/web-api"],
|
|
1606
1601
|
"react-hooks": pluginReactHooks,
|
|
1607
1602
|
"react-refresh": pluginReactRefresh,
|
|
1608
1603
|
...enableCompiler ? {
|
|
@@ -1652,6 +1647,11 @@ var react = async (options) => {
|
|
|
1652
1647
|
...enableCompiler ? {
|
|
1653
1648
|
"react-compiler/react-compiler": "error"
|
|
1654
1649
|
} : {},
|
|
1650
|
+
// recommended rules from @eslint-react/web-api
|
|
1651
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1652
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1653
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1654
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1655
1655
|
// recommended rules from @eslint-react
|
|
1656
1656
|
"react/ensure-forward-ref-using-ref": "warn",
|
|
1657
1657
|
"react/jsx-no-duplicate-props": "warn",
|
|
@@ -1728,12 +1728,9 @@ async function tailwindcss() {
|
|
|
1728
1728
|
}
|
|
1729
1729
|
|
|
1730
1730
|
// src/factory.ts
|
|
1731
|
-
function getConfigOption(options) {
|
|
1732
|
-
return options ? typeof options !== "boolean" ? options : {} : {};
|
|
1733
|
-
}
|
|
1734
1731
|
function defineConfig(options = {}) {
|
|
1735
1732
|
const {
|
|
1736
|
-
ignores:
|
|
1733
|
+
ignores: enableIgnores = true,
|
|
1737
1734
|
vue: enableVue,
|
|
1738
1735
|
react: enableReact,
|
|
1739
1736
|
solid: enableSolid,
|
|
@@ -1743,7 +1740,7 @@ function defineConfig(options = {}) {
|
|
|
1743
1740
|
} = options;
|
|
1744
1741
|
const configs = [];
|
|
1745
1742
|
configs.push(
|
|
1746
|
-
ignores(
|
|
1743
|
+
ignores(getConfigOptions(enableIgnores)),
|
|
1747
1744
|
javascript(options.javascript ?? {}),
|
|
1748
1745
|
comments(),
|
|
1749
1746
|
node(),
|
|
@@ -1763,36 +1760,36 @@ function defineConfig(options = {}) {
|
|
|
1763
1760
|
);
|
|
1764
1761
|
}
|
|
1765
1762
|
if (options.test ?? true) {
|
|
1766
|
-
configs.push(test(
|
|
1763
|
+
configs.push(test(getConfigOptions(options.test)));
|
|
1767
1764
|
}
|
|
1768
1765
|
if (enableVue) {
|
|
1769
1766
|
configs.push(
|
|
1770
1767
|
vue({
|
|
1771
|
-
...
|
|
1768
|
+
...getConfigOptions(options.vue),
|
|
1772
1769
|
typescript: !!enableTypeScript
|
|
1773
1770
|
})
|
|
1774
1771
|
);
|
|
1775
1772
|
}
|
|
1776
1773
|
if (enableReact) {
|
|
1777
|
-
configs.push(react(
|
|
1774
|
+
configs.push(react(getConfigOptions(enableReact)));
|
|
1778
1775
|
}
|
|
1779
1776
|
if (options.jsonc ?? true) {
|
|
1780
1777
|
configs.push(
|
|
1781
|
-
jsonc(
|
|
1778
|
+
jsonc(getConfigOptions(options.jsonc)),
|
|
1782
1779
|
sortPackageJson(),
|
|
1783
1780
|
sortTsconfig()
|
|
1784
1781
|
);
|
|
1785
1782
|
}
|
|
1786
1783
|
if (options.yml ?? true) {
|
|
1787
|
-
configs.push(yml(
|
|
1784
|
+
configs.push(yml(getConfigOptions(options.yml)));
|
|
1788
1785
|
}
|
|
1789
1786
|
if (options.toml ?? true) {
|
|
1790
|
-
configs.push(toml(
|
|
1787
|
+
configs.push(toml(getConfigOptions(options.toml)));
|
|
1791
1788
|
}
|
|
1792
1789
|
if (options.markdown ?? true) {
|
|
1793
1790
|
configs.push(
|
|
1794
1791
|
markdown({
|
|
1795
|
-
...
|
|
1792
|
+
...getConfigOptions(options.markdown),
|
|
1796
1793
|
componentExts
|
|
1797
1794
|
})
|
|
1798
1795
|
);
|
|
@@ -1803,7 +1800,7 @@ function defineConfig(options = {}) {
|
|
|
1803
1800
|
if (options.prettier ?? true) {
|
|
1804
1801
|
configs.push(
|
|
1805
1802
|
prettier({
|
|
1806
|
-
...
|
|
1803
|
+
...getConfigOptions(options.prettier),
|
|
1807
1804
|
tailwindcss: enableTailwindcss === "prettier"
|
|
1808
1805
|
})
|
|
1809
1806
|
);
|
|
@@ -1814,7 +1811,7 @@ function defineConfig(options = {}) {
|
|
|
1814
1811
|
var config = defineConfig;
|
|
1815
1812
|
|
|
1816
1813
|
// src/index.ts
|
|
1817
|
-
var
|
|
1814
|
+
var index_default = config;
|
|
1818
1815
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1819
1816
|
0 && (module.exports = {
|
|
1820
1817
|
GLOB_ALL_SRC,
|
|
@@ -1845,6 +1842,7 @@ var src_default = config;
|
|
|
1845
1842
|
comments,
|
|
1846
1843
|
config,
|
|
1847
1844
|
defineConfig,
|
|
1845
|
+
getConfigOptions,
|
|
1848
1846
|
ignores,
|
|
1849
1847
|
imports,
|
|
1850
1848
|
interopDefault,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
2
2
|
import { Linter } from 'eslint';
|
|
3
|
+
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
4
|
import { RequiredOptions } from 'prettier';
|
|
4
5
|
|
|
5
6
|
declare function comments(): Promise<ConfigItem[]>;
|
|
6
7
|
|
|
7
8
|
type IgnoresConfig = (options: {
|
|
8
|
-
enableGitignore?: boolean |
|
|
9
|
-
ignorePath: string;
|
|
10
|
-
};
|
|
9
|
+
enableGitignore?: boolean | Omit<FlatGitignoreOptions, "name">;
|
|
11
10
|
files?: ((files: string[]) => string[]) | string[];
|
|
12
11
|
}) => ReturnType<ConfigFn>;
|
|
13
12
|
declare const ignores: IgnoresConfig;
|
|
@@ -123,6 +122,12 @@ interface OptionsHasTypeScript {
|
|
|
123
122
|
typescript?: boolean;
|
|
124
123
|
}
|
|
125
124
|
interface OptionsConfig extends OptionsComponentExts {
|
|
125
|
+
/**
|
|
126
|
+
* Enable gitignore support.
|
|
127
|
+
* Passing an object to configure the options.
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
gitignore?: boolean | FlatGitignoreOptions;
|
|
126
131
|
/**
|
|
127
132
|
* Enable gitignore support.
|
|
128
133
|
* Passing an object to configure the options.
|
|
@@ -277,5 +282,6 @@ declare function combine(...configs: Awaitable<ConfigItem | ConfigItem[]>[]): Pr
|
|
|
277
282
|
declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
278
283
|
default: infer U;
|
|
279
284
|
} ? U : T>;
|
|
285
|
+
declare function getConfigOptions<T>(options: T): {};
|
|
280
286
|
|
|
281
|
-
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, 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, config, config as default, defineConfig, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
|
287
|
+
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, 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, config, config 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
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
2
2
|
import { Linter } from 'eslint';
|
|
3
|
+
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
4
|
import { RequiredOptions } from 'prettier';
|
|
4
5
|
|
|
5
6
|
declare function comments(): Promise<ConfigItem[]>;
|
|
6
7
|
|
|
7
8
|
type IgnoresConfig = (options: {
|
|
8
|
-
enableGitignore?: boolean |
|
|
9
|
-
ignorePath: string;
|
|
10
|
-
};
|
|
9
|
+
enableGitignore?: boolean | Omit<FlatGitignoreOptions, "name">;
|
|
11
10
|
files?: ((files: string[]) => string[]) | string[];
|
|
12
11
|
}) => ReturnType<ConfigFn>;
|
|
13
12
|
declare const ignores: IgnoresConfig;
|
|
@@ -123,6 +122,12 @@ interface OptionsHasTypeScript {
|
|
|
123
122
|
typescript?: boolean;
|
|
124
123
|
}
|
|
125
124
|
interface OptionsConfig extends OptionsComponentExts {
|
|
125
|
+
/**
|
|
126
|
+
* Enable gitignore support.
|
|
127
|
+
* Passing an object to configure the options.
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
gitignore?: boolean | FlatGitignoreOptions;
|
|
126
131
|
/**
|
|
127
132
|
* Enable gitignore support.
|
|
128
133
|
* Passing an object to configure the options.
|
|
@@ -277,5 +282,6 @@ declare function combine(...configs: Awaitable<ConfigItem | ConfigItem[]>[]): Pr
|
|
|
277
282
|
declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
278
283
|
default: infer U;
|
|
279
284
|
} ? U : T>;
|
|
285
|
+
declare function getConfigOptions<T>(options: T): {};
|
|
280
286
|
|
|
281
|
-
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, 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, config, config as default, defineConfig, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
|
287
|
+
export { type Awaitable, type ConfigFn, type ConfigItem, GLOB_ALL_SRC, 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, config, config 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
|
@@ -27,6 +27,9 @@ async function interopDefault(m) {
|
|
|
27
27
|
const resolved = await m;
|
|
28
28
|
return resolved.default || resolved;
|
|
29
29
|
}
|
|
30
|
+
function getConfigOptions(options) {
|
|
31
|
+
return options ? typeof options !== "boolean" ? options : {} : {};
|
|
32
|
+
}
|
|
30
33
|
|
|
31
34
|
// src/configs/comments.ts
|
|
32
35
|
async function comments() {
|
|
@@ -50,10 +53,6 @@ async function comments() {
|
|
|
50
53
|
];
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
// src/configs/ignores.ts
|
|
54
|
-
import fs from "node:fs";
|
|
55
|
-
import path from "node:path";
|
|
56
|
-
|
|
57
56
|
// src/globs.ts
|
|
58
57
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
59
58
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -122,20 +121,14 @@ var GLOB_EXCLUDE = [
|
|
|
122
121
|
];
|
|
123
122
|
|
|
124
123
|
// src/configs/ignores.ts
|
|
125
|
-
var REGEX_SPLIT_ALL_CRLF = /\r?\n/g;
|
|
126
|
-
var splitPattern = (pattern) => pattern.split(REGEX_SPLIT_ALL_CRLF);
|
|
127
124
|
var ignores = async (options) => {
|
|
128
125
|
const { enableGitignore = true, files = [] } = options;
|
|
129
|
-
|
|
126
|
+
const gitIgnores = [];
|
|
130
127
|
if (enableGitignore) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const gitignorePath = path.join(process.cwd(), ignorePath);
|
|
136
|
-
if (fs.existsSync(gitignorePath)) {
|
|
137
|
-
gitIgnores = splitPattern(fs.readFileSync(gitignorePath).toString()).filter((i) => !(i.startsWith("#") || i.length === 0)).map((i) => i.startsWith("/") ? i.slice(1) : i);
|
|
138
|
-
}
|
|
128
|
+
const gitignore = await interopDefault(
|
|
129
|
+
import("eslint-config-flat-gitignore")
|
|
130
|
+
);
|
|
131
|
+
gitIgnores.push(...gitignore(getConfigOptions(enableGitignore)).ignores);
|
|
139
132
|
}
|
|
140
133
|
let ignores2 = [...GLOB_EXCLUDE, ...gitIgnores];
|
|
141
134
|
if (typeof files === "function") {
|
|
@@ -145,6 +138,7 @@ var ignores = async (options) => {
|
|
|
145
138
|
}
|
|
146
139
|
return [
|
|
147
140
|
{
|
|
141
|
+
name: "eslint/ignores",
|
|
148
142
|
ignores: [...GLOB_EXCLUDE, ...ignores2]
|
|
149
143
|
}
|
|
150
144
|
];
|
|
@@ -1073,7 +1067,7 @@ var toml = async (options) => {
|
|
|
1073
1067
|
};
|
|
1074
1068
|
|
|
1075
1069
|
// src/configs/typescript.ts
|
|
1076
|
-
import
|
|
1070
|
+
import process from "node:process";
|
|
1077
1071
|
var typeAwareRules = {
|
|
1078
1072
|
"dot-notation": "off",
|
|
1079
1073
|
"no-implied-eval": "off",
|
|
@@ -1133,7 +1127,7 @@ var typescript = async (options) => {
|
|
|
1133
1127
|
sourceType: "module",
|
|
1134
1128
|
...tsconfigPath ? {
|
|
1135
1129
|
project: [tsconfigPath],
|
|
1136
|
-
tsconfigRootDir:
|
|
1130
|
+
tsconfigRootDir: process.cwd()
|
|
1137
1131
|
} : {},
|
|
1138
1132
|
...parserOptions
|
|
1139
1133
|
}
|
|
@@ -1506,7 +1500,6 @@ var react = async (options) => {
|
|
|
1506
1500
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
1507
1501
|
[
|
|
1508
1502
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1509
|
-
// @ts-expect-error missing types
|
|
1510
1503
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1511
1504
|
interopDefault(import("eslint-plugin-react-refresh"))
|
|
1512
1505
|
]
|
|
@@ -1520,6 +1513,7 @@ var react = async (options) => {
|
|
|
1520
1513
|
"react-dom": plugins["@eslint-react/dom"],
|
|
1521
1514
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1522
1515
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1516
|
+
"react-web-api": plugins["@eslint-react/web-api"],
|
|
1523
1517
|
"react-hooks": pluginReactHooks,
|
|
1524
1518
|
"react-refresh": pluginReactRefresh,
|
|
1525
1519
|
...enableCompiler ? {
|
|
@@ -1569,6 +1563,11 @@ var react = async (options) => {
|
|
|
1569
1563
|
...enableCompiler ? {
|
|
1570
1564
|
"react-compiler/react-compiler": "error"
|
|
1571
1565
|
} : {},
|
|
1566
|
+
// recommended rules from @eslint-react/web-api
|
|
1567
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1568
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1569
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1570
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1572
1571
|
// recommended rules from @eslint-react
|
|
1573
1572
|
"react/ensure-forward-ref-using-ref": "warn",
|
|
1574
1573
|
"react/jsx-no-duplicate-props": "warn",
|
|
@@ -1645,12 +1644,9 @@ async function tailwindcss() {
|
|
|
1645
1644
|
}
|
|
1646
1645
|
|
|
1647
1646
|
// src/factory.ts
|
|
1648
|
-
function getConfigOption(options) {
|
|
1649
|
-
return options ? typeof options !== "boolean" ? options : {} : {};
|
|
1650
|
-
}
|
|
1651
1647
|
function defineConfig(options = {}) {
|
|
1652
1648
|
const {
|
|
1653
|
-
ignores:
|
|
1649
|
+
ignores: enableIgnores = true,
|
|
1654
1650
|
vue: enableVue,
|
|
1655
1651
|
react: enableReact,
|
|
1656
1652
|
solid: enableSolid,
|
|
@@ -1660,7 +1656,7 @@ function defineConfig(options = {}) {
|
|
|
1660
1656
|
} = options;
|
|
1661
1657
|
const configs = [];
|
|
1662
1658
|
configs.push(
|
|
1663
|
-
ignores(
|
|
1659
|
+
ignores(getConfigOptions(enableIgnores)),
|
|
1664
1660
|
javascript(options.javascript ?? {}),
|
|
1665
1661
|
comments(),
|
|
1666
1662
|
node(),
|
|
@@ -1680,36 +1676,36 @@ function defineConfig(options = {}) {
|
|
|
1680
1676
|
);
|
|
1681
1677
|
}
|
|
1682
1678
|
if (options.test ?? true) {
|
|
1683
|
-
configs.push(test(
|
|
1679
|
+
configs.push(test(getConfigOptions(options.test)));
|
|
1684
1680
|
}
|
|
1685
1681
|
if (enableVue) {
|
|
1686
1682
|
configs.push(
|
|
1687
1683
|
vue({
|
|
1688
|
-
...
|
|
1684
|
+
...getConfigOptions(options.vue),
|
|
1689
1685
|
typescript: !!enableTypeScript
|
|
1690
1686
|
})
|
|
1691
1687
|
);
|
|
1692
1688
|
}
|
|
1693
1689
|
if (enableReact) {
|
|
1694
|
-
configs.push(react(
|
|
1690
|
+
configs.push(react(getConfigOptions(enableReact)));
|
|
1695
1691
|
}
|
|
1696
1692
|
if (options.jsonc ?? true) {
|
|
1697
1693
|
configs.push(
|
|
1698
|
-
jsonc(
|
|
1694
|
+
jsonc(getConfigOptions(options.jsonc)),
|
|
1699
1695
|
sortPackageJson(),
|
|
1700
1696
|
sortTsconfig()
|
|
1701
1697
|
);
|
|
1702
1698
|
}
|
|
1703
1699
|
if (options.yml ?? true) {
|
|
1704
|
-
configs.push(yml(
|
|
1700
|
+
configs.push(yml(getConfigOptions(options.yml)));
|
|
1705
1701
|
}
|
|
1706
1702
|
if (options.toml ?? true) {
|
|
1707
|
-
configs.push(toml(
|
|
1703
|
+
configs.push(toml(getConfigOptions(options.toml)));
|
|
1708
1704
|
}
|
|
1709
1705
|
if (options.markdown ?? true) {
|
|
1710
1706
|
configs.push(
|
|
1711
1707
|
markdown({
|
|
1712
|
-
...
|
|
1708
|
+
...getConfigOptions(options.markdown),
|
|
1713
1709
|
componentExts
|
|
1714
1710
|
})
|
|
1715
1711
|
);
|
|
@@ -1720,7 +1716,7 @@ function defineConfig(options = {}) {
|
|
|
1720
1716
|
if (options.prettier ?? true) {
|
|
1721
1717
|
configs.push(
|
|
1722
1718
|
prettier({
|
|
1723
|
-
...
|
|
1719
|
+
...getConfigOptions(options.prettier),
|
|
1724
1720
|
tailwindcss: enableTailwindcss === "prettier"
|
|
1725
1721
|
})
|
|
1726
1722
|
);
|
|
@@ -1731,7 +1727,7 @@ function defineConfig(options = {}) {
|
|
|
1731
1727
|
var config = defineConfig;
|
|
1732
1728
|
|
|
1733
1729
|
// src/index.ts
|
|
1734
|
-
var
|
|
1730
|
+
var index_default = config;
|
|
1735
1731
|
export {
|
|
1736
1732
|
GLOB_ALL_SRC,
|
|
1737
1733
|
GLOB_CSS,
|
|
@@ -1760,8 +1756,9 @@ export {
|
|
|
1760
1756
|
combine,
|
|
1761
1757
|
comments,
|
|
1762
1758
|
config,
|
|
1763
|
-
|
|
1759
|
+
index_default as default,
|
|
1764
1760
|
defineConfig,
|
|
1761
|
+
getConfigOptions,
|
|
1765
1762
|
ignores,
|
|
1766
1763
|
imports,
|
|
1767
1764
|
interopDefault,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debbl/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.9.0",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "Brendan Dash <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/Debbl/eslint-config",
|
|
9
9
|
"keywords": [
|
|
@@ -27,64 +27,66 @@
|
|
|
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.2.
|
|
32
|
-
"@next/eslint-plugin-next": "^15.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
36
|
-
"eslint-config-
|
|
30
|
+
"@eslint-react/eslint-plugin": "^1.30.0",
|
|
31
|
+
"@eslint/markdown": "^6.2.2",
|
|
32
|
+
"@next/eslint-plugin-next": "^15.2.0",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.25.0",
|
|
35
|
+
"@vitest/eslint-plugin": "^1.1.36",
|
|
36
|
+
"eslint-config-flat-gitignore": "^2.1.0",
|
|
37
|
+
"eslint-config-prettier": "^10.0.2",
|
|
37
38
|
"eslint-plugin-import-x": "^4.6.1",
|
|
38
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
39
|
-
"eslint-plugin-jsonc": "^2.
|
|
40
|
-
"eslint-plugin-n": "^17.
|
|
39
|
+
"eslint-plugin-jsdoc": "^50.6.3",
|
|
40
|
+
"eslint-plugin-jsonc": "^2.19.1",
|
|
41
|
+
"eslint-plugin-n": "^17.16.1",
|
|
41
42
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
42
|
-
"eslint-plugin-perfectionist": "^4.
|
|
43
|
-
"eslint-plugin-prettier": "^5.2.
|
|
43
|
+
"eslint-plugin-perfectionist": "^4.9.0",
|
|
44
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
44
45
|
"eslint-plugin-react-compiler": "latest",
|
|
45
|
-
"eslint-plugin-react-hooks": "^5.
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
46
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
47
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
47
48
|
"eslint-plugin-solid": "^0.14.5",
|
|
48
|
-
"eslint-plugin-tailwindcss": "^3.
|
|
49
|
+
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
49
50
|
"eslint-plugin-toml": "^0.12.0",
|
|
50
|
-
"eslint-plugin-unicorn": "^
|
|
51
|
+
"eslint-plugin-unicorn": "^57.0.0",
|
|
51
52
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
52
53
|
"eslint-plugin-vue": "^9.32.0",
|
|
53
|
-
"eslint-plugin-yml": "^1.
|
|
54
|
-
"globals": "^
|
|
54
|
+
"eslint-plugin-yml": "^1.17.0",
|
|
55
|
+
"globals": "^16.0.0",
|
|
55
56
|
"jsonc-eslint-parser": "^2.4.0",
|
|
56
|
-
"prettier": "^3.
|
|
57
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
57
|
+
"prettier": "^3.5.3",
|
|
58
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
58
59
|
"toml-eslint-parser": "^0.10.0",
|
|
59
60
|
"vue-eslint-parser": "^9.4.3",
|
|
60
|
-
"yaml-eslint-parser": "^1.
|
|
61
|
+
"yaml-eslint-parser": "^1.3.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
|
-
"@eslint/config-inspector": "^0.
|
|
64
|
+
"@eslint/config-inspector": "^1.0.1",
|
|
64
65
|
"@types/eslint": "^9.6.1",
|
|
65
|
-
"@types/
|
|
66
|
-
"@types/
|
|
67
|
-
"
|
|
68
|
-
"
|
|
66
|
+
"@types/fs-extra": "^11.0.4",
|
|
67
|
+
"@types/node": "^22.13.8",
|
|
68
|
+
"@types/react": "^19.0.10",
|
|
69
|
+
"bumpp": "^10.0.3",
|
|
70
|
+
"eslint": "^9.21.0",
|
|
69
71
|
"execa": "^9.5.2",
|
|
70
|
-
"fast-glob": "^3.3.
|
|
71
|
-
"fs-extra": "^11.
|
|
72
|
+
"fast-glob": "^3.3.3",
|
|
73
|
+
"fs-extra": "^11.3.0",
|
|
72
74
|
"react": "^19.0.0",
|
|
73
75
|
"sucrase": "^3.35.0",
|
|
74
|
-
"tsup": "^8.
|
|
75
|
-
"typescript": "^5.
|
|
76
|
-
"vitest": "^
|
|
76
|
+
"tsup": "^8.4.0",
|
|
77
|
+
"typescript": "^5.8.2",
|
|
78
|
+
"vitest": "^3.0.7"
|
|
77
79
|
},
|
|
78
80
|
"scripts": {
|
|
79
|
-
"build": "tsup
|
|
81
|
+
"build": "tsup",
|
|
80
82
|
"stub": "tsup --format esm",
|
|
81
|
-
"dev": "
|
|
83
|
+
"dev": "pnpm build && pnpm dlx @eslint/config-inspector --config eslint.config.js",
|
|
82
84
|
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
|
|
83
85
|
"watch": "tsup --format esm,cjs --watch",
|
|
84
86
|
"test": "vitest",
|
|
85
87
|
"typecheck": "tsc --noEmit",
|
|
86
|
-
"lint": "pnpm run stub && eslint
|
|
87
|
-
"lint:fix": "pnpm run stub && eslint
|
|
88
|
+
"lint": "pnpm run stub && eslint",
|
|
89
|
+
"lint:fix": "pnpm run stub && eslint --fix",
|
|
88
90
|
"release": "pnpm build && bumpp && pnpm publish"
|
|
89
91
|
}
|
|
90
92
|
}
|