@debbl/eslint-config 3.3.2 → 3.4.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 CHANGED
@@ -32,17 +32,17 @@ pnpm i eslint @debbl/eslint-config -D
32
32
  - prettier
33
33
 
34
34
  ```js
35
- import { config } from "@debbl/eslint-config";
35
+ import { defineConfig } from "@debbl/eslint-config";
36
36
 
37
- export default config();
37
+ export default defineConfig();
38
38
  ```
39
39
 
40
40
  ## 配置 `Prettier`, 会覆盖默认的规则
41
41
 
42
42
  ```js
43
- import config from "./dist/index.js";
43
+ import { defineConfig } from "@debbl/eslint-config";
44
44
 
45
- export default config({
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,
@@ -944,6 +945,7 @@ var typeAwareRules = {
944
945
  "@typescript-eslint/no-unsafe-call": "error",
945
946
  "@typescript-eslint/no-unsafe-member-access": "error",
946
947
  "@typescript-eslint/no-unsafe-return": "error",
948
+ "@typescript-eslint/promise-function-async": "error",
947
949
  "@typescript-eslint/restrict-plus-operands": "error",
948
950
  "@typescript-eslint/restrict-template-expressions": "error",
949
951
  "@typescript-eslint/strict-boolean-expressions": "error",
@@ -1628,7 +1630,7 @@ async function tailwindcss() {
1628
1630
  function getConfigOption(options) {
1629
1631
  return options ? typeof options !== "boolean" ? options : {} : {};
1630
1632
  }
1631
- function config(options = {}) {
1633
+ function defineConfig(options = {}) {
1632
1634
  const {
1633
1635
  ignores: enableGitignore = true,
1634
1636
  vue: enableVue,
@@ -1708,6 +1710,7 @@ function config(options = {}) {
1708
1710
  const merged = combine(...configs, options.customConfig ?? []);
1709
1711
  return merged;
1710
1712
  }
1713
+ var config = defineConfig;
1711
1714
 
1712
1715
  // src/index.ts
1713
1716
  var src_default = config;
@@ -1740,6 +1743,7 @@ var src_default = config;
1740
1743
  combine,
1741
1744
  comments,
1742
1745
  config,
1746
+ defineConfig,
1743
1747
  ignores,
1744
1748
  imports,
1745
1749
  interopDefault,
package/dist/index.d.cts CHANGED
@@ -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 config(options?: OptionsConfig): Promise<ConfigItem[]>;
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
@@ -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 config(options?: OptionsConfig): Promise<ConfigItem[]>;
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
@@ -862,6 +862,7 @@ var typeAwareRules = {
862
862
  "@typescript-eslint/no-unsafe-call": "error",
863
863
  "@typescript-eslint/no-unsafe-member-access": "error",
864
864
  "@typescript-eslint/no-unsafe-return": "error",
865
+ "@typescript-eslint/promise-function-async": "error",
865
866
  "@typescript-eslint/restrict-plus-operands": "error",
866
867
  "@typescript-eslint/restrict-template-expressions": "error",
867
868
  "@typescript-eslint/strict-boolean-expressions": "error",
@@ -1546,7 +1547,7 @@ async function tailwindcss() {
1546
1547
  function getConfigOption(options) {
1547
1548
  return options ? typeof options !== "boolean" ? options : {} : {};
1548
1549
  }
1549
- function config(options = {}) {
1550
+ function defineConfig(options = {}) {
1550
1551
  const {
1551
1552
  ignores: enableGitignore = true,
1552
1553
  vue: enableVue,
@@ -1626,6 +1627,7 @@ function config(options = {}) {
1626
1627
  const merged = combine(...configs, options.customConfig ?? []);
1627
1628
  return merged;
1628
1629
  }
1630
+ var config = defineConfig;
1629
1631
 
1630
1632
  // src/index.ts
1631
1633
  var src_default = config;
@@ -1658,6 +1660,7 @@ export {
1658
1660
  comments,
1659
1661
  config,
1660
1662
  src_default as default,
1663
+ defineConfig,
1661
1664
  ignores,
1662
1665
  imports,
1663
1666
  interopDefault,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debbl/eslint-config",
3
3
  "type": "module",
4
- "version": "3.3.2",
4
+ "version": "3.4.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,45 +26,45 @@
26
26
  "eslint": ">=8.40.0"
27
27
  },
28
28
  "dependencies": {
29
- "@next/eslint-plugin-next": "^14.2.4",
30
- "@typescript-eslint/eslint-plugin": "^7.14.1",
31
- "@typescript-eslint/parser": "^7.14.1",
29
+ "@next/eslint-plugin-next": "^14.2.5",
30
+ "@typescript-eslint/eslint-plugin": "^7.16.1",
31
+ "@typescript-eslint/parser": "^7.16.1",
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": "^0.5.2",
36
- "eslint-plugin-jsdoc": "^48.5.0",
35
+ "eslint-plugin-import-x": "^3.0.1",
36
+ "eslint-plugin-jsdoc": "^48.8.2",
37
37
  "eslint-plugin-jsonc": "^2.16.0",
38
- "eslint-plugin-markdown": "^5.0.0",
38
+ "eslint-plugin-markdown": "^5.1.0",
39
39
  "eslint-plugin-mdx": "^3.1.5",
40
40
  "eslint-plugin-n": "^17.9.0",
41
41
  "eslint-plugin-no-only-tests": "^3.1.0",
42
42
  "eslint-plugin-perfectionist": "^2.11.0",
43
- "eslint-plugin-prettier": "^5.1.3",
44
- "eslint-plugin-react": "^7.34.3",
45
- "eslint-plugin-react-compiler": "latest",
43
+ "eslint-plugin-prettier": "^5.2.1",
44
+ "eslint-plugin-react": "^7.35.0",
45
+ "eslint-plugin-react-compiler": "0.0.0-experimental-0998c1e-20240625",
46
46
  "eslint-plugin-react-hooks": "4.6.2",
47
- "eslint-plugin-react-refresh": "^0.4.7",
47
+ "eslint-plugin-react-refresh": "^0.4.8",
48
48
  "eslint-plugin-solid": "^0.14.1",
49
49
  "eslint-plugin-tailwindcss": "^3.17.4",
50
50
  "eslint-plugin-toml": "^0.11.1",
51
51
  "eslint-plugin-unicorn": "^54.0.0",
52
- "eslint-plugin-unused-imports": "^3.2.0",
52
+ "eslint-plugin-unused-imports": "3.2.0",
53
53
  "eslint-plugin-vitest": "^0.5.4",
54
- "eslint-plugin-vue": "^9.26.0",
54
+ "eslint-plugin-vue": "^9.27.0",
55
55
  "eslint-plugin-yml": "^1.14.0",
56
- "globals": "^15.6.0",
56
+ "globals": "^15.8.0",
57
57
  "jsonc-eslint-parser": "^2.4.0",
58
- "prettier": "^3.3.2",
58
+ "prettier": "^3.3.3",
59
59
  "prettier-plugin-tailwindcss": "^0.6.5",
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.0",
65
+ "@eslint/config-inspector": "^0.5.2",
66
66
  "@types/eslint": "^8.56.10",
67
- "@types/node": "^20.14.9",
67
+ "@types/node": "^20.14.11",
68
68
  "@types/react": "^18.3.3",
69
69
  "bumpp": "^9.4.1",
70
70
  "eslint": "8.57.0",
@@ -73,9 +73,9 @@
73
73
  "fs-extra": "^11.2.0",
74
74
  "react": "^18.3.1",
75
75
  "sucrase": "^3.35.0",
76
- "tsup": "^8.1.0",
77
- "typescript": "^5.5.2",
78
- "vitest": "^1.6.0"
76
+ "tsup": "^8.2.0",
77
+ "typescript": "^5.5.3",
78
+ "vitest": "^2.0.3"
79
79
  },
80
80
  "scripts": {
81
81
  "build": "tsup --format esm,cjs --clean --dts",