@api-extractor-tools/eslint-plugin 0.1.0-alpha.0 → 0.1.0-alpha.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 (104) hide show
  1. package/ARCHITECTURE.md +201 -0
  2. package/CHANGELOG.md +24 -0
  3. package/README.md +306 -10
  4. package/api-extractor.json +1 -0
  5. package/dist/configs/recommended.d.ts +1 -1
  6. package/dist/configs/recommended.d.ts.map +1 -1
  7. package/dist/configs/recommended.js +7 -1
  8. package/dist/configs/recommended.js.map +1 -1
  9. package/dist/index.d.ts +9 -16
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +11 -15
  12. package/dist/index.js.map +1 -1
  13. package/dist/node.d.ts +28 -0
  14. package/dist/node.d.ts.map +1 -0
  15. package/dist/node.js +41 -0
  16. package/dist/node.js.map +1 -0
  17. package/dist/rules/extra-release-tag.d.ts +24 -0
  18. package/dist/rules/extra-release-tag.d.ts.map +1 -0
  19. package/dist/rules/extra-release-tag.js +141 -0
  20. package/dist/rules/extra-release-tag.js.map +1 -0
  21. package/dist/rules/forgotten-export.d.ts +24 -0
  22. package/dist/rules/forgotten-export.d.ts.map +1 -0
  23. package/dist/rules/forgotten-export.js +212 -0
  24. package/dist/rules/forgotten-export.js.map +1 -0
  25. package/dist/rules/incompatible-release-tags.d.ts +25 -0
  26. package/dist/rules/incompatible-release-tags.d.ts.map +1 -0
  27. package/dist/rules/incompatible-release-tags.js +237 -0
  28. package/dist/rules/incompatible-release-tags.js.map +1 -0
  29. package/dist/rules/index.d.ts +2 -6
  30. package/dist/rules/index.d.ts.map +1 -1
  31. package/dist/rules/index.js +13 -1
  32. package/dist/rules/index.js.map +1 -1
  33. package/dist/rules/missing-release-tag.d.ts +4 -0
  34. package/dist/rules/missing-release-tag.d.ts.map +1 -1
  35. package/dist/rules/missing-release-tag.js +14 -21
  36. package/dist/rules/missing-release-tag.js.map +1 -1
  37. package/dist/rules/override-keyword.d.ts +4 -0
  38. package/dist/rules/override-keyword.d.ts.map +1 -1
  39. package/dist/rules/override-keyword.js +9 -11
  40. package/dist/rules/override-keyword.js.map +1 -1
  41. package/dist/rules/package-documentation.d.ts +1 -1
  42. package/dist/rules/package-documentation.d.ts.map +1 -1
  43. package/dist/rules/package-documentation.js +7 -28
  44. package/dist/rules/package-documentation.js.map +1 -1
  45. package/dist/rules/public-on-non-exported.d.ts +24 -0
  46. package/dist/rules/public-on-non-exported.d.ts.map +1 -0
  47. package/dist/rules/public-on-non-exported.js +191 -0
  48. package/dist/rules/public-on-non-exported.js.map +1 -0
  49. package/dist/rules/public-on-private-member.d.ts +24 -0
  50. package/dist/rules/public-on-private-member.d.ts.map +1 -0
  51. package/dist/rules/public-on-private-member.js +111 -0
  52. package/dist/rules/public-on-private-member.js.map +1 -0
  53. package/dist/rules/valid-enum-type.d.ts +17 -0
  54. package/dist/rules/valid-enum-type.d.ts.map +1 -0
  55. package/dist/rules/valid-enum-type.js +206 -0
  56. package/dist/rules/valid-enum-type.js.map +1 -0
  57. package/dist/types.d.ts +63 -35
  58. package/dist/types.d.ts.map +1 -1
  59. package/dist/types.js +4 -1
  60. package/dist/types.js.map +1 -1
  61. package/dist/utils/tsdoc-parser.d.ts +35 -0
  62. package/dist/utils/tsdoc-parser.d.ts.map +1 -1
  63. package/dist/utils/tsdoc-parser.js +40 -0
  64. package/dist/utils/tsdoc-parser.js.map +1 -1
  65. package/docs/rules/valid-enum-type.md +153 -0
  66. package/package.json +22 -8
  67. package/src/configs/recommended.ts +7 -1
  68. package/src/index.ts +21 -15
  69. package/src/node.ts +50 -0
  70. package/src/rules/extra-release-tag.ts +201 -0
  71. package/src/rules/forgotten-export.ts +274 -0
  72. package/src/rules/incompatible-release-tags.ts +331 -0
  73. package/src/rules/index.ts +13 -1
  74. package/src/rules/missing-release-tag.ts +11 -26
  75. package/src/rules/override-keyword.ts +6 -8
  76. package/src/rules/package-documentation.ts +5 -31
  77. package/src/rules/public-on-non-exported.ts +265 -0
  78. package/src/rules/public-on-private-member.ts +157 -0
  79. package/src/rules/valid-enum-type.ts +252 -0
  80. package/src/types.ts +60 -17
  81. package/src/utils/config-loader.ts +1 -0
  82. package/src/utils/entry-point.ts +1 -0
  83. package/src/utils/tsdoc-parser.ts +67 -0
  84. package/temp/eslint-plugin.api.md +96 -47
  85. package/test/index.test.ts +1 -0
  86. package/test/rules/extra-release-tag.test.ts +276 -0
  87. package/test/rules/forgotten-export.test.ts +190 -0
  88. package/test/rules/incompatible-release-tags.test.ts +340 -0
  89. package/test/rules/missing-release-tag.test.ts +2 -1
  90. package/test/rules/override-keyword.test.ts +2 -1
  91. package/test/rules/package-documentation.test.ts +8 -6
  92. package/test/rules/public-on-non-exported.test.ts +201 -0
  93. package/test/rules/public-on-private-member.test.ts +207 -0
  94. package/test/rules/valid-enum-type.test.ts +409 -0
  95. package/test/types.test-d.ts +20 -0
  96. package/test/utils/config-loader.test.ts +1 -0
  97. package/test/utils/tsdoc-parser.test.ts +117 -9
  98. package/tsconfig.json +1 -0
  99. package/vitest.config.mts +1 -0
  100. package/dist/utils/index.d.ts +0 -8
  101. package/dist/utils/index.d.ts.map +0 -1
  102. package/dist/utils/index.js +0 -21
  103. package/dist/utils/index.js.map +0 -1
  104. package/src/utils/index.ts +0 -17
package/dist/index.js CHANGED
@@ -2,10 +2,6 @@
2
2
  /**
3
3
  * ESLint plugin providing authoring-time feedback for API Extractor.
4
4
  *
5
- * @remarks
6
- * This plugin provides ESLint rules that mirror API Extractor's validations,
7
- * enabling developers to catch issues during development rather than at build time.
8
- *
9
5
  * @example
10
6
  * Using with flat config (eslint.config.js):
11
7
  * ```js
@@ -13,15 +9,6 @@
13
9
  *
14
10
  * export default [
15
11
  * apiExtractorPlugin.configs.recommended,
16
- * // Or configure rules individually:
17
- * {
18
- * plugins: {
19
- * '@api-extractor-tools': apiExtractorPlugin,
20
- * },
21
- * rules: {
22
- * '@api-extractor-tools/missing-release-tag': 'error',
23
- * },
24
- * },
25
12
  * ];
26
13
  * ```
27
14
  *
@@ -37,16 +24,25 @@
37
24
  * @packageDocumentation
38
25
  */
39
26
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.recommendedRules = exports.rules = exports.RELEASE_TAGS = void 0;
27
+ exports.recommendedRules = exports.rules = exports.extractEnumType = exports.findAllTSDocComments = exports.getLeadingTSDocComment = exports.hasPackageDocumentation = exports.hasOverrideTag = exports.extractReleaseTag = exports.parseTSDocComment = exports.RELEASE_TAGS = void 0;
41
28
  const rules_1 = require("./rules");
42
29
  Object.defineProperty(exports, "rules", { enumerable: true, get: function () { return rules_1.rules; } });
43
30
  const configs_1 = require("./configs");
44
31
  Object.defineProperty(exports, "recommendedRules", { enumerable: true, get: function () { return configs_1.recommendedRules; } });
45
32
  var types_1 = require("./types");
46
33
  Object.defineProperty(exports, "RELEASE_TAGS", { enumerable: true, get: function () { return types_1.RELEASE_TAGS; } });
34
+ // Re-export TSDoc utilities (browser-safe)
35
+ var tsdoc_parser_1 = require("./utils/tsdoc-parser");
36
+ Object.defineProperty(exports, "parseTSDocComment", { enumerable: true, get: function () { return tsdoc_parser_1.parseTSDocComment; } });
37
+ Object.defineProperty(exports, "extractReleaseTag", { enumerable: true, get: function () { return tsdoc_parser_1.extractReleaseTag; } });
38
+ Object.defineProperty(exports, "hasOverrideTag", { enumerable: true, get: function () { return tsdoc_parser_1.hasOverrideTag; } });
39
+ Object.defineProperty(exports, "hasPackageDocumentation", { enumerable: true, get: function () { return tsdoc_parser_1.hasPackageDocumentation; } });
40
+ Object.defineProperty(exports, "getLeadingTSDocComment", { enumerable: true, get: function () { return tsdoc_parser_1.getLeadingTSDocComment; } });
41
+ Object.defineProperty(exports, "findAllTSDocComments", { enumerable: true, get: function () { return tsdoc_parser_1.findAllTSDocComments; } });
42
+ Object.defineProperty(exports, "extractEnumType", { enumerable: true, get: function () { return tsdoc_parser_1.extractEnumType; } });
47
43
  /**
48
44
  * The ESLint plugin object.
49
- * @public
45
+ * @alpha
50
46
  */
51
47
  const plugin = {
52
48
  meta: {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;AAGH,mCAA+B;AAsEtB,sFAtEA,aAAK,OAsEA;AArEd,uCAAyE;AAsEhE,iGAtEA,0BAAgB,OAsEA;AAvDzB,iCAAsC;AAA7B,qGAAA,YAAY,OAAA;AA2BrB;;;GAGG;AACH,MAAM,MAAM,GAA6B;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,oCAAoC;QAC1C,OAAO,EAAE,OAAO;KACjB;IACD,KAAK,EAAL,aAAK;IACL,OAAO,EAAE;QACP,WAAW,EAAE,IAA6C;QAC1D,oBAAoB,EAAE;YACpB,OAAO,EAAE,CAAC,sBAAsB,CAAC;YACjC,KAAK,EAAE,0BAAgB;SACxB;KACF;CACF,CAAA;AAED,sEAAsE;AACtE,MAAM,CAAC,OAAO,CAAC,WAAW,GAAG,IAAA,qCAA2B,EACtD,MAA4C,CAC7C,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAGH,mCAA+B;AAyFtB,sFAzFA,aAAK,OAyFA;AAxFd,uCAAyE;AAyFhE,iGAzFA,0BAAgB,OAyFA;AApEzB,iCAAsC;AAA7B,qGAAA,YAAY,OAAA;AAErB,2CAA2C;AAC3C,qDAU6B;AAT3B,iHAAA,iBAAiB,OAAA;AACjB,iHAAA,iBAAiB,OAAA;AACjB,8GAAA,cAAc,OAAA;AACd,uHAAA,uBAAuB,OAAA;AACvB,sHAAA,sBAAsB,OAAA;AACtB,oHAAA,oBAAoB,OAAA;AACpB,+GAAA,eAAe,OAAA;AA8BjB;;;GAGG;AACH,MAAM,MAAM,GAA6B;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,oCAAoC;QAC1C,OAAO,EAAE,OAAO;KACjB;IACD,KAAK,EAAL,aAAK;IACL,OAAO,EAAE;QACP,WAAW,EAAE,IAA6C;QAC1D,oBAAoB,EAAE;YACpB,OAAO,EAAE,CAAC,sBAAsB,CAAC;YACjC,KAAK,EAAE,0BAAgB;SACxB;KACF;CACF,CAAA;AAED,sEAAsE;AACtE,MAAM,CAAC,OAAO,CAAC,WAAW,GAAG,IAAA,qCAA2B,EACtD,MAA4C,CAC7C,CAAA;AAED,kBAAe,MAAM,CAAA"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Node.js-specific utilities for the ESLint plugin.
3
+ *
4
+ * @remarks
5
+ * These utilities require Node.js file system access. Use them to:
6
+ * - Load api-extractor.json configuration
7
+ * - Discover configuration file locations
8
+ * - Determine package entry points
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import {
13
+ * findApiExtractorConfig,
14
+ * loadApiExtractorConfig,
15
+ * getMessageLogLevel,
16
+ * } from '@api-extractor-tools/eslint-plugin/node';
17
+ *
18
+ * const configPath = findApiExtractorConfig(__dirname);
19
+ * const config = configPath ? loadApiExtractorConfig(configPath) : null;
20
+ * const severity = getMessageLogLevel(config, 'ae-missing-release-tag');
21
+ * ```
22
+ *
23
+ * @packageDocumentation
24
+ */
25
+ export { findApiExtractorConfig, loadApiExtractorConfig, resolveConfig, getMessageLogLevel, logLevelToSeverity, clearConfigCache, } from './utils/config-loader';
26
+ export { findPackageJson, loadPackageJson, resolveEntryPoints, isEntryPoint, clearPackageJsonCache, } from './utils/entry-point';
27
+ export type { ApiExtractorConfig, ApiExtractorLogLevel, ApiExtractorMessagesConfig, MessageConfig, ResolvedEntryPoints, } from './types';
28
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,GACtB,MAAM,qBAAqB,CAAA;AAG5B,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,mBAAmB,GACpB,MAAM,SAAS,CAAA"}
package/dist/node.js ADDED
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * Node.js-specific utilities for the ESLint plugin.
4
+ *
5
+ * @remarks
6
+ * These utilities require Node.js file system access. Use them to:
7
+ * - Load api-extractor.json configuration
8
+ * - Discover configuration file locations
9
+ * - Determine package entry points
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import {
14
+ * findApiExtractorConfig,
15
+ * loadApiExtractorConfig,
16
+ * getMessageLogLevel,
17
+ * } from '@api-extractor-tools/eslint-plugin/node';
18
+ *
19
+ * const configPath = findApiExtractorConfig(__dirname);
20
+ * const config = configPath ? loadApiExtractorConfig(configPath) : null;
21
+ * const severity = getMessageLogLevel(config, 'ae-missing-release-tag');
22
+ * ```
23
+ *
24
+ * @packageDocumentation
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.clearPackageJsonCache = exports.isEntryPoint = exports.resolveEntryPoints = exports.loadPackageJson = exports.findPackageJson = exports.clearConfigCache = exports.logLevelToSeverity = exports.getMessageLogLevel = exports.resolveConfig = exports.loadApiExtractorConfig = exports.findApiExtractorConfig = void 0;
28
+ var config_loader_1 = require("./utils/config-loader");
29
+ Object.defineProperty(exports, "findApiExtractorConfig", { enumerable: true, get: function () { return config_loader_1.findApiExtractorConfig; } });
30
+ Object.defineProperty(exports, "loadApiExtractorConfig", { enumerable: true, get: function () { return config_loader_1.loadApiExtractorConfig; } });
31
+ Object.defineProperty(exports, "resolveConfig", { enumerable: true, get: function () { return config_loader_1.resolveConfig; } });
32
+ Object.defineProperty(exports, "getMessageLogLevel", { enumerable: true, get: function () { return config_loader_1.getMessageLogLevel; } });
33
+ Object.defineProperty(exports, "logLevelToSeverity", { enumerable: true, get: function () { return config_loader_1.logLevelToSeverity; } });
34
+ Object.defineProperty(exports, "clearConfigCache", { enumerable: true, get: function () { return config_loader_1.clearConfigCache; } });
35
+ var entry_point_1 = require("./utils/entry-point");
36
+ Object.defineProperty(exports, "findPackageJson", { enumerable: true, get: function () { return entry_point_1.findPackageJson; } });
37
+ Object.defineProperty(exports, "loadPackageJson", { enumerable: true, get: function () { return entry_point_1.loadPackageJson; } });
38
+ Object.defineProperty(exports, "resolveEntryPoints", { enumerable: true, get: function () { return entry_point_1.resolveEntryPoints; } });
39
+ Object.defineProperty(exports, "isEntryPoint", { enumerable: true, get: function () { return entry_point_1.isEntryPoint; } });
40
+ Object.defineProperty(exports, "clearPackageJsonCache", { enumerable: true, get: function () { return entry_point_1.clearPackageJsonCache; } });
41
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,uDAO8B;AAN5B,uHAAA,sBAAsB,OAAA;AACtB,uHAAA,sBAAsB,OAAA;AACtB,8GAAA,aAAa,OAAA;AACb,mHAAA,kBAAkB,OAAA;AAClB,mHAAA,kBAAkB,OAAA;AAClB,iHAAA,gBAAgB,OAAA;AAGlB,mDAM4B;AAL1B,8GAAA,eAAe,OAAA;AACf,8GAAA,eAAe,OAAA;AACf,iHAAA,kBAAkB,OAAA;AAClB,2GAAA,YAAY,OAAA;AACZ,oHAAA,qBAAqB,OAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ESLint rule for detecting multiple release tags on a single symbol.
3
+ *
4
+ * @remarks
5
+ * This rule detects when a symbol has more than one release tag
6
+ * (e.g., both `@public` and `@beta`). Each symbol should have exactly one release tag.
7
+ *
8
+ * @internal
9
+ */
10
+ import { ESLintUtils } from '@typescript-eslint/utils';
11
+ import type { ApiExtractorLogLevel } from '../types';
12
+ /**
13
+ * Options for the extra-release-tag rule.
14
+ * @alpha
15
+ */
16
+ export interface ExtraReleaseTagRuleOptions {
17
+ /**
18
+ * Severity level for extra release tags.
19
+ * @defaultValue 'error'
20
+ */
21
+ severity?: ApiExtractorLogLevel;
22
+ }
23
+ export declare const extraReleaseTag: ESLintUtils.RuleModule<"extraReleaseTag", [ExtraReleaseTagRuleOptions], unknown, ESLintUtils.RuleListener>;
24
+ //# sourceMappingURL=extra-release-tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extra-release-tag.d.ts","sourceRoot":"","sources":["../../src/rules/extra-release-tag.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAkB,WAAW,EAAY,MAAM,0BAA0B,CAAA;AAKhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AASpD;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAA;CAChC;AAED,eAAO,MAAM,eAAe,4GAoK1B,CAAA"}
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ /**
3
+ * ESLint rule for detecting multiple release tags on a single symbol.
4
+ *
5
+ * @remarks
6
+ * This rule detects when a symbol has more than one release tag
7
+ * (e.g., both `@public` and `@beta`). Each symbol should have exactly one release tag.
8
+ *
9
+ * @internal
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.extraReleaseTag = void 0;
13
+ const utils_1 = require("@typescript-eslint/utils");
14
+ const tsdoc_parser_1 = require("../utils/tsdoc-parser");
15
+ const createRule = utils_1.ESLintUtils.RuleCreator((name) => `https://github.com/mike-north/api-extractor-tools/blob/main/tools/eslint-plugin/docs/rules/${name}.md`);
16
+ exports.extraReleaseTag = createRule({
17
+ name: 'extra-release-tag',
18
+ meta: {
19
+ type: 'problem',
20
+ docs: {
21
+ description: 'Require that symbols have at most one release tag (@public, @beta, @alpha, or @internal)',
22
+ },
23
+ messages: {
24
+ extraReleaseTag: 'Symbol "{{name}}" has multiple release tags: {{tags}}. Each symbol should have exactly one release tag.',
25
+ },
26
+ schema: [
27
+ {
28
+ type: 'object',
29
+ properties: {
30
+ severity: {
31
+ type: 'string',
32
+ enum: ['error', 'warning', 'none'],
33
+ description: 'Severity level for extra release tags',
34
+ },
35
+ },
36
+ additionalProperties: false,
37
+ },
38
+ ],
39
+ },
40
+ defaultOptions: [{}],
41
+ create(context) {
42
+ const options = context.options[0] ?? {};
43
+ const severity = options.severity ?? 'error';
44
+ // If severity is 'none', disable the rule
45
+ if (severity === 'none') {
46
+ return {};
47
+ }
48
+ const sourceCode = context.sourceCode;
49
+ /**
50
+ * Counts release tags in a TSDoc comment.
51
+ */
52
+ function countReleaseTags(node) {
53
+ const commentText = (0, tsdoc_parser_1.getLeadingTSDocComment)(sourceCode, node);
54
+ if (!commentText) {
55
+ return { count: 0, tags: [] };
56
+ }
57
+ const parsed = (0, tsdoc_parser_1.parseTSDocComment)(commentText);
58
+ if (!parsed.docComment) {
59
+ return { count: 0, tags: [] };
60
+ }
61
+ const modifierTagSet = parsed.docComment.modifierTagSet;
62
+ const tags = [];
63
+ if (modifierTagSet.isPublic()) {
64
+ tags.push('@public');
65
+ }
66
+ if (modifierTagSet.isBeta()) {
67
+ tags.push('@beta');
68
+ }
69
+ if (modifierTagSet.isAlpha()) {
70
+ tags.push('@alpha');
71
+ }
72
+ if (modifierTagSet.isInternal()) {
73
+ tags.push('@internal');
74
+ }
75
+ return { count: tags.length, tags };
76
+ }
77
+ /**
78
+ * Gets the name of a declaration.
79
+ */
80
+ function getDeclarationName(node) {
81
+ if (node.type === utils_1.AST_NODE_TYPES.VariableDeclaration) {
82
+ const firstDeclarator = node.declarations[0];
83
+ if (firstDeclarator?.id.type === utils_1.AST_NODE_TYPES.Identifier) {
84
+ return firstDeclarator.id.name;
85
+ }
86
+ return '<unknown>';
87
+ }
88
+ if ('id' in node && node.id) {
89
+ return node.id.name;
90
+ }
91
+ return '<anonymous>';
92
+ }
93
+ /**
94
+ * Checks a declaration for multiple release tags.
95
+ */
96
+ function checkDeclaration(node) {
97
+ // Check both the export statement and the declaration for the comment
98
+ const exportNode = node.parent;
99
+ let releaseTagInfo = countReleaseTags(node);
100
+ // If no tags on the declaration, check the export statement
101
+ if (releaseTagInfo.count === 0 &&
102
+ exportNode &&
103
+ (exportNode.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration ||
104
+ exportNode.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration)) {
105
+ releaseTagInfo = countReleaseTags(exportNode);
106
+ }
107
+ if (releaseTagInfo.count > 1) {
108
+ const name = getDeclarationName(node);
109
+ context.report({
110
+ node,
111
+ messageId: 'extraReleaseTag',
112
+ data: {
113
+ name,
114
+ tags: releaseTagInfo.tags.join(', '),
115
+ },
116
+ });
117
+ }
118
+ }
119
+ return {
120
+ FunctionDeclaration(node) {
121
+ checkDeclaration(node);
122
+ },
123
+ ClassDeclaration(node) {
124
+ checkDeclaration(node);
125
+ },
126
+ TSInterfaceDeclaration(node) {
127
+ checkDeclaration(node);
128
+ },
129
+ TSTypeAliasDeclaration(node) {
130
+ checkDeclaration(node);
131
+ },
132
+ TSEnumDeclaration(node) {
133
+ checkDeclaration(node);
134
+ },
135
+ VariableDeclaration(node) {
136
+ checkDeclaration(node);
137
+ },
138
+ };
139
+ },
140
+ });
141
+ //# sourceMappingURL=extra-release-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extra-release-tag.js","sourceRoot":"","sources":["../../src/rules/extra-release-tag.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,oDAAgF;AAChF,wDAG8B;AAG9B,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC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AAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ESLint rule for detecting forgotten exports (symbols referenced but not exported).
3
+ *
4
+ * @remarks
5
+ * This rule detects when an exported API references a type or symbol that is not
6
+ * exported from the entry point, mirroring API Extractor's ae-forgotten-export message.
7
+ *
8
+ * @internal
9
+ */
10
+ import { ESLintUtils } from '@typescript-eslint/utils';
11
+ import type { ApiExtractorLogLevel } from '../types';
12
+ /**
13
+ * Options for the forgotten-export rule.
14
+ * @alpha
15
+ */
16
+ export interface ForgottenExportRuleOptions {
17
+ /**
18
+ * Severity level for forgotten exports.
19
+ * @defaultValue 'warning'
20
+ */
21
+ severity?: ApiExtractorLogLevel;
22
+ }
23
+ export declare const forgottenExport: ESLintUtils.RuleModule<"forgottenExport", [ForgottenExportRuleOptions], unknown, ESLintUtils.RuleListener>;
24
+ //# sourceMappingURL=forgotten-export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forgotten-export.d.ts","sourceRoot":"","sources":["../../src/rules/forgotten-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAkB,WAAW,EAAY,MAAM,0BAA0B,CAAA;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AASpD;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAA;CAChC;AAED,eAAO,MAAM,eAAe,4GAiP1B,CAAA"}
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ /**
3
+ * ESLint rule for detecting forgotten exports (symbols referenced but not exported).
4
+ *
5
+ * @remarks
6
+ * This rule detects when an exported API references a type or symbol that is not
7
+ * exported from the entry point, mirroring API Extractor's ae-forgotten-export message.
8
+ *
9
+ * @internal
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.forgottenExport = void 0;
13
+ const utils_1 = require("@typescript-eslint/utils");
14
+ const createRule = utils_1.ESLintUtils.RuleCreator((name) => `https://github.com/mike-north/api-extractor-tools/blob/main/tools/eslint-plugin/docs/rules/${name}.md`);
15
+ exports.forgottenExport = createRule({
16
+ name: 'forgotten-export',
17
+ meta: {
18
+ type: 'problem',
19
+ docs: {
20
+ description: 'Require that types and symbols referenced by exported APIs are also exported',
21
+ },
22
+ messages: {
23
+ forgottenExport: 'The symbol "{{name}}" needs to be exported because it is referenced by the exported API "{{exportedName}}".',
24
+ },
25
+ schema: [
26
+ {
27
+ type: 'object',
28
+ properties: {
29
+ severity: {
30
+ type: 'string',
31
+ enum: ['error', 'warning', 'none'],
32
+ description: 'Severity level for forgotten exports',
33
+ },
34
+ },
35
+ additionalProperties: false,
36
+ },
37
+ ],
38
+ },
39
+ defaultOptions: [{}],
40
+ create(context) {
41
+ const options = context.options[0] ?? {};
42
+ const severity = options.severity ?? 'warning';
43
+ // If severity is 'none', disable the rule
44
+ if (severity === 'none') {
45
+ return {};
46
+ }
47
+ const exportedSymbols = new Set();
48
+ const definedSymbols = new Set();
49
+ const referencedSymbols = new Map();
50
+ /**
51
+ * Collects all exported symbol names.
52
+ */
53
+ function collectExportedSymbols(node) {
54
+ if (node.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) {
55
+ // export { foo, bar }
56
+ if (node.specifiers) {
57
+ for (const specifier of node.specifiers) {
58
+ if (specifier.type === utils_1.AST_NODE_TYPES.ExportSpecifier) {
59
+ if (specifier.exported.type === utils_1.AST_NODE_TYPES.Identifier) {
60
+ exportedSymbols.add(specifier.exported.name);
61
+ }
62
+ }
63
+ }
64
+ }
65
+ // export function foo() {} or export class Bar {}
66
+ if (node.declaration) {
67
+ const decl = node.declaration;
68
+ if ('id' in decl &&
69
+ decl.id &&
70
+ decl.id.type === utils_1.AST_NODE_TYPES.Identifier) {
71
+ exportedSymbols.add(decl.id.name);
72
+ }
73
+ else if (decl.type === utils_1.AST_NODE_TYPES.VariableDeclaration) {
74
+ for (const declarator of decl.declarations) {
75
+ if (declarator.id.type === utils_1.AST_NODE_TYPES.Identifier) {
76
+ exportedSymbols.add(declarator.id.name);
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ /**
84
+ * Collects all defined symbols (types, interfaces, classes, etc.).
85
+ */
86
+ function collectDefinedSymbol(node) {
87
+ if (node.type === utils_1.AST_NODE_TYPES.VariableDeclaration) {
88
+ for (const declarator of node.declarations) {
89
+ if (declarator.id.type === utils_1.AST_NODE_TYPES.Identifier) {
90
+ definedSymbols.add(declarator.id.name);
91
+ }
92
+ }
93
+ }
94
+ else if ('id' in node && node.id) {
95
+ definedSymbols.add(node.id.name);
96
+ }
97
+ }
98
+ /**
99
+ * Collects type references in exported declarations.
100
+ */
101
+ function collectTypeReferences(node, exportedName) {
102
+ const visited = new WeakSet();
103
+ // Helper to recursively find type references
104
+ function findTypeReferences(n) {
105
+ // Avoid infinite recursion
106
+ if (visited.has(n)) {
107
+ return;
108
+ }
109
+ visited.add(n);
110
+ if (n.type === utils_1.AST_NODE_TYPES.TSTypeReference) {
111
+ const typeName = n.typeName;
112
+ if (typeName.type === utils_1.AST_NODE_TYPES.Identifier) {
113
+ const name = typeName.name;
114
+ // Don't track built-in types
115
+ if (![
116
+ 'string',
117
+ 'number',
118
+ 'boolean',
119
+ 'void',
120
+ 'any',
121
+ 'unknown',
122
+ 'never',
123
+ ].includes(name)) {
124
+ if (!referencedSymbols.has(name)) {
125
+ referencedSymbols.set(name, { node: n, exportedName });
126
+ }
127
+ }
128
+ }
129
+ }
130
+ // Recursively check child nodes, but skip 'parent' property to avoid cycles
131
+ for (const key in n) {
132
+ if (key === 'parent') {
133
+ continue;
134
+ }
135
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
136
+ const child = n[key];
137
+ if (child && typeof child === 'object') {
138
+ if (Array.isArray(child)) {
139
+ for (const item of child) {
140
+ if (item && typeof item === 'object' && 'type' in item) {
141
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
142
+ findTypeReferences(item);
143
+ }
144
+ }
145
+ }
146
+ else if ('type' in child) {
147
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
148
+ findTypeReferences(child);
149
+ }
150
+ }
151
+ }
152
+ }
153
+ findTypeReferences(node);
154
+ }
155
+ return {
156
+ ExportNamedDeclaration(node) {
157
+ collectExportedSymbols(node);
158
+ // If this is an export with a declaration, check for type references
159
+ if (node.declaration) {
160
+ const decl = node.declaration;
161
+ let exportedName = '<unknown>';
162
+ if ('id' in decl &&
163
+ decl.id &&
164
+ decl.id.type === utils_1.AST_NODE_TYPES.Identifier) {
165
+ exportedName = decl.id.name;
166
+ }
167
+ else if (decl.type === utils_1.AST_NODE_TYPES.VariableDeclaration) {
168
+ const firstDeclarator = decl.declarations[0];
169
+ if (firstDeclarator?.id.type === utils_1.AST_NODE_TYPES.Identifier) {
170
+ exportedName = firstDeclarator.id.name;
171
+ }
172
+ }
173
+ collectTypeReferences(decl, exportedName);
174
+ }
175
+ },
176
+ ExportDefaultDeclaration(node) {
177
+ collectExportedSymbols(node);
178
+ },
179
+ FunctionDeclaration(node) {
180
+ collectDefinedSymbol(node);
181
+ },
182
+ ClassDeclaration(node) {
183
+ collectDefinedSymbol(node);
184
+ },
185
+ TSInterfaceDeclaration(node) {
186
+ collectDefinedSymbol(node);
187
+ },
188
+ TSTypeAliasDeclaration(node) {
189
+ collectDefinedSymbol(node);
190
+ },
191
+ TSEnumDeclaration(node) {
192
+ collectDefinedSymbol(node);
193
+ },
194
+ VariableDeclaration(node) {
195
+ collectDefinedSymbol(node);
196
+ },
197
+ 'Program:exit'() {
198
+ // Check for forgotten exports
199
+ for (const [name, { node, exportedName }] of referencedSymbols) {
200
+ if (definedSymbols.has(name) && !exportedSymbols.has(name)) {
201
+ context.report({
202
+ node,
203
+ messageId: 'forgottenExport',
204
+ data: { name, exportedName },
205
+ });
206
+ }
207
+ }
208
+ },
209
+ };
210
+ },
211
+ });
212
+ //# sourceMappingURL=forgotten-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forgotten-export.js","sourceRoot":"","sources":["../../src/rules/forgotten-export.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,oDAAgF;AAGhF,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,CAAC,IAAI,EAAE,EAAE,CACP,8FAA8F,IAAI,KAAK,CAC1G,CAAA;AAgBY,QAAA,eAAe,GAAG,UAAU,CAGvC;IACA,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,8EAA8E;SACjF;QACD,QAAQ,EAAE;YACR,eAAe,EACb,6GAA6G;SAChH;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC;wBAClC,WAAW,EAAE,sCAAsC;qBACpD;iBACF;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,cAAc,EAAE,CAAC,EAAE,CAAC;IACpB,MAAM,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,SAAS,CAAA;QAE9C,0CAA0C;QAC1C,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YACxB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAA;QACzC,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAA;QACxC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAG9B,CAAA;QAEH;;WAEG;QACH,SAAS,sBAAsB,CAC7B,IAAyE;Y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C,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC3D,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI;4BACJ,SAAS,EAAE,iBAAiB;4BAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;yBAC7B,CAAC,CAAA;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * ESLint rule for detecting incompatible release tags.
3
+ *
4
+ * @remarks
5
+ * This rule detects when an exported API with a specific release tag references
6
+ * another symbol with a less visible release tag. For example, a @public API
7
+ * should not reference an @internal type.
8
+ *
9
+ * @internal
10
+ */
11
+ import { ESLintUtils } from '@typescript-eslint/utils';
12
+ import type { ApiExtractorLogLevel } from '../types';
13
+ /**
14
+ * Options for the incompatible-release-tags rule.
15
+ * @alpha
16
+ */
17
+ export interface IncompatibleReleaseTagsRuleOptions {
18
+ /**
19
+ * Severity level for incompatible release tags.
20
+ * @defaultValue 'warning'
21
+ */
22
+ severity?: ApiExtractorLogLevel;
23
+ }
24
+ export declare const incompatibleReleaseTags: ESLintUtils.RuleModule<"incompatibleReleaseTags", [IncompatibleReleaseTagsRuleOptions], unknown, ESLintUtils.RuleListener>;
25
+ //# sourceMappingURL=incompatible-release-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incompatible-release-tags.d.ts","sourceRoot":"","sources":["../../src/rules/incompatible-release-tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,WAAW,EAAY,MAAM,0BAA0B,CAAA;AAMhF,OAAO,KAAK,EAAE,oBAAoB,EAAc,MAAM,UAAU,CAAA;AAShE;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAA;CAChC;AAUD,eAAO,MAAM,uBAAuB,4HA4RlC,CAAA"}