@debbl/eslint-config 3.3.2 → 3.5.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/README.md +14 -6
- package/dist/index.cjs +23 -16
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +22 -16
- package/package.json +32 -32
package/README.md
CHANGED
|
@@ -32,17 +32,17 @@ pnpm i eslint @debbl/eslint-config -D
|
|
|
32
32
|
- prettier
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
import {
|
|
35
|
+
import { defineConfig } from "@debbl/eslint-config";
|
|
36
36
|
|
|
37
|
-
export default
|
|
37
|
+
export default defineConfig();
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## 配置 `Prettier`, 会覆盖默认的规则
|
|
41
41
|
|
|
42
42
|
```js
|
|
43
|
-
import
|
|
43
|
+
import { defineConfig } from "@debbl/eslint-config";
|
|
44
44
|
|
|
45
|
-
export default
|
|
45
|
+
export default defineConfig({
|
|
46
46
|
typescript: true,
|
|
47
47
|
prettier: {
|
|
48
48
|
semi: false,
|
|
@@ -100,6 +100,13 @@ export interface OptionsConfig extends OptionsComponentExts {
|
|
|
100
100
|
*/
|
|
101
101
|
react?: boolean | GetConfigOption<ReactConfig>;
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Enable solid support, Passing an object to enable Next.js support.
|
|
105
|
+
*
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
solid?: boolean;
|
|
109
|
+
|
|
103
110
|
/**
|
|
104
111
|
* Enable JSONC support.
|
|
105
112
|
*
|
|
@@ -132,13 +139,14 @@ export interface OptionsConfig extends OptionsComponentExts {
|
|
|
132
139
|
*
|
|
133
140
|
* @default true
|
|
134
141
|
*/
|
|
135
|
-
prettier?: boolean | GetConfigOption<PrettierConfig>;
|
|
142
|
+
prettier?: boolean | Omit<GetConfigOption<PrettierConfig>, "tailwindcss">;
|
|
136
143
|
|
|
137
144
|
/**
|
|
138
145
|
* Enable Tailwind CSS support.
|
|
146
|
+
* if set to "prettier", it will use `prettier-plugin-tailwindcss` @see https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
139
147
|
* @default false
|
|
140
148
|
*/
|
|
141
|
-
tailwindcss?: boolean;
|
|
149
|
+
tailwindcss?: boolean | "prettier";
|
|
142
150
|
|
|
143
151
|
/**
|
|
144
152
|
* Custom config
|
package/dist/index.cjs
CHANGED
|
@@ -58,6 +58,7 @@ __export(src_exports, {
|
|
|
58
58
|
comments: () => comments,
|
|
59
59
|
config: () => config,
|
|
60
60
|
default: () => src_default,
|
|
61
|
+
defineConfig: () => defineConfig,
|
|
61
62
|
ignores: () => ignores,
|
|
62
63
|
imports: () => imports,
|
|
63
64
|
interopDefault: () => interopDefault,
|
|
@@ -262,7 +263,6 @@ var import_globals = __toESM(require("globals"), 1);
|
|
|
262
263
|
var javascript = async (options) => {
|
|
263
264
|
const { overrides = {} } = options;
|
|
264
265
|
const pluginUnusedImports = await interopDefault(
|
|
265
|
-
// @ts-expect-error missing types
|
|
266
266
|
import("eslint-plugin-unused-imports")
|
|
267
267
|
);
|
|
268
268
|
return [
|
|
@@ -930,24 +930,26 @@ var import_node_process = __toESM(require("process"), 1);
|
|
|
930
930
|
var typeAwareRules = {
|
|
931
931
|
"dot-notation": "off",
|
|
932
932
|
"no-implied-eval": "off",
|
|
933
|
-
"no-throw-literal": "off",
|
|
934
933
|
"@typescript-eslint/await-thenable": "error",
|
|
935
934
|
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
|
936
935
|
"@typescript-eslint/no-floating-promises": "error",
|
|
937
936
|
"@typescript-eslint/no-for-in-array": "error",
|
|
938
937
|
"@typescript-eslint/no-implied-eval": "error",
|
|
939
938
|
"@typescript-eslint/no-misused-promises": "error",
|
|
940
|
-
"@typescript-eslint/no-throw-literal": "error",
|
|
941
939
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
942
940
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
943
941
|
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
944
942
|
"@typescript-eslint/no-unsafe-call": "error",
|
|
945
943
|
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
946
944
|
"@typescript-eslint/no-unsafe-return": "error",
|
|
945
|
+
"@typescript-eslint/promise-function-async": "error",
|
|
947
946
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
948
947
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
949
|
-
"@typescript-eslint/
|
|
950
|
-
"@typescript-eslint/
|
|
948
|
+
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
949
|
+
"@typescript-eslint/strict-boolean-expressions": [
|
|
950
|
+
"error",
|
|
951
|
+
{ allowNullableBoolean: true, allowNullableObject: true }
|
|
952
|
+
],
|
|
951
953
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
952
954
|
"@typescript-eslint/unbound-method": "error"
|
|
953
955
|
};
|
|
@@ -997,18 +999,13 @@ var typescript = async (options) => {
|
|
|
997
999
|
"solid/no-unknown-namespaces": "off"
|
|
998
1000
|
} : {},
|
|
999
1001
|
"no-dupe-class-members": "off",
|
|
1000
|
-
"no-invalid-this": "off",
|
|
1001
1002
|
"no-loss-of-precision": "off",
|
|
1002
1003
|
"no-redeclare": "off",
|
|
1003
1004
|
"no-use-before-define": "off",
|
|
1004
1005
|
"no-useless-constructor": "off",
|
|
1005
1006
|
"@typescript-eslint/ban-ts-comment": [
|
|
1006
1007
|
"error",
|
|
1007
|
-
{ "ts-
|
|
1008
|
-
],
|
|
1009
|
-
"@typescript-eslint/ban-types": [
|
|
1010
|
-
"error",
|
|
1011
|
-
{ types: { Function: false } }
|
|
1008
|
+
{ "ts-expect-error": "allow-with-description" }
|
|
1012
1009
|
],
|
|
1013
1010
|
"@typescript-eslint/consistent-type-definitions": [
|
|
1014
1011
|
"error",
|
|
@@ -1016,16 +1013,22 @@ var typescript = async (options) => {
|
|
|
1016
1013
|
],
|
|
1017
1014
|
"@typescript-eslint/consistent-type-imports": [
|
|
1018
1015
|
"error",
|
|
1019
|
-
{
|
|
1016
|
+
{
|
|
1017
|
+
disallowTypeAnnotations: false,
|
|
1018
|
+
prefer: "type-imports"
|
|
1019
|
+
}
|
|
1020
1020
|
],
|
|
1021
1021
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
1022
1022
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
1023
1023
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1024
1024
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
1025
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
1026
|
+
"error",
|
|
1027
|
+
{ allowInterfaces: "always" }
|
|
1028
|
+
],
|
|
1025
1029
|
"@typescript-eslint/no-explicit-any": "off",
|
|
1026
1030
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
1027
1031
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
1028
|
-
"@typescript-eslint/no-invalid-this": "error",
|
|
1029
1032
|
"@typescript-eslint/no-invalid-void-type": "off",
|
|
1030
1033
|
"@typescript-eslint/no-loss-of-precision": "error",
|
|
1031
1034
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
@@ -1037,7 +1040,7 @@ var typescript = async (options) => {
|
|
|
1037
1040
|
{ classes: false, functions: false, variables: true }
|
|
1038
1041
|
],
|
|
1039
1042
|
"@typescript-eslint/no-useless-constructor": "off",
|
|
1040
|
-
"@typescript-eslint/
|
|
1043
|
+
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
1041
1044
|
"@typescript-eslint/triple-slash-reference": "off",
|
|
1042
1045
|
"@typescript-eslint/unified-signatures": "off",
|
|
1043
1046
|
...tsconfigPath ? typeAwareRules : {},
|
|
@@ -1363,14 +1366,17 @@ var test = async (options) => {
|
|
|
1363
1366
|
name: "eslint/test/rules",
|
|
1364
1367
|
files: GLOB_TESTS,
|
|
1365
1368
|
rules: {
|
|
1369
|
+
"node/prefer-global/process": "off",
|
|
1366
1370
|
"test/consistent-test-it": [
|
|
1367
1371
|
"error",
|
|
1368
1372
|
{ fn: "it", withinDescribe: "it" }
|
|
1369
1373
|
],
|
|
1370
1374
|
"test/no-identical-title": "error",
|
|
1375
|
+
"test/no-import-node-test": "error",
|
|
1371
1376
|
"test/no-only-tests": "error",
|
|
1372
1377
|
"test/prefer-hooks-in-order": "error",
|
|
1373
1378
|
"test/prefer-lowercase-title": "error",
|
|
1379
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1374
1380
|
...overrides
|
|
1375
1381
|
}
|
|
1376
1382
|
}
|
|
@@ -1380,7 +1386,6 @@ var test = async (options) => {
|
|
|
1380
1386
|
// src/configs/perfectionist.ts
|
|
1381
1387
|
async function perfectionist() {
|
|
1382
1388
|
const pluginPerfectionist = await interopDefault(
|
|
1383
|
-
// @ts-expect-error missing types
|
|
1384
1389
|
import("eslint-plugin-perfectionist")
|
|
1385
1390
|
);
|
|
1386
1391
|
return [
|
|
@@ -1628,7 +1633,7 @@ async function tailwindcss() {
|
|
|
1628
1633
|
function getConfigOption(options) {
|
|
1629
1634
|
return options ? typeof options !== "boolean" ? options : {} : {};
|
|
1630
1635
|
}
|
|
1631
|
-
function
|
|
1636
|
+
function defineConfig(options = {}) {
|
|
1632
1637
|
const {
|
|
1633
1638
|
ignores: enableGitignore = true,
|
|
1634
1639
|
vue: enableVue,
|
|
@@ -1708,6 +1713,7 @@ function config(options = {}) {
|
|
|
1708
1713
|
const merged = combine(...configs, options.customConfig ?? []);
|
|
1709
1714
|
return merged;
|
|
1710
1715
|
}
|
|
1716
|
+
var config = defineConfig;
|
|
1711
1717
|
|
|
1712
1718
|
// src/index.ts
|
|
1713
1719
|
var src_default = config;
|
|
@@ -1740,6 +1746,7 @@ var src_default = config;
|
|
|
1740
1746
|
combine,
|
|
1741
1747
|
comments,
|
|
1742
1748
|
config,
|
|
1749
|
+
defineConfig,
|
|
1743
1750
|
ignores,
|
|
1744
1751
|
imports,
|
|
1745
1752
|
interopDefault,
|
package/dist/index.d.cts
CHANGED
|
@@ -81,7 +81,7 @@ declare const prettier: PrettierConfig;
|
|
|
81
81
|
|
|
82
82
|
type Awaitable<T> = T | Promise<T>;
|
|
83
83
|
type GetConfigOption<T extends (...args: any) => any> = Parameters<T>[0];
|
|
84
|
-
interface ConfigItem extends Linter.
|
|
84
|
+
interface ConfigItem extends Linter.Config {
|
|
85
85
|
/**
|
|
86
86
|
* An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
|
|
87
87
|
*
|
|
@@ -207,7 +207,11 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
207
207
|
/**
|
|
208
208
|
* Construct an array of ESLint flat config items.
|
|
209
209
|
*/
|
|
210
|
-
declare function
|
|
210
|
+
declare function defineConfig(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated Use `defineConfig` instead.
|
|
213
|
+
*/
|
|
214
|
+
declare const config: typeof defineConfig;
|
|
211
215
|
|
|
212
216
|
declare const parserPlain: {
|
|
213
217
|
meta: {
|
|
@@ -267,4 +271,4 @@ declare const GLOB_TESTS: string[];
|
|
|
267
271
|
declare const GLOB_ALL_SRC: string[];
|
|
268
272
|
declare const GLOB_EXCLUDE: string[];
|
|
269
273
|
|
|
270
|
-
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, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
|
274
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ declare const prettier: PrettierConfig;
|
|
|
81
81
|
|
|
82
82
|
type Awaitable<T> = T | Promise<T>;
|
|
83
83
|
type GetConfigOption<T extends (...args: any) => any> = Parameters<T>[0];
|
|
84
|
-
interface ConfigItem extends Linter.
|
|
84
|
+
interface ConfigItem extends Linter.Config {
|
|
85
85
|
/**
|
|
86
86
|
* An object containing a name-value mapping of plugin names to plugin objects. When `files` is specified, these plugins are only available to the matching files.
|
|
87
87
|
*
|
|
@@ -207,7 +207,11 @@ interface OptionsConfig extends OptionsComponentExts {
|
|
|
207
207
|
/**
|
|
208
208
|
* Construct an array of ESLint flat config items.
|
|
209
209
|
*/
|
|
210
|
-
declare function
|
|
210
|
+
declare function defineConfig(options?: OptionsConfig): Promise<ConfigItem[]>;
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated Use `defineConfig` instead.
|
|
213
|
+
*/
|
|
214
|
+
declare const config: typeof defineConfig;
|
|
211
215
|
|
|
212
216
|
declare const parserPlain: {
|
|
213
217
|
meta: {
|
|
@@ -267,4 +271,4 @@ declare const GLOB_TESTS: string[];
|
|
|
267
271
|
declare const GLOB_ALL_SRC: string[];
|
|
268
272
|
declare const GLOB_EXCLUDE: string[];
|
|
269
273
|
|
|
270
|
-
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, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, prettier, sortPackageJson, sortTsconfig, test, toml, typescript, unicorn, vue, yml };
|
|
274
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -180,7 +180,6 @@ import globals from "globals";
|
|
|
180
180
|
var javascript = async (options) => {
|
|
181
181
|
const { overrides = {} } = options;
|
|
182
182
|
const pluginUnusedImports = await interopDefault(
|
|
183
|
-
// @ts-expect-error missing types
|
|
184
183
|
import("eslint-plugin-unused-imports")
|
|
185
184
|
);
|
|
186
185
|
return [
|
|
@@ -848,24 +847,26 @@ import process2 from "process";
|
|
|
848
847
|
var typeAwareRules = {
|
|
849
848
|
"dot-notation": "off",
|
|
850
849
|
"no-implied-eval": "off",
|
|
851
|
-
"no-throw-literal": "off",
|
|
852
850
|
"@typescript-eslint/await-thenable": "error",
|
|
853
851
|
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
|
854
852
|
"@typescript-eslint/no-floating-promises": "error",
|
|
855
853
|
"@typescript-eslint/no-for-in-array": "error",
|
|
856
854
|
"@typescript-eslint/no-implied-eval": "error",
|
|
857
855
|
"@typescript-eslint/no-misused-promises": "error",
|
|
858
|
-
"@typescript-eslint/no-throw-literal": "error",
|
|
859
856
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
860
857
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
861
858
|
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
862
859
|
"@typescript-eslint/no-unsafe-call": "error",
|
|
863
860
|
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
864
861
|
"@typescript-eslint/no-unsafe-return": "error",
|
|
862
|
+
"@typescript-eslint/promise-function-async": "error",
|
|
865
863
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
866
864
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
867
|
-
"@typescript-eslint/
|
|
868
|
-
"@typescript-eslint/
|
|
865
|
+
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
866
|
+
"@typescript-eslint/strict-boolean-expressions": [
|
|
867
|
+
"error",
|
|
868
|
+
{ allowNullableBoolean: true, allowNullableObject: true }
|
|
869
|
+
],
|
|
869
870
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
870
871
|
"@typescript-eslint/unbound-method": "error"
|
|
871
872
|
};
|
|
@@ -915,18 +916,13 @@ var typescript = async (options) => {
|
|
|
915
916
|
"solid/no-unknown-namespaces": "off"
|
|
916
917
|
} : {},
|
|
917
918
|
"no-dupe-class-members": "off",
|
|
918
|
-
"no-invalid-this": "off",
|
|
919
919
|
"no-loss-of-precision": "off",
|
|
920
920
|
"no-redeclare": "off",
|
|
921
921
|
"no-use-before-define": "off",
|
|
922
922
|
"no-useless-constructor": "off",
|
|
923
923
|
"@typescript-eslint/ban-ts-comment": [
|
|
924
924
|
"error",
|
|
925
|
-
{ "ts-
|
|
926
|
-
],
|
|
927
|
-
"@typescript-eslint/ban-types": [
|
|
928
|
-
"error",
|
|
929
|
-
{ types: { Function: false } }
|
|
925
|
+
{ "ts-expect-error": "allow-with-description" }
|
|
930
926
|
],
|
|
931
927
|
"@typescript-eslint/consistent-type-definitions": [
|
|
932
928
|
"error",
|
|
@@ -934,16 +930,22 @@ var typescript = async (options) => {
|
|
|
934
930
|
],
|
|
935
931
|
"@typescript-eslint/consistent-type-imports": [
|
|
936
932
|
"error",
|
|
937
|
-
{
|
|
933
|
+
{
|
|
934
|
+
disallowTypeAnnotations: false,
|
|
935
|
+
prefer: "type-imports"
|
|
936
|
+
}
|
|
938
937
|
],
|
|
939
938
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
940
939
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
941
940
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
942
941
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
942
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
943
|
+
"error",
|
|
944
|
+
{ allowInterfaces: "always" }
|
|
945
|
+
],
|
|
943
946
|
"@typescript-eslint/no-explicit-any": "off",
|
|
944
947
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
945
948
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
946
|
-
"@typescript-eslint/no-invalid-this": "error",
|
|
947
949
|
"@typescript-eslint/no-invalid-void-type": "off",
|
|
948
950
|
"@typescript-eslint/no-loss-of-precision": "error",
|
|
949
951
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
@@ -955,7 +957,7 @@ var typescript = async (options) => {
|
|
|
955
957
|
{ classes: false, functions: false, variables: true }
|
|
956
958
|
],
|
|
957
959
|
"@typescript-eslint/no-useless-constructor": "off",
|
|
958
|
-
"@typescript-eslint/
|
|
960
|
+
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
959
961
|
"@typescript-eslint/triple-slash-reference": "off",
|
|
960
962
|
"@typescript-eslint/unified-signatures": "off",
|
|
961
963
|
...tsconfigPath ? typeAwareRules : {},
|
|
@@ -1281,14 +1283,17 @@ var test = async (options) => {
|
|
|
1281
1283
|
name: "eslint/test/rules",
|
|
1282
1284
|
files: GLOB_TESTS,
|
|
1283
1285
|
rules: {
|
|
1286
|
+
"node/prefer-global/process": "off",
|
|
1284
1287
|
"test/consistent-test-it": [
|
|
1285
1288
|
"error",
|
|
1286
1289
|
{ fn: "it", withinDescribe: "it" }
|
|
1287
1290
|
],
|
|
1288
1291
|
"test/no-identical-title": "error",
|
|
1292
|
+
"test/no-import-node-test": "error",
|
|
1289
1293
|
"test/no-only-tests": "error",
|
|
1290
1294
|
"test/prefer-hooks-in-order": "error",
|
|
1291
1295
|
"test/prefer-lowercase-title": "error",
|
|
1296
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
1292
1297
|
...overrides
|
|
1293
1298
|
}
|
|
1294
1299
|
}
|
|
@@ -1298,7 +1303,6 @@ var test = async (options) => {
|
|
|
1298
1303
|
// src/configs/perfectionist.ts
|
|
1299
1304
|
async function perfectionist() {
|
|
1300
1305
|
const pluginPerfectionist = await interopDefault(
|
|
1301
|
-
// @ts-expect-error missing types
|
|
1302
1306
|
import("eslint-plugin-perfectionist")
|
|
1303
1307
|
);
|
|
1304
1308
|
return [
|
|
@@ -1546,7 +1550,7 @@ async function tailwindcss() {
|
|
|
1546
1550
|
function getConfigOption(options) {
|
|
1547
1551
|
return options ? typeof options !== "boolean" ? options : {} : {};
|
|
1548
1552
|
}
|
|
1549
|
-
function
|
|
1553
|
+
function defineConfig(options = {}) {
|
|
1550
1554
|
const {
|
|
1551
1555
|
ignores: enableGitignore = true,
|
|
1552
1556
|
vue: enableVue,
|
|
@@ -1626,6 +1630,7 @@ function config(options = {}) {
|
|
|
1626
1630
|
const merged = combine(...configs, options.customConfig ?? []);
|
|
1627
1631
|
return merged;
|
|
1628
1632
|
}
|
|
1633
|
+
var config = defineConfig;
|
|
1629
1634
|
|
|
1630
1635
|
// src/index.ts
|
|
1631
1636
|
var src_default = config;
|
|
@@ -1658,6 +1663,7 @@ export {
|
|
|
1658
1663
|
comments,
|
|
1659
1664
|
config,
|
|
1660
1665
|
src_default as default,
|
|
1666
|
+
defineConfig,
|
|
1661
1667
|
ignores,
|
|
1662
1668
|
imports,
|
|
1663
1669
|
interopDefault,
|
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.5.0",
|
|
5
5
|
"description": "Brendan Dash's ESLint config",
|
|
6
6
|
"author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,56 +26,56 @@
|
|
|
26
26
|
"eslint": ">=8.40.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@next/eslint-plugin-next": "
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
31
|
-
"@typescript-eslint/parser": "^
|
|
29
|
+
"@next/eslint-plugin-next": "15.0.0-rc.0",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^8.3.0",
|
|
31
|
+
"@typescript-eslint/parser": "^8.3.0",
|
|
32
32
|
"eslint-config-prettier": "^9.1.0",
|
|
33
33
|
"eslint-mdx": "^3.1.5",
|
|
34
34
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
35
|
-
"eslint-plugin-import-x": "^
|
|
36
|
-
"eslint-plugin-jsdoc": "^
|
|
35
|
+
"eslint-plugin-import-x": "^4.1.1",
|
|
36
|
+
"eslint-plugin-jsdoc": "^50.2.2",
|
|
37
37
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
38
|
-
"eslint-plugin-markdown": "^5.
|
|
38
|
+
"eslint-plugin-markdown": "^5.1.0",
|
|
39
39
|
"eslint-plugin-mdx": "^3.1.5",
|
|
40
|
-
"eslint-plugin-n": "^17.
|
|
41
|
-
"eslint-plugin-no-only-tests": "^3.
|
|
42
|
-
"eslint-plugin-perfectionist": "^
|
|
43
|
-
"eslint-plugin-prettier": "^5.1
|
|
44
|
-
"eslint-plugin-react": "^7.
|
|
45
|
-
"eslint-plugin-react-compiler": "
|
|
46
|
-
"eslint-plugin-react-hooks": "
|
|
47
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
48
|
-
"eslint-plugin-solid": "^0.14.
|
|
40
|
+
"eslint-plugin-n": "^17.10.2",
|
|
41
|
+
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
42
|
+
"eslint-plugin-perfectionist": "^3.3.0",
|
|
43
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
44
|
+
"eslint-plugin-react": "^7.35.0",
|
|
45
|
+
"eslint-plugin-react-compiler": "0.0.0-experimental-b8a7b48-20240830",
|
|
46
|
+
"eslint-plugin-react-hooks": "0.0.0-experimental-e56f4ae3-20240830",
|
|
47
|
+
"eslint-plugin-react-refresh": "^0.4.11",
|
|
48
|
+
"eslint-plugin-solid": "^0.14.2",
|
|
49
49
|
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
50
50
|
"eslint-plugin-toml": "^0.11.1",
|
|
51
|
-
"eslint-plugin-unicorn": "^
|
|
52
|
-
"eslint-plugin-unused-imports": "^
|
|
51
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
52
|
+
"eslint-plugin-unused-imports": "^4.1.3",
|
|
53
53
|
"eslint-plugin-vitest": "^0.5.4",
|
|
54
|
-
"eslint-plugin-vue": "^9.
|
|
54
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
55
55
|
"eslint-plugin-yml": "^1.14.0",
|
|
56
|
-
"globals": "^15.
|
|
56
|
+
"globals": "^15.9.0",
|
|
57
57
|
"jsonc-eslint-parser": "^2.4.0",
|
|
58
|
-
"prettier": "^3.3.
|
|
59
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
58
|
+
"prettier": "^3.3.3",
|
|
59
|
+
"prettier-plugin-tailwindcss": "^0.6.6",
|
|
60
60
|
"toml-eslint-parser": "^0.10.0",
|
|
61
61
|
"vue-eslint-parser": "^9.4.3",
|
|
62
62
|
"yaml-eslint-parser": "^1.2.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@eslint/config-inspector": "^0.5.
|
|
66
|
-
"@types/eslint": "^
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"@types/react": "^18.3.
|
|
69
|
-
"bumpp": "^9.
|
|
70
|
-
"eslint": "
|
|
71
|
-
"execa": "^9.3.
|
|
65
|
+
"@eslint/config-inspector": "^0.5.4",
|
|
66
|
+
"@types/eslint": "^9.6.1",
|
|
67
|
+
"@types/node": "^22.5.1",
|
|
68
|
+
"@types/react": "^18.3.5",
|
|
69
|
+
"bumpp": "^9.5.2",
|
|
70
|
+
"eslint": "^9.9.1",
|
|
71
|
+
"execa": "^9.3.1",
|
|
72
72
|
"fast-glob": "^3.3.2",
|
|
73
73
|
"fs-extra": "^11.2.0",
|
|
74
74
|
"react": "^18.3.1",
|
|
75
75
|
"sucrase": "^3.35.0",
|
|
76
|
-
"tsup": "^8.
|
|
77
|
-
"typescript": "^5.5.
|
|
78
|
-
"vitest": "^
|
|
76
|
+
"tsup": "^8.2.4",
|
|
77
|
+
"typescript": "^5.5.4",
|
|
78
|
+
"vitest": "^2.0.5"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsup --format esm,cjs --clean --dts",
|