@agilebot/eslint-config 0.8.1 → 0.8.3

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.
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.3
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+
10
+ //#region src/constants.ts
11
+ const JS_EXTS = [
12
+ ".js",
13
+ ".jsx",
14
+ ".cjs",
15
+ ".cjsx",
16
+ ".mjs",
17
+ ".mjsx"
18
+ ];
19
+ const TS_EXTS = [
20
+ ".ts",
21
+ ".tsx",
22
+ ".cts",
23
+ ".ctsx",
24
+ ".mts",
25
+ ".mtsx"
26
+ ];
27
+ const DTS_EXTS = [
28
+ ".d.ts",
29
+ ".d.cts",
30
+ ".d.mts"
31
+ ];
32
+ const VUE_EXTS = [".vue"];
33
+ const DEFAULT_EXTS = [
34
+ ...JS_EXTS,
35
+ ...TS_EXTS,
36
+ ...VUE_EXTS
37
+ ];
38
+ const JS_GLOBS = JS_EXTS.map((ext) => `**/*${ext}`);
39
+ const TS_GLOBS = TS_EXTS.map((ext) => `**/*${ext}`);
40
+ const DTS_GLOBS = DTS_EXTS.map((ext) => `**/*${ext}`);
41
+ const VUE_GLOBS = VUE_EXTS.map((ext) => `**/*${ext}`);
42
+ const DEFAULT_GLOBS = DEFAULT_EXTS.map((ext) => `**/*${ext}`);
43
+ const IGNORE_GLOBS = [
44
+ "**/node_modules",
45
+ "**/dist",
46
+ "**/package-lock.json",
47
+ "**/yarn.lock",
48
+ "**/pnpm-lock.yaml",
49
+ "**/bun.lockb",
50
+ "**/output",
51
+ "**/coverage",
52
+ "**/temp",
53
+ "**/.temp",
54
+ "**/tmp",
55
+ "**/.tmp",
56
+ "**/.history",
57
+ "**/.vitepress/cache",
58
+ "**/.nuxt",
59
+ "**/.next",
60
+ "**/.svelte-kit",
61
+ "**/.vercel",
62
+ "**/.changeset",
63
+ "**/.idea",
64
+ "**/.cache",
65
+ "**/.output",
66
+ "**/.vite-inspect",
67
+ "**/.yarn",
68
+ "**/vite.config.*.timestamp-*",
69
+ "**/CHANGELOG*.md",
70
+ "**/*.min.*",
71
+ "**/LICENSE*",
72
+ "**/__snapshots__",
73
+ "**/auto-import?(s).d.ts",
74
+ "**/components.d.ts"
75
+ ];
76
+ const CLI_NAME = "eslint-agilebot";
77
+
78
+ //#endregion
79
+ export { CLI_NAME, DEFAULT_GLOBS, DTS_GLOBS, IGNORE_GLOBS, JS_GLOBS, TS_GLOBS, VUE_GLOBS };
package/dist/index.d.mts CHANGED
@@ -1,106 +1,120 @@
1
- import { Linter } from 'eslint';
2
- import { Options as Options$2 } from 'prettier';
3
- import { Options as Options$1 } from '@cspell/eslint-plugin';
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.3
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
4
9
 
10
+ import { Options } from "@cspell/eslint-plugin";
11
+ import { Linter } from "eslint";
12
+ import { Options as Options$1 } from "prettier";
13
+
14
+ //#region src/types.d.ts
5
15
  interface FlatConfigItem extends Linter.Config {
6
- name: string;
7
- files: (string | string[])[];
8
- plugins?: Record<string, any>;
16
+ name: string;
17
+ files: (string | string[])[];
18
+ plugins?: Record<string, any>;
9
19
  }
10
-
11
- type Options = Options$1['cspell'];
12
-
20
+ //#endregion
21
+ //#region src/configs/cspell.d.ts
22
+ type Options$2 = Options['cspell'];
23
+ //#endregion
24
+ //#region src/configs/imports.d.ts
13
25
  interface ImportsOptions {
14
- /**
15
- * 额外的devDependencies
16
- * @default undefined
17
- */
18
- devDependencies?: string[];
19
- /**
20
- * monorepo前缀
21
- * @default undefined
22
- */
23
- monorepoScope?: string;
24
- /**
25
- * 核心模块
26
- * @default undefiend
27
- */
28
- coreModules?: string[];
29
- /**
30
- * 解析器
31
- * @default 'typescript'
32
- */
33
- resolver?: 'typescript' | 'oxc';
34
- /**
35
- * 是否允许相对路径
36
- * @default false
37
- */
38
- allowRelativePaths?: boolean;
39
- /**
40
- * 是否允许幽灵依赖
41
- * @default false
42
- */
43
- allowExtraneousDependencies?: boolean;
26
+ /**
27
+ * 额外的devDependencies
28
+ * @default undefined
29
+ */
30
+ devDependencies?: string[];
31
+ /**
32
+ * monorepo前缀
33
+ * @default undefined
34
+ */
35
+ monorepoScope?: string;
36
+ /**
37
+ * 核心模块
38
+ * @default undefiend
39
+ */
40
+ coreModules?: string[];
41
+ /**
42
+ * 是否允许相对路径
43
+ * @default false
44
+ */
45
+ allowRelativePaths?: boolean;
46
+ /**
47
+ * 是否允许幽灵依赖
48
+ * @default false
49
+ */
50
+ allowExtraneousDependencies?: boolean;
44
51
  }
45
-
52
+ /**
53
+ * eslint-plugin-import 规则
54
+ * @param packageDir 子包路径
55
+ * @param opts 参数
56
+ */
57
+ //#endregion
58
+ //#region src/factory/options.d.ts
46
59
  interface FactoryOptions {
47
- /**
48
- * Custom ESLint configuration to override or extend defaults
49
- * @default undefined
50
- */
51
- config?: Omit<FlatConfigItem, 'name' | 'files'>;
52
- /**
53
- * List of files to ignore
54
- * @default undefined
55
- */
56
- ignores?: string[];
57
- /**
58
- * Enable React-specific linting rules
59
- * @default undefined
60
- */
61
- react?: boolean | string;
62
- /**
63
- * Specify the Vue.js version for linting
64
- * @default undefined
65
- */
66
- vue?: number;
67
- /**
68
- * Enable ES module linting rules
69
- * @default undefined
70
- */
71
- module?: boolean;
72
- /**
73
- * Enable GoDaddy-specific linting configurations
74
- * @default undefined
75
- */
76
- godaddy?: boolean | 'typescript';
77
- /**
78
- * Enable or disable JSDoc linting rules
79
- * @default true
80
- */
81
- jsdoc?: boolean;
82
- /**
83
- * Enable Prettier for code formatting
84
- * @default true
85
- */
86
- prettier?: boolean | Options$2;
87
- /**
88
- * Enable Lodash-specific linting rules
89
- * @default true
90
- */
91
- lodash?: boolean;
92
- /**
93
- * Custom spelling configurations for CSpell
94
- * @default {}
95
- */
96
- cspell?: Options | false;
97
- /**
98
- * Enable or disable import linting rules
99
- * @default true
100
- */
101
- import?: ImportsOptions | boolean;
60
+ /**
61
+ * Custom ESLint configuration to override or extend defaults
62
+ * @default undefined
63
+ */
64
+ config?: Omit<FlatConfigItem, 'name' | 'files'>;
65
+ /**
66
+ * List of files to ignore
67
+ * @default undefined
68
+ */
69
+ ignores?: string[];
70
+ /**
71
+ * Enable React-specific linting rules
72
+ * @default undefined
73
+ */
74
+ react?: boolean | string;
75
+ /**
76
+ * Specify the Vue.js version for linting
77
+ * @default undefined
78
+ */
79
+ vue?: number;
80
+ /**
81
+ * Enable ES module linting rules
82
+ * @default undefined
83
+ */
84
+ module?: boolean;
85
+ /**
86
+ * Enable GoDaddy-specific linting configurations
87
+ * @default undefined
88
+ */
89
+ godaddy?: boolean | 'typescript';
90
+ /**
91
+ * Enable or disable JSDoc linting rules
92
+ * @default true
93
+ */
94
+ jsdoc?: boolean;
95
+ /**
96
+ * Enable Prettier for code formatting
97
+ * @default true
98
+ */
99
+ prettier?: boolean | Options$1;
100
+ /**
101
+ * Enable Lodash-specific linting rules
102
+ * @default true
103
+ */
104
+ lodash?: boolean;
105
+ /**
106
+ * Custom spelling configurations for CSpell
107
+ * @default {}
108
+ */
109
+ cspell?: Options$2 | false;
110
+ /**
111
+ * Enable or disable import linting rules
112
+ * @default true
113
+ */
114
+ import?: ImportsOptions | boolean;
102
115
  }
103
-
116
+ //#endregion
117
+ //#region src/factory/index.d.ts
104
118
  declare function factory(root: string | ImportMeta, options?: FactoryOptions): FlatConfigItem[];
105
-
106
- export { factory as agilebot };
119
+ //#endregion
120
+ export { factory as agilebot };
package/dist/index.d.ts CHANGED
@@ -1,106 +1,120 @@
1
- import { Linter } from 'eslint';
2
- import { Options as Options$2 } from 'prettier';
3
- import { Options as Options$1 } from '@cspell/eslint-plugin';
1
+ /**
2
+ * @license @agilebot/eslint-config v0.8.3
3
+ *
4
+ * Copyright (c) Agilebot, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
4
9
 
10
+ import { Linter } from "eslint";
11
+ import { Options } from "prettier";
12
+ import { Options as Options$1 } from "@cspell/eslint-plugin";
13
+
14
+ //#region src/types.d.ts
5
15
  interface FlatConfigItem extends Linter.Config {
6
- name: string;
7
- files: (string | string[])[];
8
- plugins?: Record<string, any>;
16
+ name: string;
17
+ files: (string | string[])[];
18
+ plugins?: Record<string, any>;
9
19
  }
10
-
11
- type Options = Options$1['cspell'];
12
-
20
+ //#endregion
21
+ //#region src/configs/cspell.d.ts
22
+ type Options$2 = Options$1['cspell'];
23
+ //#endregion
24
+ //#region src/configs/imports.d.ts
13
25
  interface ImportsOptions {
14
- /**
15
- * 额外的devDependencies
16
- * @default undefined
17
- */
18
- devDependencies?: string[];
19
- /**
20
- * monorepo前缀
21
- * @default undefined
22
- */
23
- monorepoScope?: string;
24
- /**
25
- * 核心模块
26
- * @default undefiend
27
- */
28
- coreModules?: string[];
29
- /**
30
- * 解析器
31
- * @default 'typescript'
32
- */
33
- resolver?: 'typescript' | 'oxc';
34
- /**
35
- * 是否允许相对路径
36
- * @default false
37
- */
38
- allowRelativePaths?: boolean;
39
- /**
40
- * 是否允许幽灵依赖
41
- * @default false
42
- */
43
- allowExtraneousDependencies?: boolean;
26
+ /**
27
+ * 额外的devDependencies
28
+ * @default undefined
29
+ */
30
+ devDependencies?: string[];
31
+ /**
32
+ * monorepo前缀
33
+ * @default undefined
34
+ */
35
+ monorepoScope?: string;
36
+ /**
37
+ * 核心模块
38
+ * @default undefiend
39
+ */
40
+ coreModules?: string[];
41
+ /**
42
+ * 是否允许相对路径
43
+ * @default false
44
+ */
45
+ allowRelativePaths?: boolean;
46
+ /**
47
+ * 是否允许幽灵依赖
48
+ * @default false
49
+ */
50
+ allowExtraneousDependencies?: boolean;
44
51
  }
45
-
52
+ /**
53
+ * eslint-plugin-import 规则
54
+ * @param packageDir 子包路径
55
+ * @param opts 参数
56
+ */
57
+ //#endregion
58
+ //#region src/factory/options.d.ts
46
59
  interface FactoryOptions {
47
- /**
48
- * Custom ESLint configuration to override or extend defaults
49
- * @default undefined
50
- */
51
- config?: Omit<FlatConfigItem, 'name' | 'files'>;
52
- /**
53
- * List of files to ignore
54
- * @default undefined
55
- */
56
- ignores?: string[];
57
- /**
58
- * Enable React-specific linting rules
59
- * @default undefined
60
- */
61
- react?: boolean | string;
62
- /**
63
- * Specify the Vue.js version for linting
64
- * @default undefined
65
- */
66
- vue?: number;
67
- /**
68
- * Enable ES module linting rules
69
- * @default undefined
70
- */
71
- module?: boolean;
72
- /**
73
- * Enable GoDaddy-specific linting configurations
74
- * @default undefined
75
- */
76
- godaddy?: boolean | 'typescript';
77
- /**
78
- * Enable or disable JSDoc linting rules
79
- * @default true
80
- */
81
- jsdoc?: boolean;
82
- /**
83
- * Enable Prettier for code formatting
84
- * @default true
85
- */
86
- prettier?: boolean | Options$2;
87
- /**
88
- * Enable Lodash-specific linting rules
89
- * @default true
90
- */
91
- lodash?: boolean;
92
- /**
93
- * Custom spelling configurations for CSpell
94
- * @default {}
95
- */
96
- cspell?: Options | false;
97
- /**
98
- * Enable or disable import linting rules
99
- * @default true
100
- */
101
- import?: ImportsOptions | boolean;
60
+ /**
61
+ * Custom ESLint configuration to override or extend defaults
62
+ * @default undefined
63
+ */
64
+ config?: Omit<FlatConfigItem, 'name' | 'files'>;
65
+ /**
66
+ * List of files to ignore
67
+ * @default undefined
68
+ */
69
+ ignores?: string[];
70
+ /**
71
+ * Enable React-specific linting rules
72
+ * @default undefined
73
+ */
74
+ react?: boolean | string;
75
+ /**
76
+ * Specify the Vue.js version for linting
77
+ * @default undefined
78
+ */
79
+ vue?: number;
80
+ /**
81
+ * Enable ES module linting rules
82
+ * @default undefined
83
+ */
84
+ module?: boolean;
85
+ /**
86
+ * Enable GoDaddy-specific linting configurations
87
+ * @default undefined
88
+ */
89
+ godaddy?: boolean | 'typescript';
90
+ /**
91
+ * Enable or disable JSDoc linting rules
92
+ * @default true
93
+ */
94
+ jsdoc?: boolean;
95
+ /**
96
+ * Enable Prettier for code formatting
97
+ * @default true
98
+ */
99
+ prettier?: boolean | Options;
100
+ /**
101
+ * Enable Lodash-specific linting rules
102
+ * @default true
103
+ */
104
+ lodash?: boolean;
105
+ /**
106
+ * Custom spelling configurations for CSpell
107
+ * @default {}
108
+ */
109
+ cspell?: Options$2 | false;
110
+ /**
111
+ * Enable or disable import linting rules
112
+ * @default true
113
+ */
114
+ import?: ImportsOptions | boolean;
102
115
  }
103
-
116
+ //#endregion
117
+ //#region src/factory/index.d.ts
104
118
  declare function factory(root: string | ImportMeta, options?: FactoryOptions): FlatConfigItem[];
105
-
106
- export { factory as agilebot };
119
+ //#endregion
120
+ export { factory as agilebot };