@kazupon/eslint-config 0.8.0 → 0.9.1

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 (64) hide show
  1. package/README.md +1 -0
  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/javascript.d.cts +14 -3
  7. package/dist/configs/javascript.d.ts +14 -3
  8. package/dist/configs/jsdoc.d.cts +24 -4
  9. package/dist/configs/jsdoc.d.ts +24 -4
  10. package/dist/configs/jsonc.d.cts +36 -6
  11. package/dist/configs/jsonc.d.ts +36 -6
  12. package/dist/configs/prettier.d.cts +14 -3
  13. package/dist/configs/prettier.d.ts +14 -3
  14. package/dist/configs/promise.d.cts +14 -3
  15. package/dist/configs/promise.d.ts +14 -3
  16. package/dist/configs/regexp.d.cts +14 -3
  17. package/dist/configs/regexp.d.ts +14 -3
  18. package/dist/configs/typescript.d.cts +33 -6
  19. package/dist/configs/typescript.d.ts +33 -6
  20. package/dist/configs/unicorn.d.cts +14 -3
  21. package/dist/configs/unicorn.d.ts +14 -3
  22. package/dist/configs/vue.d.cts +17 -3
  23. package/dist/configs/vue.d.ts +17 -3
  24. package/dist/configs/yml.d.cts +18 -3
  25. package/dist/configs/yml.d.ts +18 -3
  26. package/dist/globs.d.cts +9 -9
  27. package/dist/globs.d.ts +9 -9
  28. package/dist/index.cjs +24 -11
  29. package/dist/index.d.cts +1 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +24 -11
  32. package/dist/types/gens/comments.d.cts +65 -0
  33. package/dist/types/gens/comments.d.ts +65 -0
  34. package/dist/types/gens/eslint.d.cts +17 -0
  35. package/dist/types/gens/eslint.d.ts +17 -0
  36. package/dist/types/gens/javascript.d.cts +3162 -0
  37. package/dist/types/gens/javascript.d.ts +3162 -0
  38. package/dist/types/gens/jsdoc.d.cts +744 -0
  39. package/dist/types/gens/jsdoc.d.ts +744 -0
  40. package/dist/types/gens/jsonc.d.cts +513 -0
  41. package/dist/types/gens/jsonc.d.ts +513 -0
  42. package/dist/types/gens/prettier.d.cts +2 -0
  43. package/dist/types/gens/prettier.d.ts +2 -0
  44. package/dist/types/gens/promise.d.cts +107 -0
  45. package/dist/types/gens/promise.d.ts +107 -0
  46. package/dist/types/gens/regexp.d.cts +553 -0
  47. package/dist/types/gens/regexp.d.ts +553 -0
  48. package/dist/types/gens/typescript.d.cts +2253 -0
  49. package/dist/types/gens/typescript.d.ts +2253 -0
  50. package/dist/types/gens/unicorn.d.cts +905 -0
  51. package/dist/types/gens/unicorn.d.ts +905 -0
  52. package/dist/types/gens/vue.d.cts +2465 -0
  53. package/dist/types/gens/vue.d.ts +2465 -0
  54. package/dist/types/gens/yml.d.cts +375 -0
  55. package/dist/types/gens/yml.d.ts +375 -0
  56. package/dist/types/index.d.cts +14 -0
  57. package/dist/types/index.d.ts +14 -0
  58. package/dist/types/overrides.d.cts +6 -0
  59. package/dist/types/overrides.d.ts +6 -0
  60. package/dist/types/utils.d.cts +4 -0
  61. package/dist/types/utils.d.ts +4 -0
  62. package/dist/utils.d.cts +22 -1
  63. package/dist/utils.d.ts +22 -1
  64. package/package.json +28 -22
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
@@ -221,12 +221,6 @@ async function jsonc(options = {}) {
221
221
  const usePrettier = !!options.prettier;
222
222
  const jsonc$1 = await loadPlugin('eslint-plugin-jsonc');
223
223
  const configs = [];
224
- const defaultRules = {'jsonc/sort-keys': ['warn', 'asc', {
225
- caseSensitive: true,
226
- natural: false,
227
- minKeys: 2,
228
- allowLineSeparatedGroups: false
229
- }]};
230
224
  for (const kind of kinds) {
231
225
  if (kind) {
232
226
  configs.push(...jsonc$1.configs[`flat/recommended-with-${kind}`].map((config, index) => {
@@ -248,14 +242,33 @@ async function jsonc(options = {}) {
248
242
  const overriddenConfig = {
249
243
  name: '@kazupon/jsonc',
250
244
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
251
- rules: {
252
- ...defaultRules,
253
- ...overrideRules
254
- }
245
+ rules: {...overrideRules}
255
246
  };
256
- configs.push(overriddenConfig);
247
+ configs.push(...jsoncSort(), overriddenConfig);
257
248
  return configs;
258
249
  }
250
+ function jsoncSort() {
251
+ return [{
252
+ name: '@kazupon/jsonc/sort/package.json',
253
+ files: ['**/package.json'],
254
+ rules: {
255
+ 'jsonc/sort-array-values': ['error', {
256
+ order: {type: 'asc'},
257
+ pathPattern: '^files$'
258
+ }],
259
+ 'jsonc/sort-keys': ['error', {
260
+ order: ['name', 'description', 'private', 'version', 'author', 'contributors', 'license', 'funding', 'bugs', 'repository', 'keywords', 'homepage', 'publishConfig', 'packageManager', 'engines', 'os', 'cpu', 'type', 'main', 'module', 'browser', 'unpkg', 'jsdelivr', 'sideEffects', 'bin', 'files', 'directories', 'exports', 'types', 'typesVersions', 'scripts', 'dependencies', 'peerDependencies', 'peerDependenciesMeta', 'optionalDependencies', 'devDependencies', 'pnpm', 'overrides', 'resolutions', 'workspaces', 'prettier', 'buildOPtions', 'lint-staged'],
261
+ pathPattern: '^$'
262
+ }, {
263
+ order: {type: 'asc'},
264
+ pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$'
265
+ }, {
266
+ order: {type: 'asc'},
267
+ pathPattern: '^(?:resolutions|overrides|pnpm.overrides)$'
268
+ }]
269
+ }
270
+ }];
271
+ }
259
272
 
260
273
  //#endregion
261
274
  //#region src/configs/yml.ts
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
@@ -196,12 +196,6 @@ async function jsonc(options = {}) {
196
196
  const usePrettier = !!options.prettier;
197
197
  const jsonc$1 = await loadPlugin('eslint-plugin-jsonc');
198
198
  const configs = [];
199
- const defaultRules = {'jsonc/sort-keys': ['warn', 'asc', {
200
- caseSensitive: true,
201
- natural: false,
202
- minKeys: 2,
203
- allowLineSeparatedGroups: false
204
- }]};
205
199
  for (const kind of kinds) {
206
200
  if (kind) {
207
201
  configs.push(...jsonc$1.configs[`flat/recommended-with-${kind}`].map((config, index) => {
@@ -223,14 +217,33 @@ async function jsonc(options = {}) {
223
217
  const overriddenConfig = {
224
218
  name: '@kazupon/jsonc',
225
219
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
226
- rules: {
227
- ...defaultRules,
228
- ...overrideRules
229
- }
220
+ rules: {...overrideRules}
230
221
  };
231
- configs.push(overriddenConfig);
222
+ configs.push(...jsoncSort(), overriddenConfig);
232
223
  return configs;
233
224
  }
225
+ function jsoncSort() {
226
+ return [{
227
+ name: '@kazupon/jsonc/sort/package.json',
228
+ files: ['**/package.json'],
229
+ rules: {
230
+ 'jsonc/sort-array-values': ['error', {
231
+ order: {type: 'asc'},
232
+ pathPattern: '^files$'
233
+ }],
234
+ 'jsonc/sort-keys': ['error', {
235
+ order: ['name', 'description', 'private', 'version', 'author', 'contributors', 'license', 'funding', 'bugs', 'repository', 'keywords', 'homepage', 'publishConfig', 'packageManager', 'engines', 'os', 'cpu', 'type', 'main', 'module', 'browser', 'unpkg', 'jsdelivr', 'sideEffects', 'bin', 'files', 'directories', 'exports', 'types', 'typesVersions', 'scripts', 'dependencies', 'peerDependencies', 'peerDependenciesMeta', 'optionalDependencies', 'devDependencies', 'pnpm', 'overrides', 'resolutions', 'workspaces', 'prettier', 'buildOPtions', 'lint-staged'],
236
+ pathPattern: '^$'
237
+ }, {
238
+ order: {type: 'asc'},
239
+ pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$'
240
+ }, {
241
+ order: {type: 'asc'},
242
+ pathPattern: '^(?:resolutions|overrides|pnpm.overrides)$'
243
+ }]
244
+ }
245
+ }];
246
+ }
234
247
 
235
248
  //#endregion
236
249
  //#region src/configs/yml.ts
@@ -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
+ }