@ota-meshi/eslint-plugin 0.16.1 → 0.17.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 (103) hide show
  1. package/lib/config-builder/+astro-with-ts.d.ts +2 -0
  2. package/lib/config-builder/+astro-with-ts.js +8 -4
  3. package/lib/config-builder/+astro.d.ts +2 -0
  4. package/lib/config-builder/+astro.js +2 -3
  5. package/lib/config-builder/+eslint-plugin.d.ts +2 -0
  6. package/lib/config-builder/+json.d.ts +2 -0
  7. package/lib/config-builder/+json.js +2 -3
  8. package/lib/config-builder/+md.d.ts +2 -0
  9. package/lib/config-builder/+md.js +3 -3
  10. package/lib/config-builder/+node.d.ts +2 -0
  11. package/lib/config-builder/+node.js +1 -4
  12. package/lib/config-builder/+package-json.d.ts +2 -0
  13. package/lib/config-builder/+package-json.js +2 -3
  14. package/lib/config-builder/+prettier.d.ts +2 -0
  15. package/lib/config-builder/+svelte-with-ts.d.ts +2 -0
  16. package/lib/config-builder/+svelte-with-ts.js +3 -3
  17. package/lib/config-builder/+svelte.d.ts +2 -0
  18. package/lib/config-builder/+svelte.js +11 -3
  19. package/lib/config-builder/+toml.d.ts +2 -0
  20. package/lib/config-builder/+toml.js +2 -3
  21. package/lib/config-builder/+typescript.d.ts +2 -0
  22. package/lib/config-builder/+vue2-with-ts.d.ts +2 -0
  23. package/lib/config-builder/+vue2-with-ts.js +8 -4
  24. package/lib/config-builder/+vue2.d.ts +2 -0
  25. package/lib/config-builder/+vue2.js +11 -3
  26. package/lib/config-builder/+vue3-with-ts.d.ts +2 -0
  27. package/lib/config-builder/+vue3-with-ts.js +8 -4
  28. package/lib/config-builder/+vue3.d.ts +2 -0
  29. package/lib/config-builder/+vue3.js +11 -3
  30. package/lib/config-builder/+yaml.d.ts +2 -0
  31. package/lib/config-builder/+yaml.js +2 -3
  32. package/lib/config-builder/base-plugins/eslint-comments.d.ts +2 -0
  33. package/lib/config-builder/base-plugins/jsdoc.d.ts +2 -0
  34. package/lib/config-builder/base-plugins/jsdoc.js +20 -0
  35. package/lib/config-builder/base-plugins/regexp.d.ts +2 -0
  36. package/lib/config-builder/fallback.d.ts +8 -0
  37. package/lib/config-builder/fallback.js +2 -2
  38. package/lib/config-builder/index.d.ts +28 -0
  39. package/lib/config-builder/index.js +20 -18
  40. package/lib/config-builder/plugins/json-schema.d.ts +2 -0
  41. package/lib/config-builder/plugins/json-schema.js +2 -3
  42. package/lib/config-builder/plugins/ts/base-config.d.ts +2 -0
  43. package/lib/config-builder/plugins/ts/base-config.js +6 -3
  44. package/lib/config-builder/plugins/ts/index.d.ts +1 -0
  45. package/lib/config-builder/recommended.d.ts +5 -0
  46. package/lib/config-builder/recommended.js +2 -0
  47. package/lib/config-helpers/+astro.d.ts +3 -0
  48. package/lib/config-helpers/+eslint-plugin.d.ts +3 -0
  49. package/lib/config-helpers/+json.d.ts +3 -0
  50. package/lib/config-helpers/+md.d.ts +5 -0
  51. package/lib/config-helpers/+node.d.ts +11 -0
  52. package/lib/config-helpers/+package-json.d.ts +1 -0
  53. package/lib/config-helpers/+prettier.d.ts +3 -0
  54. package/lib/config-helpers/+svelte.d.ts +3 -0
  55. package/lib/config-helpers/+svelte.js +1 -0
  56. package/lib/config-helpers/+toml.d.ts +3 -0
  57. package/lib/config-helpers/+typescript.d.ts +4 -0
  58. package/lib/config-helpers/+vue.d.ts +3 -0
  59. package/lib/config-helpers/+yaml.d.ts +3 -0
  60. package/lib/config-helpers/base-plugins/eslint-comments.d.ts +2 -0
  61. package/lib/config-helpers/base-plugins/jsdoc.d.ts +2 -0
  62. package/lib/config-helpers/base-plugins/jsdoc.js +6 -0
  63. package/lib/config-helpers/base-plugins/regexp.d.ts +2 -0
  64. package/lib/config-helpers/plugins/json-schema.d.ts +2 -0
  65. package/lib/config-helpers/plugins/ts/base-config.d.ts +2 -0
  66. package/lib/config-helpers/plugins/ts/base-config.js +2 -0
  67. package/lib/config-helpers/plugins/ts/index.d.ts +7 -0
  68. package/lib/config-helpers/recommended.d.ts +5 -0
  69. package/lib/config-helpers/recommended.js +1 -2
  70. package/lib/configs/+eslint-plugin.d.ts +3 -0
  71. package/lib/configs/+json.d.ts +3 -0
  72. package/lib/configs/+md.d.ts +3 -0
  73. package/lib/configs/+node.d.ts +3 -0
  74. package/lib/configs/+package-json.d.ts +3 -0
  75. package/lib/configs/+prettier.d.ts +3 -0
  76. package/lib/configs/+svelte-with-ts.d.ts +3 -0
  77. package/lib/configs/+svelte.d.ts +3 -0
  78. package/lib/configs/+toml.d.ts +3 -0
  79. package/lib/configs/+typescript.d.ts +3 -0
  80. package/lib/configs/+typescript.js +5 -0
  81. package/lib/configs/+vue2-with-ts.d.ts +3 -0
  82. package/lib/configs/+vue2.d.ts +3 -0
  83. package/lib/configs/+vue3-with-ts.d.ts +3 -0
  84. package/lib/configs/+vue3.d.ts +3 -0
  85. package/lib/configs/+yaml.d.ts +3 -0
  86. package/lib/configs/base-plugins/eslint-comments.d.ts +3 -0
  87. package/lib/configs/base-plugins/jsdoc.d.ts +3 -0
  88. package/lib/configs/base-plugins/jsdoc.js +10 -0
  89. package/lib/configs/base-plugins/regexp.d.ts +3 -0
  90. package/lib/configs/fallback.d.ts +5 -0
  91. package/lib/configs/json-schema/config.d.ts +3 -0
  92. package/lib/configs/recommended.d.ts +26 -0
  93. package/lib/configs/recommended.js +1 -0
  94. package/lib/configs/ts/base-config.d.ts +10 -0
  95. package/lib/configs/ts/index.d.ts +2 -0
  96. package/lib/index.d.ts +48 -0
  97. package/lib/parsers/any-parser.d.ts +13 -0
  98. package/lib/parsers/any-parser.js +6 -2
  99. package/lib/rules/missing-module-for-config.d.ts +16 -0
  100. package/lib/utils/find-root-dir.d.ts +1 -0
  101. package/lib/utils/get-linters.d.ts +1 -0
  102. package/lib/utils/module.d.ts +19 -0
  103. package/package.json +2 -1
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildAstroTs(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -9,7 +9,12 @@ const fallback_js_1 = require("./fallback.js");
9
9
  const any_parser_js_1 = require("../parsers/any-parser.js");
10
10
  const _astro_js_2 = require("./+astro.js");
11
11
  function buildAstroTs() {
12
- return (0, module_js_1.requireOf)(["eslint-plugin-astro", "astro-eslint-parser", "@typescript-eslint/parser"], () => {
12
+ return (0, module_js_1.requireOf)([
13
+ "eslint-plugin-astro",
14
+ "astro-eslint-parser",
15
+ "typescript-eslint",
16
+ "@typescript-eslint/parser",
17
+ ], () => {
13
18
  return [
14
19
  ...(0, index_js_1.buildTS)(_astro_js_1.astroFiles),
15
20
  {
@@ -26,13 +31,12 @@ function buildAstroTs() {
26
31
  ...(0, _astro_js_2.buildAstro)(),
27
32
  ];
28
33
  }, (missingList) => [
29
- {
34
+ ...(0, fallback_js_1.buildFallback)(missingList, {
30
35
  files: _astro_js_1.astroFiles,
31
36
  languageOptions: {
32
37
  parser: any_parser_js_1.anyParser,
33
38
  },
34
- ...(0, fallback_js_1.buildFallback)(missingList),
35
- },
39
+ }),
36
40
  ]);
37
41
  }
38
42
  exports.buildAstroTs = buildAstroTs;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildAstro(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -18,13 +18,12 @@ function buildAstro() {
18
18
  },
19
19
  ];
20
20
  }, (missingList) => [
21
- {
21
+ ...(0, fallback_js_1.buildFallback)(missingList, {
22
22
  files: _astro_js_1.astroFiles,
23
23
  languageOptions: {
24
24
  parser: any_parser_js_1.anyParser,
25
25
  },
26
- ...(0, fallback_js_1.buildFallback)(missingList),
27
- },
26
+ }),
28
27
  ]);
29
28
  }
30
29
  exports.buildAstro = buildAstro;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildESLintPlugin(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildJson(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -20,13 +20,12 @@ function buildJson() {
20
20
  ...(0, json_schema_js_1.buildJsonSchema)(_json_js_1.jsonFiles),
21
21
  ];
22
22
  }, (missingList) => [
23
- {
23
+ ...(0, fallback_js_1.buildFallback)(missingList, {
24
24
  files: _json_js_1.jsonFiles,
25
25
  languageOptions: {
26
26
  parser: any_parser_js_1.anyParser,
27
27
  },
28
- ...(0, fallback_js_1.buildFallback)(missingList),
29
- },
28
+ }),
30
29
  ]);
31
30
  }
32
31
  exports.buildJson = buildJson;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildMd(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -24,6 +24,7 @@ function buildMd() {
24
24
  ..._md_js_1.jsInMdRules,
25
25
  },
26
26
  languageOptions: {
27
+ sourceType: "module",
27
28
  parserOptions: {
28
29
  project: null,
29
30
  },
@@ -31,13 +32,12 @@ function buildMd() {
31
32
  },
32
33
  ];
33
34
  }, (missingList) => [
34
- {
35
+ ...(0, fallback_js_1.buildFallback)(missingList, {
35
36
  files: _md_js_1.mdFiles,
36
37
  languageOptions: {
37
38
  parser: any_parser_js_1.anyParser,
38
39
  },
39
- ...(0, fallback_js_1.buildFallback)(missingList),
40
- },
40
+ }),
41
41
  ]);
42
42
  }
43
43
  exports.buildMd = buildMd;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildNode(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -21,9 +21,6 @@ function buildNode() {
21
21
  },
22
22
  },
23
23
  ];
24
- }, (missingList) => (0, fallback_js_1.buildFallback)(missingList).map((config) => ({
25
- ...config,
26
- files: _node_js_1.nodeFiles,
27
- })));
24
+ }, (missingList) => (0, fallback_js_1.buildFallback)(missingList, { files: _node_js_1.nodeFiles }));
28
25
  }
29
26
  exports.buildNode = buildNode;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildPackageJson(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -17,13 +17,12 @@ function buildPackageJson() {
17
17
  ...nodeDependenciesPlugin.configs["flat/recommended"],
18
18
  ];
19
19
  }, (missingList) => [
20
- {
20
+ ...(0, fallback_js_1.buildFallback)(missingList, {
21
21
  files: _package_json_js_1.packageJsonFiles,
22
22
  languageOptions: {
23
23
  parser: any_parser_js_1.anyParser,
24
24
  },
25
- ...(0, fallback_js_1.buildFallback)(missingList),
26
- },
25
+ }),
27
26
  ]);
28
27
  }
29
28
  exports.buildPackageJson = buildPackageJson;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildPrettier(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildSvelteTs(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -12,6 +12,7 @@ function buildSvelteTs() {
12
12
  return (0, module_js_1.requireOf)([
13
13
  "eslint-plugin-svelte",
14
14
  "svelte-eslint-parser",
15
+ "typescript-eslint",
15
16
  "@typescript-eslint/parser",
16
17
  ], () => {
17
18
  return [
@@ -30,13 +31,12 @@ function buildSvelteTs() {
30
31
  ...(0, _svelte_js_2.buildSvelte)(),
31
32
  ];
32
33
  }, (missingList) => [
33
- {
34
+ ...(0, fallback_js_1.buildFallback)(missingList, {
34
35
  files: _svelte_js_1.svelteFiles,
35
36
  languageOptions: {
36
37
  parser: any_parser_js_1.anyParser,
37
38
  },
38
- ...(0, fallback_js_1.buildFallback)(missingList),
39
- },
39
+ }),
40
40
  ]);
41
41
  }
42
42
  exports.buildSvelteTs = buildSvelteTs;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildSvelte(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -15,16 +15,24 @@ function buildSvelte() {
15
15
  rules: {
16
16
  ..._svelte_js_1.svelteExtendRules,
17
17
  },
18
+ ...((0, module_js_1.has)("@typescript-eslint/parser")
19
+ ? {
20
+ languageOptions: {
21
+ parserOptions: {
22
+ parser: { ts: (0, module_js_1.requireFromCwd)("@typescript-eslint/parser") },
23
+ },
24
+ },
25
+ }
26
+ : {}),
18
27
  },
19
28
  ];
20
29
  }, (missingList) => [
21
- {
30
+ ...(0, fallback_js_1.buildFallback)(missingList, {
22
31
  files: _svelte_js_1.svelteFiles,
23
32
  languageOptions: {
24
33
  parser: any_parser_js_1.anyParser,
25
34
  },
26
- ...(0, fallback_js_1.buildFallback)(missingList),
27
- },
35
+ }),
28
36
  ]);
29
37
  }
30
38
  exports.buildSvelte = buildSvelte;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildToml(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -20,13 +20,12 @@ function buildToml() {
20
20
  },
21
21
  ];
22
22
  }, (missingList) => [
23
- {
23
+ ...(0, fallback_js_1.buildFallback)(missingList, {
24
24
  files: _toml_js_1.tomlFiles,
25
25
  languageOptions: {
26
26
  parser: any_parser_js_1.anyParser,
27
27
  },
28
- ...(0, fallback_js_1.buildFallback)(missingList),
29
- },
28
+ }),
30
29
  ]);
31
30
  }
32
31
  exports.buildToml = buildToml;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildTs(): Linter.FlatConfig[];
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildVue2Ts(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -9,7 +9,12 @@ const base_config_js_1 = require("../config-helpers/plugins/ts/base-config.js");
9
9
  const any_parser_js_1 = require("../parsers/any-parser.js");
10
10
  const fallback_js_1 = require("./fallback.js");
11
11
  function buildVue2Ts() {
12
- return (0, module_js_1.requireOf)(["eslint-plugin-vue", "vue-eslint-parser", "@typescript-eslint/parser"], () => {
12
+ return (0, module_js_1.requireOf)([
13
+ "eslint-plugin-vue",
14
+ "vue-eslint-parser",
15
+ "typescript-eslint",
16
+ "@typescript-eslint/parser",
17
+ ], () => {
13
18
  return [
14
19
  ...(0, index_js_1.buildTS)(_vue_js_1.vueFiles),
15
20
  {
@@ -26,13 +31,12 @@ function buildVue2Ts() {
26
31
  ...(0, _vue2_js_1.buildVue2)(),
27
32
  ];
28
33
  }, (missingList) => [
29
- {
34
+ ...(0, fallback_js_1.buildFallback)(missingList, {
30
35
  files: _vue_js_1.vueFiles,
31
36
  languageOptions: {
32
37
  parser: any_parser_js_1.anyParser,
33
38
  },
34
- ...(0, fallback_js_1.buildFallback)(missingList),
35
- },
39
+ }),
36
40
  ]);
37
41
  }
38
42
  exports.buildVue2Ts = buildVue2Ts;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildVue2(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -15,16 +15,24 @@ function buildVue2() {
15
15
  rules: {
16
16
  ..._vue_js_1.vueExtendRules,
17
17
  },
18
+ ...((0, module_js_1.has)("@typescript-eslint/parser")
19
+ ? {
20
+ languageOptions: {
21
+ parserOptions: {
22
+ parser: { ts: (0, module_js_1.requireFromCwd)("@typescript-eslint/parser") },
23
+ },
24
+ },
25
+ }
26
+ : {}),
18
27
  },
19
28
  ];
20
29
  }, (missingList) => [
21
- {
30
+ ...(0, fallback_js_1.buildFallback)(missingList, {
22
31
  files: _vue_js_1.vueFiles,
23
32
  languageOptions: {
24
33
  parser: any_parser_js_1.anyParser,
25
34
  },
26
- ...(0, fallback_js_1.buildFallback)(missingList),
27
- },
35
+ }),
28
36
  ]);
29
37
  }
30
38
  exports.buildVue2 = buildVue2;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildVue3Ts(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -9,7 +9,12 @@ const any_parser_js_1 = require("../parsers/any-parser.js");
9
9
  const fallback_js_1 = require("./fallback.js");
10
10
  const _vue3_js_1 = require("./+vue3.js");
11
11
  function buildVue3Ts() {
12
- return (0, module_js_1.requireOf)(["eslint-plugin-vue", "vue-eslint-parser", "@typescript-eslint/parser"], () => {
12
+ return (0, module_js_1.requireOf)([
13
+ "eslint-plugin-vue",
14
+ "vue-eslint-parser",
15
+ "typescript-eslint",
16
+ "@typescript-eslint/parser",
17
+ ], () => {
13
18
  return [
14
19
  ...(0, index_js_1.buildTS)(_vue_js_1.vueFiles),
15
20
  {
@@ -26,13 +31,12 @@ function buildVue3Ts() {
26
31
  ...(0, _vue3_js_1.buildVue3)(),
27
32
  ];
28
33
  }, (missingList) => [
29
- {
34
+ ...(0, fallback_js_1.buildFallback)(missingList, {
30
35
  files: _vue_js_1.vueFiles,
31
36
  languageOptions: {
32
37
  parser: any_parser_js_1.anyParser,
33
38
  },
34
- ...(0, fallback_js_1.buildFallback)(missingList),
35
- },
39
+ }),
36
40
  ]);
37
41
  }
38
42
  exports.buildVue3Ts = buildVue3Ts;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildVue3(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -15,16 +15,24 @@ function buildVue3() {
15
15
  rules: {
16
16
  ..._vue_js_1.vueExtendRules,
17
17
  },
18
+ ...((0, module_js_1.has)("@typescript-eslint/parser")
19
+ ? {
20
+ languageOptions: {
21
+ parserOptions: {
22
+ parser: { ts: (0, module_js_1.requireFromCwd)("@typescript-eslint/parser") },
23
+ },
24
+ },
25
+ }
26
+ : {}),
18
27
  },
19
28
  ];
20
29
  }, (missingList) => [
21
- {
30
+ ...(0, fallback_js_1.buildFallback)(missingList, {
22
31
  files: _vue_js_1.vueFiles,
23
32
  languageOptions: {
24
33
  parser: any_parser_js_1.anyParser,
25
34
  },
26
- ...(0, fallback_js_1.buildFallback)(missingList),
27
- },
35
+ }),
28
36
  ]);
29
37
  }
30
38
  exports.buildVue3 = buildVue3;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildYaml(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -20,13 +20,12 @@ function buildYaml() {
20
20
  },
21
21
  ];
22
22
  }, (missingList) => [
23
- {
23
+ ...(0, fallback_js_1.buildFallback)(missingList, {
24
24
  files: _yaml_js_1.yamlFiles,
25
25
  languageOptions: {
26
26
  parser: any_parser_js_1.anyParser,
27
27
  },
28
- ...(0, fallback_js_1.buildFallback)(missingList),
29
- },
28
+ }),
30
29
  ]);
31
30
  }
32
31
  exports.buildYaml = buildYaml;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildESLintComments(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildJsdoc(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildJsdoc = void 0;
4
+ const module_js_1 = require("../../utils/module.js");
5
+ const fallback_js_1 = require("../fallback.js");
6
+ const jsdoc_js_1 = require("../../config-helpers/base-plugins/jsdoc.js");
7
+ function buildJsdoc() {
8
+ return (0, module_js_1.requireOf)(["eslint-plugin-jsdoc"], () => {
9
+ const jsdoc = require("eslint-plugin-jsdoc");
10
+ return [
11
+ {
12
+ plugins: { jsdoc },
13
+ rules: {
14
+ ...jsdoc_js_1.jsdocRules,
15
+ },
16
+ },
17
+ ];
18
+ }, fallback_js_1.buildFallback);
19
+ }
20
+ exports.buildJsdoc = buildJsdoc;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildRegexp(): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -0,0 +1,8 @@
1
+ import type { Linter } from "eslint";
2
+ /**
3
+ * Fallback Legacy config builder
4
+ */
5
+ export declare function buildFallback(missingList: string[], options?: {
6
+ files?: string[];
7
+ languageOptions?: Linter.FlatConfig["languageOptions"];
8
+ }): Linter.FlatConfig[];
@@ -4,7 +4,7 @@ exports.buildFallback = void 0;
4
4
  /**
5
5
  * Fallback Legacy config builder
6
6
  */
7
- function buildFallback(missingList, files) {
7
+ function buildFallback(missingList, options) {
8
8
  return [
9
9
  {
10
10
  plugins: {
@@ -15,7 +15,7 @@ function buildFallback(missingList, files) {
15
15
  rules: {
16
16
  "@ota-meshi/missing-module-for-config": ["error", missingList],
17
17
  },
18
- ...(files ? { files } : {}),
18
+ ...(options ?? {}),
19
19
  },
20
20
  ];
21
21
  }
@@ -0,0 +1,28 @@
1
+ import type { Linter } from "eslint";
2
+ export type BuildConfigOptions = {
3
+ node?: boolean;
4
+ packageJson?: boolean;
5
+ eslintPlugin?: boolean;
6
+ vue3?: boolean | {
7
+ withTs?: boolean;
8
+ };
9
+ vue2?: boolean | {
10
+ withTs?: boolean;
11
+ };
12
+ svelte?: boolean | {
13
+ withTs?: boolean;
14
+ };
15
+ astro?: boolean | {
16
+ withTs?: boolean;
17
+ };
18
+ ts?: boolean;
19
+ json?: boolean;
20
+ yaml?: boolean;
21
+ toml?: boolean;
22
+ md?: boolean;
23
+ prettier?: boolean;
24
+ };
25
+ /**
26
+ * Build config
27
+ */
28
+ export declare function buildConfig(options: BuildConfigOptions): Linter.FlatConfig[];
@@ -23,28 +23,30 @@ const _astro_with_ts_js_1 = require("./+astro-with-ts.js");
23
23
  * Build config
24
24
  */
25
25
  function buildConfig(options) {
26
- return [
26
+ const configs = [
27
27
  ...(0, recommended_js_1.buildRecommended)(),
28
28
  ...(options?.node ? (0, _node_js_1.buildNode)() : []),
29
29
  ...(options?.packageJson ? (0, _package_json_js_1.buildPackageJson)() : []),
30
- // kind of package
30
+ // Kind of package
31
31
  ...(options?.eslintPlugin ? (0, _eslint_plugin_js_1.buildESLintPlugin)() : []),
32
- // languages
33
- ...(options?.vue3 ? (0, _vue3_js_1.buildVue3)() : []),
34
- ...(options?.vue3 && options?.ts ? (0, _vue3_with_ts_js_1.buildVue3Ts)() : []),
35
- ...(options?.vue2 ? (0, _vue2_js_1.buildVue2)() : []),
36
- ...(options?.vue2 && options?.ts ? (0, _vue2_with_ts_js_1.buildVue2Ts)() : []),
37
- ...(options?.svelte ? (0, _svelte_js_1.buildSvelte)() : []),
38
- ...(options?.svelte && options?.ts ? (0, _svelte_with_ts_js_1.buildSvelteTs)() : []),
39
- ...(options?.astro ? (0, _astro_js_1.buildAstro)() : []),
40
- ...(options?.astro && options?.ts ? (0, _astro_with_ts_js_1.buildAstroTs)() : []),
41
- ...(options?.ts ? (0, _typescript_js_1.buildTs)() : []),
42
- ...(options?.json ? (0, _json_js_1.buildJson)() : []),
43
- ...(options?.yaml ? (0, _yaml_js_1.buildYaml)() : []),
44
- ...(options?.toml ? (0, _toml_js_1.buildToml)() : []),
45
- ...(options?.md ? (0, _md_js_1.buildMd)() : []),
46
- // format
47
- ...(options?.prettier ? (0, _prettier_js_1.buildPrettier)() : []),
48
32
  ];
33
+ // Frameworks
34
+ applyFw(options.vue3, _vue3_js_1.buildVue3, _vue3_with_ts_js_1.buildVue3Ts);
35
+ applyFw(options.vue2, _vue2_js_1.buildVue2, _vue2_with_ts_js_1.buildVue2Ts);
36
+ applyFw(options.svelte, _svelte_js_1.buildSvelte, _svelte_with_ts_js_1.buildSvelteTs);
37
+ applyFw(options.astro, _astro_js_1.buildAstro, _astro_with_ts_js_1.buildAstroTs);
38
+ configs.push(
39
+ // Languages
40
+ ...(options?.ts ? (0, _typescript_js_1.buildTs)() : []), ...(options?.json ? (0, _json_js_1.buildJson)() : []), ...(options?.yaml ? (0, _yaml_js_1.buildYaml)() : []), ...(options?.toml ? (0, _toml_js_1.buildToml)() : []), ...(options?.md ? (0, _md_js_1.buildMd)() : []),
41
+ // Format
42
+ ...(options?.prettier ? (0, _prettier_js_1.buildPrettier)() : []));
43
+ return configs;
44
+ function applyFw(option, builder, tsBuilder) {
45
+ configs.push(...builder());
46
+ const ts = (typeof option === "object" ? option.withTs : null) ?? options?.ts;
47
+ if (ts) {
48
+ configs.push(...tsBuilder());
49
+ }
50
+ }
49
51
  }
50
52
  exports.buildConfig = buildConfig;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildJsonSchema(files: string[]): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -18,13 +18,12 @@ function buildJsonSchema(files) {
18
18
  },
19
19
  ];
20
20
  }, (missingList) => [
21
- {
21
+ ...(0, fallback_js_1.buildFallback)(missingList, {
22
22
  files,
23
23
  languageOptions: {
24
24
  parser: any_parser_js_1.anyParser,
25
25
  },
26
- ...(0, fallback_js_1.buildFallback)(missingList),
27
- },
26
+ }),
28
27
  ]);
29
28
  }
30
29
  exports.buildJsonSchema = buildJsonSchema;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function buildTS(files: string[]): Linter.FlatConfig<Linter.RulesRecord>[];
@@ -5,6 +5,7 @@ const module_js_1 = require("../../../utils/module.js");
5
5
  const index_js_1 = require("../../../config-helpers/plugins/ts/index.js");
6
6
  const fallback_js_1 = require("../../fallback.js");
7
7
  const any_parser_js_1 = require("../../../parsers/any-parser.js");
8
+ const _md_js_1 = require("../../../config-helpers/+md.js");
8
9
  function buildTS(files) {
9
10
  return (0, module_js_1.requireOf)([
10
11
  "typescript",
@@ -29,16 +30,18 @@ function buildTS(files) {
29
30
  rules: {
30
31
  ...index_js_1.tsExtendRules,
31
32
  },
33
+ }, {
34
+ files: _md_js_1.extInMdFiles,
35
+ extends: [tseslint.configs.disableTypeChecked],
32
36
  }),
33
37
  ];
34
38
  }, (missingList) => [
35
- {
39
+ ...(0, fallback_js_1.buildFallback)(missingList, {
36
40
  files,
37
41
  languageOptions: {
38
42
  parser: any_parser_js_1.anyParser,
39
43
  },
40
- ...(0, fallback_js_1.buildFallback)(missingList),
41
- },
44
+ }),
42
45
  ]);
43
46
  }
44
47
  exports.buildTS = buildTS;
@@ -0,0 +1 @@
1
+ export { buildTS } from "./base-config.js";
@@ -0,0 +1,5 @@
1
+ import type { Linter } from "eslint";
2
+ /**
3
+ * Build recommended config
4
+ */
5
+ export declare function buildRecommended(): Linter.FlatConfig[];
@@ -9,6 +9,7 @@ const js_1 = __importDefault(require("@eslint/js"));
9
9
  const eslint_comments_js_1 = require("./base-plugins/eslint-comments.js");
10
10
  const regexp_js_1 = require("./base-plugins/regexp.js");
11
11
  const recommended_js_1 = require("../config-helpers/recommended.js");
12
+ const jsdoc_js_1 = require("./base-plugins/jsdoc.js");
12
13
  /**
13
14
  * Build recommended config
14
15
  */
@@ -17,6 +18,7 @@ function buildRecommended() {
17
18
  js_1.default.configs.recommended,
18
19
  ...(0, eslint_comments_js_1.buildESLintComments)(),
19
20
  ...(0, regexp_js_1.buildRegexp)(),
21
+ ...(0, jsdoc_js_1.buildJsdoc)(),
20
22
  {
21
23
  rules: {
22
24
  ...recommended_js_1.recommendedRules,
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const astroFiles: string[];
3
+ export declare const astroExtendRules: Linter.RulesRecord;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const eslintPluginFiles: string[];
3
+ export declare const eslintPluginExtendRules: Linter.RulesRecord;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const jsonFiles: string[];
3
+ export declare const jsonExtendRules: Linter.RulesRecord;
@@ -0,0 +1,5 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const mdFiles: string[];
3
+ export declare const jsInMdFiles: string[];
4
+ export declare const extInMdFiles: string[];
5
+ export declare const jsInMdRules: Linter.RulesRecord;
@@ -0,0 +1,11 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const nodeFiles: string[];
3
+ export declare const nodeEcmaFeatures: {
4
+ globalReturn: boolean;
5
+ };
6
+ export declare const nodeExtendRules: Linter.RulesRecord;
7
+ export declare const nodeSettings: {
8
+ node: {
9
+ tryExtensions: string[];
10
+ };
11
+ };
@@ -0,0 +1 @@
1
+ export declare const packageJsonFiles: string[];
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const prettierOffFiles: string[];
3
+ export declare const prettierExtendRules: Linter.RulesRecord;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const svelteFiles: string[];
3
+ export declare const svelteExtendRules: Linter.RulesRecord;
@@ -13,4 +13,5 @@ exports.svelteExtendRules = {
13
13
  "svelte/prefer-class-directive": "warn",
14
14
  "svelte/prefer-style-directive": "warn",
15
15
  "svelte/spaced-html-comment": "warn",
16
+ "no-use-before-define": "off",
16
17
  };
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const tomlFiles: string[];
3
+ export declare const tomlExtendRules: Linter.RulesRecord;
@@ -0,0 +1,4 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const tsFiles: string[];
3
+ export declare const tsTestFiles: string[];
4
+ export declare const tsTestExtendRules: Linter.RulesRecord;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const vueFiles: string[];
3
+ export declare const vueExtendRules: Linter.RulesRecord;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const yamlFiles: string[];
3
+ export declare const yamlExtendRules: Linter.RulesRecord;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const eslintCommentsExtendRules: Linter.RulesRecord;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const jsdocRules: Linter.RulesRecord;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jsdocRules = void 0;
4
+ exports.jsdocRules = {
5
+ "jsdoc/require-jsdoc": "error",
6
+ };
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const regexpExtendRules: Linter.RulesRecord;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const jsonSchemaExtendRules: Linter.RulesRecord;
@@ -0,0 +1,2 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const tsExtendRules: Linter.RulesRecord;
@@ -107,6 +107,8 @@ exports.tsExtendRules = {
107
107
  varsIgnorePattern: "^_(?:[^_].*)?$",
108
108
  },
109
109
  ],
110
+ "no-shadow": "off",
111
+ "@typescript-eslint/no-shadow": "error",
110
112
  // Turn off unnecessary rules
111
113
  "n/no-unsupported-features/es-syntax": "off",
112
114
  "n/no-missing-import": "off",
@@ -0,0 +1,7 @@
1
+ import { tsExtendRules } from "./base-config.js";
2
+ export { tsExtendRules };
3
+ export declare const tsParserOptions: {
4
+ project: string | undefined;
5
+ extraFileExtensions: string[];
6
+ };
7
+ export declare function getProject(): string | undefined;
@@ -0,0 +1,5 @@
1
+ import type { ESLint, Linter } from "eslint";
2
+ export declare const recommendedRules: Linter.RulesRecord;
3
+ export declare const recommendedTestFiles: string[];
4
+ export declare const recommendedTestRules: Linter.RulesRecord;
5
+ export declare const recommendedTestGlobals: ESLint.Globals | undefined;
@@ -23,7 +23,6 @@ exports.recommendedRules = {
23
23
  "no-useless-concat": "error",
24
24
  "no-new-object": "error",
25
25
  "no-tabs": "error",
26
- "require-jsdoc": "error",
27
26
  "prefer-template": "error",
28
27
  "object-shorthand": "error",
29
28
  "array-callback-return": "error",
@@ -225,7 +224,7 @@ exports.recommendedTestFiles = [
225
224
  "tests/**/*.cts",
226
225
  ];
227
226
  exports.recommendedTestRules = {
228
- "require-jsdoc": "off",
227
+ "jsdoc/require-jsdoc": "off",
229
228
  "no-console": "off",
230
229
  };
231
230
  exports.recommendedTestGlobals = {
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -26,6 +26,7 @@ const _typescript_js_1 = require("../config-helpers/+typescript.js");
26
26
  const module_js_1 = require("../utils/module.js");
27
27
  const base = __importStar(require("./ts/base-config.js"));
28
28
  const fallback_js_1 = require("./fallback.js");
29
+ const _md_js_1 = require("../config-helpers/+md.js");
29
30
  module.exports = (0, module_js_1.requireOf)([
30
31
  "@typescript-eslint/parser",
31
32
  "typescript",
@@ -43,6 +44,10 @@ module.exports = (0, module_js_1.requireOf)([
43
44
  ..._typescript_js_1.tsTestExtendRules,
44
45
  },
45
46
  },
47
+ {
48
+ files: _md_js_1.extInMdFiles,
49
+ extends: ["plugin:@typescript-eslint/disable-type-checked"],
50
+ },
46
51
  ],
47
52
  }), (missingList) => ({
48
53
  overrides: [
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ const module_js_1 = require("../../utils/module.js");
3
+ const fallback_js_1 = require("../fallback.js");
4
+ const jsdoc_js_1 = require("../../config-helpers/base-plugins/jsdoc.js");
5
+ module.exports = (0, module_js_1.requireOf)(["eslint-plugin-jsdoc"], () => ({
6
+ plugins: ["jsdoc"],
7
+ rules: {
8
+ ...jsdoc_js_1.jsdocRules,
9
+ },
10
+ }), fallback_js_1.buildFallbackForLegacy);
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,5 @@
1
+ import type { Linter } from "eslint";
2
+ /**
3
+ * Fallback Legacy config builder
4
+ */
5
+ export declare function buildFallbackForLegacy(missingList: string[]): Linter.Config;
@@ -0,0 +1,3 @@
1
+ import type { Linter } from "eslint";
2
+ declare const _default: Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
3
+ export = _default;
@@ -0,0 +1,26 @@
1
+ declare const _default: {
2
+ extends: string[];
3
+ parserOptions: {
4
+ sourceType: string;
5
+ ecmaVersion: number;
6
+ };
7
+ rules: {
8
+ [x: string]: import("eslint").Linter.RuleEntry<any[]>;
9
+ };
10
+ overrides: ({
11
+ files: string[];
12
+ extends: string[];
13
+ globals?: undefined;
14
+ rules?: undefined;
15
+ } | {
16
+ files: string[];
17
+ globals: {
18
+ [x: string]: boolean | "off" | "writable" | "readonly";
19
+ };
20
+ rules: {
21
+ [x: string]: import("eslint").Linter.RuleEntry<any[]>;
22
+ };
23
+ extends?: undefined;
24
+ })[];
25
+ };
26
+ export = _default;
@@ -5,6 +5,7 @@ module.exports = {
5
5
  "eslint:recommended",
6
6
  require.resolve("./base-plugins/eslint-comments"),
7
7
  require.resolve("./base-plugins/regexp"),
8
+ require.resolve("./base-plugins/jsdoc"),
8
9
  ],
9
10
  parserOptions: {
10
11
  sourceType: "module",
@@ -0,0 +1,10 @@
1
+ declare const extendsArray: string[];
2
+ export { extendsArray as extends };
3
+ export declare const parserOptions: {
4
+ project: string | undefined;
5
+ extraFileExtensions: string[];
6
+ sourceType: "module";
7
+ };
8
+ export declare const rules: {
9
+ [x: string]: import("eslint").Linter.RuleEntry<any[]>;
10
+ };
@@ -0,0 +1,2 @@
1
+ import { getProject } from "../../config-helpers/plugins/ts/index.js";
2
+ export { getProject };
package/lib/index.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ import type { BuildConfigOptions } from "./config-builder/index.js";
2
+ export declare function config(options?: BuildConfigOptions): import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
3
+ export declare const configs: {
4
+ recommended: any;
5
+ "+eslint-plugin": any;
6
+ "+json": any;
7
+ "+node": any;
8
+ "+prettier": any;
9
+ "+typescript": any;
10
+ "+vue2": any;
11
+ "+vue2-with-ts": any;
12
+ "+vue3": any;
13
+ "+vue3-with-ts": any;
14
+ "+svelte": any;
15
+ "+svelte-with-ts": any;
16
+ "+yaml": any;
17
+ "+toml": any;
18
+ "+md": any;
19
+ "+package-json": any;
20
+ };
21
+ export declare const rules: {
22
+ "missing-module-for-config": any;
23
+ };
24
+ declare const _default: {
25
+ config: typeof config;
26
+ configs: {
27
+ recommended: any;
28
+ "+eslint-plugin": any;
29
+ "+json": any;
30
+ "+node": any;
31
+ "+prettier": any;
32
+ "+typescript": any;
33
+ "+vue2": any;
34
+ "+vue2-with-ts": any;
35
+ "+vue3": any;
36
+ "+vue3-with-ts": any;
37
+ "+svelte": any;
38
+ "+svelte-with-ts": any;
39
+ "+yaml": any;
40
+ "+toml": any;
41
+ "+md": any;
42
+ "+package-json": any;
43
+ };
44
+ rules: {
45
+ "missing-module-for-config": any;
46
+ };
47
+ };
48
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { Linter } from "eslint";
2
+ export declare const meta: {
3
+ name: string;
4
+ version: any;
5
+ };
6
+ export declare function parseForESLint(text: string, _options?: any): Linter.ESLintParseResult;
7
+ export declare const anyParser: {
8
+ parseForESLint: typeof parseForESLint;
9
+ meta: {
10
+ name: string;
11
+ version: any;
12
+ };
13
+ };
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.anyParser = exports.parseForESLint = void 0;
3
+ exports.anyParser = exports.parseForESLint = exports.meta = void 0;
4
4
  const lineBreakPattern = /\r\n|[\n\r\u2028\u2029]/u;
5
+ exports.meta = {
6
+ name: __filename,
7
+ version: require("../../package.json").version,
8
+ };
5
9
  function parseForESLint(text, _options) {
6
10
  const lines = text.split(lineBreakPattern);
7
11
  return {
@@ -26,4 +30,4 @@ function parseForESLint(text, _options) {
26
30
  };
27
31
  }
28
32
  exports.parseForESLint = parseForESLint;
29
- exports.anyParser = { parseForESLint };
33
+ exports.anyParser = { parseForESLint, meta: exports.meta };
@@ -0,0 +1,16 @@
1
+ import type { Rule } from "eslint";
2
+ export declare const meta: {
3
+ type: string;
4
+ docs: {
5
+ description: string;
6
+ url: string;
7
+ };
8
+ fixable: string;
9
+ schema: {
10
+ type: string;
11
+ items: {
12
+ type: string;
13
+ };
14
+ }[];
15
+ };
16
+ export declare function create(context: Rule.RuleContext): {};
@@ -0,0 +1 @@
1
+ export declare function findRootDir(startPath: string): string | null;
@@ -0,0 +1 @@
1
+ export declare function getLinters(): any[];
@@ -0,0 +1,19 @@
1
+ import type { Linter } from "eslint";
2
+ export declare function requireFromCwd(modulePath: string): any;
3
+ export declare function resolveFromCwd(modulePath: string): string;
4
+ export declare function parseModule(name: string): {
5
+ moduleName: string;
6
+ version: string;
7
+ } | {
8
+ moduleName: string;
9
+ version: null;
10
+ };
11
+ /**
12
+ * Checks if exists module
13
+ */
14
+ export declare function has(name: string): boolean;
15
+ /**
16
+ * Checks exists module and return config
17
+ */
18
+ export declare function requireOf<C extends Linter.FlatConfig[] | Linter.Config>(names: string[], getConfig: () => C, fallback: (missingList: string[]) => C): C;
19
+ export declare function tryInstall(moduleName: string, targetFile?: string): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ota-meshi/eslint-plugin",
3
- "version": "0.16.1",
3
+ "version": "0.17.1",
4
4
  "description": "ESLint configuration plugin for me.",
5
5
  "repository": "git+https://github.com/ota-meshi/eslint-plugin.git",
6
6
  "homepage": "https://github.com/ota-meshi/eslint-plugin#readme",
@@ -44,6 +44,7 @@
44
44
  "eslint-config-prettier": "^9.0.0",
45
45
  "eslint-plugin-astro": "^0.34.0",
46
46
  "eslint-plugin-eslint-plugin": "^6.0.0",
47
+ "eslint-plugin-jsdoc": "^48.2.3",
47
48
  "eslint-plugin-json-schema-validator": "^5.0.0",
48
49
  "eslint-plugin-jsonc": "^2.0.0",
49
50
  "eslint-plugin-markdown": "^4.0.0",