@kazupon/eslint-config 0.7.0 → 0.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.
Files changed (66) hide show
  1. package/README.md +15 -12
  2. package/dist/config.d.cts +6 -1
  3. package/dist/config.d.ts +6 -1
  4. package/dist/configs/comments.d.cts +14 -3
  5. package/dist/configs/comments.d.ts +14 -3
  6. package/dist/configs/index.d.cts +1 -0
  7. package/dist/configs/index.d.ts +1 -0
  8. package/dist/configs/javascript.d.cts +14 -3
  9. package/dist/configs/javascript.d.ts +14 -3
  10. package/dist/configs/jsdoc.d.cts +24 -4
  11. package/dist/configs/jsdoc.d.ts +24 -4
  12. package/dist/configs/jsonc.d.cts +36 -6
  13. package/dist/configs/jsonc.d.ts +36 -6
  14. package/dist/configs/prettier.d.cts +14 -3
  15. package/dist/configs/prettier.d.ts +14 -3
  16. package/dist/configs/promise.d.cts +15 -0
  17. package/dist/configs/promise.d.ts +15 -0
  18. package/dist/configs/regexp.d.cts +14 -3
  19. package/dist/configs/regexp.d.ts +14 -3
  20. package/dist/configs/typescript.d.cts +33 -6
  21. package/dist/configs/typescript.d.ts +33 -6
  22. package/dist/configs/unicorn.d.cts +14 -3
  23. package/dist/configs/unicorn.d.ts +14 -3
  24. package/dist/configs/vue.d.cts +17 -3
  25. package/dist/configs/vue.d.ts +17 -3
  26. package/dist/configs/yml.d.cts +18 -3
  27. package/dist/configs/yml.d.ts +18 -3
  28. package/dist/globs.d.cts +9 -9
  29. package/dist/globs.d.ts +9 -9
  30. package/dist/index.cjs +18 -3
  31. package/dist/index.d.cts +1 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +18 -4
  34. package/dist/types/gens/comments.d.cts +65 -0
  35. package/dist/types/gens/comments.d.ts +65 -0
  36. package/dist/types/gens/eslint.d.cts +17 -0
  37. package/dist/types/gens/eslint.d.ts +17 -0
  38. package/dist/types/gens/javascript.d.cts +3162 -0
  39. package/dist/types/gens/javascript.d.ts +3162 -0
  40. package/dist/types/gens/jsdoc.d.cts +744 -0
  41. package/dist/types/gens/jsdoc.d.ts +744 -0
  42. package/dist/types/gens/jsonc.d.cts +513 -0
  43. package/dist/types/gens/jsonc.d.ts +513 -0
  44. package/dist/types/gens/prettier.d.cts +2 -0
  45. package/dist/types/gens/prettier.d.ts +2 -0
  46. package/dist/types/gens/promise.d.cts +107 -0
  47. package/dist/types/gens/promise.d.ts +107 -0
  48. package/dist/types/gens/regexp.d.cts +553 -0
  49. package/dist/types/gens/regexp.d.ts +553 -0
  50. package/dist/types/gens/typescript.d.cts +2253 -0
  51. package/dist/types/gens/typescript.d.ts +2253 -0
  52. package/dist/types/gens/unicorn.d.cts +905 -0
  53. package/dist/types/gens/unicorn.d.ts +905 -0
  54. package/dist/types/gens/vue.d.cts +2465 -0
  55. package/dist/types/gens/vue.d.ts +2465 -0
  56. package/dist/types/gens/yml.d.cts +375 -0
  57. package/dist/types/gens/yml.d.ts +375 -0
  58. package/dist/types/index.d.cts +14 -0
  59. package/dist/types/index.d.ts +14 -0
  60. package/dist/types/overrides.d.cts +6 -0
  61. package/dist/types/overrides.d.ts +6 -0
  62. package/dist/types/utils.d.cts +4 -0
  63. package/dist/types/utils.d.ts +4 -0
  64. package/dist/utils.d.cts +22 -1
  65. package/dist/utils.d.ts +22 -1
  66. package/package.json +9 -2
@@ -1,7 +1,22 @@
1
1
  import type { Linter } from 'eslint';
2
- import type { OverridesOptions } from '../types';
2
+ import type { OverridesOptions, YmlRules } from '../types';
3
+ /**
4
+ * eslint yml configuration options
5
+ */
3
6
  export interface YmlOptions {
4
- prettier?: boolean;
7
+ /**
8
+ * whether to enable config `'flat/prettier'`of `eslint-plugin-jsonc`.
9
+ * @see https://ota-meshi.github.io/eslint-plugin-yml/user-guide/#configuration
10
+ * @default false
11
+ */
12
+ prettier?: boolean;
5
13
  }
6
- export declare function yml(options?: ((YmlOptions) & (OverridesOptions))): Promise<(Linter.FlatConfig)[]>;
14
+ /**
15
+ * `eslint-plugin-yml` and overrides configuration options
16
+ * @param {YmlOptions & OverridesOptions} options
17
+ * eslint yml configuration options for yml, yaml
18
+ * @returns {Promise<Linter.FlatConfig[]>}
19
+ * eslint flat configurations with `eslint-plugin-yml` and overrides
20
+ */
21
+ export declare function yml(options?: YmlOptions & OverridesOptions<YmlRules>): Promise<Linter.FlatConfig[]>;
7
22
  export declare const yaml: typeof yml;
@@ -1,7 +1,22 @@
1
1
  import type { Linter } from 'eslint';
2
- import type { OverridesOptions } from '../types';
2
+ import type { OverridesOptions, YmlRules } from '../types';
3
+ /**
4
+ * eslint yml configuration options
5
+ */
3
6
  export interface YmlOptions {
4
- prettier?: boolean;
7
+ /**
8
+ * whether to enable config `'flat/prettier'`of `eslint-plugin-jsonc`.
9
+ * @see https://ota-meshi.github.io/eslint-plugin-yml/user-guide/#configuration
10
+ * @default false
11
+ */
12
+ prettier?: boolean;
5
13
  }
6
- export declare function yml(options?: ((YmlOptions) & (OverridesOptions))): Promise<(Linter.FlatConfig)[]>;
14
+ /**
15
+ * `eslint-plugin-yml` and overrides configuration options
16
+ * @param {YmlOptions & OverridesOptions} options
17
+ * eslint yml configuration options for yml, yaml
18
+ * @returns {Promise<Linter.FlatConfig[]>}
19
+ * eslint flat configurations with `eslint-plugin-yml` and overrides
20
+ */
21
+ export declare function yml(options?: YmlOptions & OverridesOptions<YmlRules>): Promise<Linter.FlatConfig[]>;
7
22
  export declare const yaml: typeof yml;
package/dist/globs.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- export declare const GLOB_JS = '**/*.?([cm])js';
2
- export declare const GLOB_JSX = '**/*.?([cm])jsx';
3
- export declare const GLOB_TS = '**/*.?([cm])ts';
4
- export declare const GLOB_TSX = '**/*.?([cm])tsx';
5
- export declare const GLOB_JSON = '**/*.json';
6
- export declare const GLOB_JSON5 = '**/*.json5';
7
- export declare const GLOB_JSONC = '**/*.jsonc';
8
- export declare const GLOB_YAML = '**/*.y?(a)ml';
9
- export declare const GLOB_VUE = '**/*.vue';
1
+ export declare const GLOB_JS = "**/*.?([cm])js";
2
+ export declare const GLOB_JSX = "**/*.?([cm])jsx";
3
+ export declare const GLOB_TS = "**/*.?([cm])ts";
4
+ export declare const GLOB_TSX = "**/*.?([cm])tsx";
5
+ export declare const GLOB_JSON = "**/*.json";
6
+ export declare const GLOB_JSON5 = "**/*.json5";
7
+ export declare const GLOB_JSONC = "**/*.jsonc";
8
+ export declare const GLOB_YAML = "**/*.y?(a)ml";
9
+ export declare const GLOB_VUE = "**/*.vue";
package/dist/globs.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare const GLOB_JS = '**/*.?([cm])js';
2
- export declare const GLOB_JSX = '**/*.?([cm])jsx';
3
- export declare const GLOB_TS = '**/*.?([cm])ts';
4
- export declare const GLOB_TSX = '**/*.?([cm])tsx';
5
- export declare const GLOB_JSON = '**/*.json';
6
- export declare const GLOB_JSON5 = '**/*.json5';
7
- export declare const GLOB_JSONC = '**/*.jsonc';
8
- export declare const GLOB_YAML = '**/*.y?(a)ml';
9
- export declare const GLOB_VUE = '**/*.vue';
1
+ export declare const GLOB_JS = "**/*.?([cm])js";
2
+ export declare const GLOB_JSX = "**/*.?([cm])jsx";
3
+ export declare const GLOB_TS = "**/*.?([cm])ts";
4
+ export declare const GLOB_TSX = "**/*.?([cm])tsx";
5
+ export declare const GLOB_JSON = "**/*.json";
6
+ export declare const GLOB_JSON5 = "**/*.json5";
7
+ export declare const GLOB_JSONC = "**/*.jsonc";
8
+ export declare const GLOB_YAML = "**/*.y?(a)ml";
9
+ export declare const GLOB_VUE = "**/*.vue";
package/dist/index.cjs CHANGED
@@ -82,10 +82,10 @@ async function javascript(options = {}) {
82
82
  //#region src/configs/comments.ts
83
83
  async function comments(options = {}) {
84
84
  const { rules: overrideRules = {} } = options;
85
- const comments$1 = await loadPlugin('eslint-plugin-eslint-comments');
85
+ const comments$1 = await loadPlugin('@eslint-community/eslint-plugin-eslint-comments');
86
86
  return [{
87
- name: 'eslint-comments/recommended',
88
- plugins: {'eslint-comments': comments$1},
87
+ name: '@eslint-community/eslint-comments/recommended',
88
+ plugins: {'@eslint-community/eslint-comments': comments$1},
89
89
  rules: {...(comments$1.configs.recommended.rules)}
90
90
  }, {
91
91
  name: '@kazupon/eslint-comments',
@@ -163,6 +163,20 @@ async function jsdoc(options = {}) {
163
163
  }];
164
164
  }
165
165
 
166
+ //#endregion
167
+ //#region src/configs/promise.ts
168
+ async function promise(options = {}) {
169
+ const { rules: overrideRules = {} } = options;
170
+ const promise$1 = await loadPlugin('eslint-plugin-promise');
171
+ return [{
172
+ name: 'promise/flat/recommended',
173
+ ...(promise$1.configs['flat/recommended'])
174
+ }, {
175
+ name: '@kazupon/promise',
176
+ rules: {...overrideRules}
177
+ }];
178
+ }
179
+
166
180
  //#endregion
167
181
  //#region src/configs/regexp.ts
168
182
  async function regexp(options = {}) {
@@ -313,6 +327,7 @@ exports.javascript = javascript;
313
327
  exports.jsdoc = jsdoc;
314
328
  exports.jsonc = jsonc;
315
329
  exports.prettier = prettier;
330
+ exports.promise = promise;
316
331
  exports.regexp = regexp;
317
332
  exports.typescript = typescript;
318
333
  exports.unicorn = unicorn;
package/dist/index.d.cts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './config';
2
2
  export * from './configs';
3
+ export * from './types';
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './config';
2
2
  export * from './configs';
3
+ export * from './types';
package/dist/index.js CHANGED
@@ -57,10 +57,10 @@ async function javascript(options = {}) {
57
57
  //#region src/configs/comments.ts
58
58
  async function comments(options = {}) {
59
59
  const { rules: overrideRules = {} } = options;
60
- const comments$1 = await loadPlugin('eslint-plugin-eslint-comments');
60
+ const comments$1 = await loadPlugin('@eslint-community/eslint-plugin-eslint-comments');
61
61
  return [{
62
- name: 'eslint-comments/recommended',
63
- plugins: {'eslint-comments': comments$1},
62
+ name: '@eslint-community/eslint-comments/recommended',
63
+ plugins: {'@eslint-community/eslint-comments': comments$1},
64
64
  rules: {...(comments$1.configs.recommended.rules)}
65
65
  }, {
66
66
  name: '@kazupon/eslint-comments',
@@ -138,6 +138,20 @@ async function jsdoc(options = {}) {
138
138
  }];
139
139
  }
140
140
 
141
+ //#endregion
142
+ //#region src/configs/promise.ts
143
+ async function promise(options = {}) {
144
+ const { rules: overrideRules = {} } = options;
145
+ const promise$1 = await loadPlugin('eslint-plugin-promise');
146
+ return [{
147
+ name: 'promise/flat/recommended',
148
+ ...(promise$1.configs['flat/recommended'])
149
+ }, {
150
+ name: '@kazupon/promise',
151
+ rules: {...overrideRules}
152
+ }];
153
+ }
154
+
141
155
  //#endregion
142
156
  //#region src/configs/regexp.ts
143
157
  async function regexp(options = {}) {
@@ -281,4 +295,4 @@ async function vue(options = {}) {
281
295
  }
282
296
 
283
297
  //#endregion
284
- export { comments, defineConfig, javascript, jsdoc, jsonc, prettier, regexp, typescript, unicorn, vue, yaml, yml };
298
+ export { comments, defineConfig, javascript, jsdoc, jsonc, prettier, promise, regexp, typescript, unicorn, vue, yaml, yml };
@@ -0,0 +1,65 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface CommentsRules {
3
+ /**
4
+ * require a `eslint-enable` comment for every `eslint-disable` comment
5
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
6
+ */
7
+ '@eslint-community/eslint-comments/disable-enable-pair'?: Linter.RuleEntry<EslintCommunityEslintCommentsDisableEnablePair>;
8
+ /**
9
+ * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
10
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
11
+ */
12
+ '@eslint-community/eslint-comments/no-aggregating-enable'?: Linter.RuleEntry<[]>;
13
+ /**
14
+ * disallow duplicate `eslint-disable` comments
15
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
16
+ */
17
+ '@eslint-community/eslint-comments/no-duplicate-disable'?: Linter.RuleEntry<[]>;
18
+ /**
19
+ * disallow `eslint-disable` comments about specific rules
20
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
21
+ */
22
+ '@eslint-community/eslint-comments/no-restricted-disable'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoRestrictedDisable>;
23
+ /**
24
+ * disallow `eslint-disable` comments without rule names
25
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
26
+ */
27
+ '@eslint-community/eslint-comments/no-unlimited-disable'?: Linter.RuleEntry<[]>;
28
+ /**
29
+ * disallow unused `eslint-disable` comments
30
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
31
+ */
32
+ '@eslint-community/eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>;
33
+ /**
34
+ * disallow unused `eslint-enable` comments
35
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
36
+ */
37
+ '@eslint-community/eslint-comments/no-unused-enable'?: Linter.RuleEntry<[]>;
38
+ /**
39
+ * disallow ESLint directive-comments
40
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-use.html
41
+ */
42
+ '@eslint-community/eslint-comments/no-use'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoUse>;
43
+ /**
44
+ * require include descriptions in ESLint directive-comments
45
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
46
+ */
47
+ '@eslint-community/eslint-comments/require-description'?: Linter.RuleEntry<EslintCommunityEslintCommentsRequireDescription>;
48
+ }
49
+ type EslintCommunityEslintCommentsDisableEnablePair = [] | [
50
+ {
51
+ allowWholeFile?: boolean;
52
+ }
53
+ ];
54
+ type EslintCommunityEslintCommentsNoRestrictedDisable = string[];
55
+ type EslintCommunityEslintCommentsNoUse = [] | [
56
+ {
57
+ allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[];
58
+ }
59
+ ];
60
+ type EslintCommunityEslintCommentsRequireDescription = [] | [
61
+ {
62
+ ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[];
63
+ }
64
+ ];
65
+ export {};
@@ -0,0 +1,65 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface CommentsRules {
3
+ /**
4
+ * require a `eslint-enable` comment for every `eslint-disable` comment
5
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html
6
+ */
7
+ '@eslint-community/eslint-comments/disable-enable-pair'?: Linter.RuleEntry<EslintCommunityEslintCommentsDisableEnablePair>;
8
+ /**
9
+ * disallow a `eslint-enable` comment for multiple `eslint-disable` comments
10
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html
11
+ */
12
+ '@eslint-community/eslint-comments/no-aggregating-enable'?: Linter.RuleEntry<[]>;
13
+ /**
14
+ * disallow duplicate `eslint-disable` comments
15
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html
16
+ */
17
+ '@eslint-community/eslint-comments/no-duplicate-disable'?: Linter.RuleEntry<[]>;
18
+ /**
19
+ * disallow `eslint-disable` comments about specific rules
20
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html
21
+ */
22
+ '@eslint-community/eslint-comments/no-restricted-disable'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoRestrictedDisable>;
23
+ /**
24
+ * disallow `eslint-disable` comments without rule names
25
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html
26
+ */
27
+ '@eslint-community/eslint-comments/no-unlimited-disable'?: Linter.RuleEntry<[]>;
28
+ /**
29
+ * disallow unused `eslint-disable` comments
30
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
31
+ */
32
+ '@eslint-community/eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>;
33
+ /**
34
+ * disallow unused `eslint-enable` comments
35
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html
36
+ */
37
+ '@eslint-community/eslint-comments/no-unused-enable'?: Linter.RuleEntry<[]>;
38
+ /**
39
+ * disallow ESLint directive-comments
40
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-use.html
41
+ */
42
+ '@eslint-community/eslint-comments/no-use'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoUse>;
43
+ /**
44
+ * require include descriptions in ESLint directive-comments
45
+ * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
46
+ */
47
+ '@eslint-community/eslint-comments/require-description'?: Linter.RuleEntry<EslintCommunityEslintCommentsRequireDescription>;
48
+ }
49
+ type EslintCommunityEslintCommentsDisableEnablePair = [] | [
50
+ {
51
+ allowWholeFile?: boolean;
52
+ }
53
+ ];
54
+ type EslintCommunityEslintCommentsNoRestrictedDisable = string[];
55
+ type EslintCommunityEslintCommentsNoUse = [] | [
56
+ {
57
+ allow?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[];
58
+ }
59
+ ];
60
+ type EslintCommunityEslintCommentsRequireDescription = [] | [
61
+ {
62
+ ignore?: ("eslint" | "eslint-disable" | "eslint-disable-line" | "eslint-disable-next-line" | "eslint-enable" | "eslint-env" | "exported" | "global" | "globals")[];
63
+ }
64
+ ];
65
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { CommentsRules } from './comments';
2
+ import type { JavascriptRules } from './javascript';
3
+ import type { JsdocRules } from './jsdoc';
4
+ import type { JsoncRules } from './jsonc';
5
+ import type { PrettierRules } from './prettier';
6
+ import type { PromiseRules } from './promise';
7
+ import type { RegexpRules } from './regexp';
8
+ import type { TypescriptRules } from './typescript';
9
+ import type { UnicornRules } from './unicorn';
10
+ import type { VueRules } from './vue';
11
+ import type { YmlRules } from './yml';
12
+ declare module 'eslint' {
13
+ namespace Linter {
14
+ interface RulesRecord extends CommentsRules, JavascriptRules, JsdocRules, JsoncRules, PrettierRules, PromiseRules, RegexpRules, TypescriptRules, UnicornRules, VueRules, YmlRules {
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ import type { CommentsRules } from './comments';
2
+ import type { JavascriptRules } from './javascript';
3
+ import type { JsdocRules } from './jsdoc';
4
+ import type { JsoncRules } from './jsonc';
5
+ import type { PrettierRules } from './prettier';
6
+ import type { PromiseRules } from './promise';
7
+ import type { RegexpRules } from './regexp';
8
+ import type { TypescriptRules } from './typescript';
9
+ import type { UnicornRules } from './unicorn';
10
+ import type { VueRules } from './vue';
11
+ import type { YmlRules } from './yml';
12
+ declare module 'eslint' {
13
+ namespace Linter {
14
+ interface RulesRecord extends CommentsRules, JavascriptRules, JsdocRules, JsoncRules, PrettierRules, PromiseRules, RegexpRules, TypescriptRules, UnicornRules, VueRules, YmlRules {
15
+ }
16
+ }
17
+ }