@debbl/eslint-config 1.0.0-beta.10 → 1.0.0-beta.12

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.d.ts CHANGED
@@ -1,66 +1,17 @@
1
1
  import { FlatESLintConfigItem } from 'eslint-define-config';
2
+ import { OptionsConfigBasic } from '@debbl/eslint-config-basic';
2
3
  export { basic, comments, ignores, imports, js, jsdoc, jsonc, markdown, node, sortPackageJson, sortTsconfig, test, unicorn, yml } from '@debbl/eslint-config-basic';
4
+ import { OptionsConfigReact } from '@debbl/eslint-config-react';
5
+ export { react } from '@debbl/eslint-config-react';
6
+ import { OptionsConfigSolid } from '@debbl/eslint-config-solid';
7
+ export { solid } from '@debbl/eslint-config-solid';
8
+ import { OptionsConfigTs } from '@debbl/eslint-config-ts';
3
9
  export { ts, tsWithLanguageServer } from '@debbl/eslint-config-ts';
4
- export { prettier } from '@debbl/eslint-config-prettier';
10
+ import { OptionsConfigVue } from '@debbl/eslint-config-vue';
5
11
  export { vue } from '@debbl/eslint-config-vue';
6
- export { solid } from '@debbl/eslint-config-solid';
7
- export { react } from '@debbl/eslint-config-react';
8
-
9
- declare const OFF = 0;
10
-
11
- declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
12
- declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
13
- declare const GLOB_JS = "**/*.?([cm])js";
14
- declare const GLOB_JSX = "**/*.?([cm])jsx";
15
- declare const GLOB_TS = "**/*.?([cm])ts";
16
- declare const GLOB_TSX = "**/*.?([cm])tsx";
17
- declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
18
- declare const GLOB_CSS = "**/*.css";
19
- declare const GLOB_LESS = "**/*.less";
20
- declare const GLOB_SCSS = "**/*.scss";
21
- declare const GLOB_JSON = "**/*.json";
22
- declare const GLOB_JSON5 = "**/*.json5";
23
- declare const GLOB_JSONC = "**/*.jsonc";
24
- declare const GLOB_MARKDOWN = "**/*.md";
25
- declare const GLOB_VUE = "**/*.vue";
26
- declare const GLOB_YAML = "**/*.y?(a)ml";
27
- declare const GLOB_HTML = "**/*.htm?(l)";
28
- declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
29
- declare const GLOB_TESTS: string[];
30
- declare const GLOB_ALL_SRC: string[];
31
- declare const GLOB_EXCLUDE: string[];
12
+ export { prettier } from '@debbl/eslint-config-prettier';
32
13
 
33
- interface OptionsTypeScriptWithLanguageServer {
34
- tsconfigPath: string;
35
- tsconfigRootDir?: string;
36
- }
37
- interface OptionsComponentExts {
38
- /**
39
- * Additional extensions for components.
40
- *
41
- * @example ['vue']
42
- * @default []
43
- */
44
- componentExts?: string[];
45
- }
46
- interface OptionsIsInEditor {
47
- isInEditor?: boolean;
48
- }
49
- type OptionsHasTypeScript = Pick<OptionsConfig, "ts">;
50
- interface OptionsConfig {
51
- /**
52
- * Enable TypeScript support.
53
- *
54
- * Passing an object to enable TypeScript Language Server support.
55
- * @default true
56
- */
57
- ts?: boolean | OptionsTypeScriptWithLanguageServer;
58
- /**
59
- * Enable test support.
60
- *
61
- * @default true
62
- */
63
- test?: boolean;
14
+ type OptionsConfig = OptionsConfigBasic & OptionsConfigTs & OptionsConfigReact & OptionsConfigVue & OptionsConfigSolid & {
64
15
  /**
65
16
  * Enable Vue support.
66
17
  *
@@ -80,60 +31,22 @@ interface OptionsConfig {
80
31
  */
81
32
  solid?: boolean;
82
33
  /**
83
- * Enable TailwindCSS support.
84
- *
85
- * @default false
86
- */
87
- tailwindcss?: boolean;
88
- /**
89
- * Enable TailwindCSS support.
34
+ * Enable Prettier support.
90
35
  *
91
36
  * @default true
92
37
  */
93
38
  prettier?: boolean;
94
39
  /**
95
- * Enable JSONC support.
96
- *
97
- * @default true
98
- */
99
- jsonc?: boolean;
100
- /**
101
- * Enable YAML support.
102
- *
103
- * @default true
104
- */
105
- yaml?: boolean;
106
- /**
107
- * Enable Markdown support.
108
- *
109
- * @default true
110
- */
111
- markdown?: boolean;
112
- /**
113
- * Enable stylistic rules.
40
+ * Enable TailwindCSS support.
114
41
  *
115
- * @default true
116
- */
117
- stylistic?: boolean;
118
- /**
119
- * Control to disable some rules in editors.
120
- * @default auto-detect based on the process.env
42
+ * @default false
121
43
  */
122
- isInEditor?: boolean;
123
- }
124
- interface OptionsConfigBasic extends Pick<OptionsConfig, "ts" | "isInEditor" | "test" | "jsonc" | "yaml" | "markdown"> {
125
- componentExts?: string[];
126
- }
127
-
128
- /**
129
- * Combine array and non-array configs into a single array.
130
- * @param configs
131
- */
132
- declare function combine(...configs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
44
+ tailwindcss?: boolean;
45
+ };
133
46
 
134
47
  /**
135
48
  * Construct an array of ESLint flat config items.
136
49
  */
137
50
  declare function config(options?: OptionsConfig, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
138
51
 
139
- export { 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_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OFF, OptionsComponentExts, OptionsConfig, OptionsConfigBasic, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, combine, config, config as default };
52
+ export { OptionsConfig, config, config as default };
package/dist/index.js CHANGED
@@ -1,81 +1,11 @@
1
1
  // src/factory.ts
2
- import { basic } from "@debbl/eslint-config-basic";
2
+ import { basic, combine } from "@debbl/eslint-config-basic";
3
3
  import { ts } from "@debbl/eslint-config-ts";
4
4
  import { vue } from "@debbl/eslint-config-vue";
5
5
  import { react } from "@debbl/eslint-config-react";
6
6
  import { solid } from "@debbl/eslint-config-solid";
7
7
  import { tailwindcss } from "@debbl/eslint-config-tailwindcss";
8
8
  import { prettier } from "@debbl/eslint-config-prettier";
9
-
10
- // ../../src/flags.ts
11
- var OFF = 0;
12
-
13
- // ../../src/globs.ts
14
- var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
15
- var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
16
- var GLOB_JS = "**/*.?([cm])js";
17
- var GLOB_JSX = "**/*.?([cm])jsx";
18
- var GLOB_TS = "**/*.?([cm])ts";
19
- var GLOB_TSX = "**/*.?([cm])tsx";
20
- var GLOB_STYLE = "**/*.{c,le,sc}ss";
21
- var GLOB_CSS = "**/*.css";
22
- var GLOB_LESS = "**/*.less";
23
- var GLOB_SCSS = "**/*.scss";
24
- var GLOB_JSON = "**/*.json";
25
- var GLOB_JSON5 = "**/*.json5";
26
- var GLOB_JSONC = "**/*.jsonc";
27
- var GLOB_MARKDOWN = "**/*.md";
28
- var GLOB_VUE = "**/*.vue";
29
- var GLOB_YAML = "**/*.y?(a)ml";
30
- var GLOB_HTML = "**/*.htm?(l)";
31
- var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
32
- var GLOB_TESTS = [
33
- `**/__tests__/**/*.${GLOB_SRC_EXT}`,
34
- `**/*.spec.${GLOB_SRC_EXT}`,
35
- `**/*.test.${GLOB_SRC_EXT}`
36
- ];
37
- var GLOB_ALL_SRC = [
38
- GLOB_SRC,
39
- GLOB_STYLE,
40
- GLOB_JSON,
41
- GLOB_JSON5,
42
- GLOB_MARKDOWN,
43
- GLOB_VUE,
44
- GLOB_YAML,
45
- GLOB_HTML
46
- ];
47
- var GLOB_EXCLUDE = [
48
- "**/node_modules",
49
- "**/dist",
50
- "**/package-lock.json",
51
- "**/yarn.lock",
52
- "**/pnpm-lock.yaml",
53
- "**/output",
54
- "**/coverage",
55
- "**/temp",
56
- "**/.vitepress/cache",
57
- "**/.nuxt",
58
- "**/.vercel",
59
- "**/.changeset",
60
- "**/.idea",
61
- "**/.output",
62
- "**/.vite-inspect",
63
- "**/CHANGELOG*.md",
64
- "**/*.min.*",
65
- "**/LICENSE*",
66
- "**/__snapshots__",
67
- "**/auto-import?(s).d.ts",
68
- "**/components.d.ts"
69
- ];
70
-
71
- // ../../src/utils.ts
72
- function combine(...configs) {
73
- return configs.flatMap(
74
- (config2) => Array.isArray(config2) ? config2 : [config2]
75
- );
76
- }
77
-
78
- // src/factory.ts
79
9
  function config(options = {}, ...userConfigs) {
80
10
  const enableVue = options.vue;
81
11
  const enableReact = options.react;
@@ -91,7 +21,7 @@ function config(options = {}, ...userConfigs) {
91
21
  else if (enableSolid)
92
22
  configs.push(solid(options));
93
23
  else if (enableTypeScript)
94
- configs.push(ts({ ...options }));
24
+ configs.push(ts(options));
95
25
  else
96
26
  configs.push(basic(options));
97
27
  enableTailwindcss && configs.push(tailwindcss());
@@ -123,30 +53,7 @@ import { solid as solid2 } from "@debbl/eslint-config-solid";
123
53
  import { react as react2 } from "@debbl/eslint-config-react";
124
54
  var src_default = config;
125
55
  export {
126
- GLOB_ALL_SRC,
127
- GLOB_CSS,
128
- GLOB_EXCLUDE,
129
- GLOB_HTML,
130
- GLOB_JS,
131
- GLOB_JSON,
132
- GLOB_JSON5,
133
- GLOB_JSONC,
134
- GLOB_JSX,
135
- GLOB_LESS,
136
- GLOB_MARKDOWN,
137
- GLOB_MARKDOWN_CODE,
138
- GLOB_SCSS,
139
- GLOB_SRC,
140
- GLOB_SRC_EXT,
141
- GLOB_STYLE,
142
- GLOB_TESTS,
143
- GLOB_TS,
144
- GLOB_TSX,
145
- GLOB_VUE,
146
- GLOB_YAML,
147
- OFF,
148
56
  basic2 as basic,
149
- combine,
150
57
  comments,
151
58
  config,
152
59
  src_default as default,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debbl/eslint-config",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.10",
4
+ "version": "1.0.0-beta.12",
5
5
  "description": "",
6
6
  "author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
7
7
  "license": "MIT",
@@ -18,13 +18,13 @@
18
18
  "eslint": ">=8.24.0"
19
19
  },
20
20
  "dependencies": {
21
- "@debbl/eslint-config-basic": "1.0.0-beta.10",
22
- "@debbl/eslint-config-solid": "1.0.0-beta.10",
23
- "@debbl/eslint-config-ts": "1.0.0-beta.10",
24
- "@debbl/eslint-config-react": "1.0.0-beta.10",
25
- "@debbl/eslint-config-vue": "1.0.0-beta.10",
26
- "@debbl/eslint-config-prettier": "1.0.0-beta.10",
27
- "@debbl/eslint-config-tailwindcss": "1.0.0-beta.10"
21
+ "@debbl/eslint-config-basic": "1.0.0-beta.12",
22
+ "@debbl/eslint-config-prettier": "1.0.0-beta.12",
23
+ "@debbl/eslint-config-react": "1.0.0-beta.12",
24
+ "@debbl/eslint-config-solid": "1.0.0-beta.12",
25
+ "@debbl/eslint-config-tailwindcss": "1.0.0-beta.12",
26
+ "@debbl/eslint-config-vue": "1.0.0-beta.12",
27
+ "@debbl/eslint-config-ts": "1.0.0-beta.12"
28
28
  },
29
29
  "devDependencies": {
30
30
  "eslint": "^8.50.0"