npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@api-extractor-tools/eslint-plugin

v0.1.0-alpha.2

Published

ESLint plugin providing authoring-time feedback for API Extractor

Readme

@api-extractor-tools/eslint-plugin

npm version

ESLint plugin providing authoring-time feedback for API Extractor. Catch common API Extractor issues during development rather than waiting for the build step.

Installation

npm install --save-dev @api-extractor-tools/eslint-plugin
# or
pnpm add -D @api-extractor-tools/eslint-plugin
# or
yarn add -D @api-extractor-tools/eslint-plugin

Usage

Flat Config (eslint.config.js) - Recommended

import apiExtractorPlugin from '@api-extractor-tools/eslint-plugin'

export default [
  // Use the recommended configuration
  apiExtractorPlugin.configs.recommended,

  // Or configure rules individually
  {
    plugins: {
      '@api-extractor-tools': apiExtractorPlugin,
    },
    rules: {
      '@api-extractor-tools/missing-release-tag': 'error',
      '@api-extractor-tools/override-keyword': 'error',
      '@api-extractor-tools/package-documentation': 'warn',
      '@api-extractor-tools/forgotten-export': 'warn',
      '@api-extractor-tools/incompatible-release-tags': 'warn',
      '@api-extractor-tools/extra-release-tag': 'error',
      '@api-extractor-tools/public-on-private-member': 'error',
      '@api-extractor-tools/public-on-non-exported': 'error',
      '@api-extractor-tools/valid-enum-type': 'warn',
    },
  },
]

Legacy Config (.eslintrc.js)

module.exports = {
  plugins: ['@api-extractor-tools'],
  extends: ['plugin:@api-extractor-tools/recommended-legacy'],
}

Or configure rules individually:

module.exports = {
  plugins: ['@api-extractor-tools'],
  rules: {
    '@api-extractor-tools/missing-release-tag': 'error',
    '@api-extractor-tools/override-keyword': 'error',
    '@api-extractor-tools/package-documentation': 'warn',
    '@api-extractor-tools/forgotten-export': 'warn',
    '@api-extractor-tools/incompatible-release-tags': 'warn',
    '@api-extractor-tools/extra-release-tag': 'error',
    '@api-extractor-tools/public-on-private-member': 'error',
    '@api-extractor-tools/public-on-non-exported': 'error',
    '@api-extractor-tools/valid-enum-type': 'warn',
  },
}

Rules

@api-extractor-tools/missing-release-tag

Requires exported symbols to have a release tag (@public, @beta, @alpha, or @internal).

This rule mirrors API Extractor's ae-missing-release-tag message. When an api-extractor.json is found, the rule severity is automatically determined from the configuration.

// ❌ Bad - missing release tag
export function myFunction() {}

// ✅ Good
/**
 * A public function.
 * @public
 */
export function myFunction() {}

Options

{
  "@api-extractor-tools/missing-release-tag": [
    "error",
    {
      "configPath": "./api-extractor.json"
    }
  ]
}
  • configPath (optional): Path to the api-extractor.json file. If not provided, the rule will search upward from the linted file.

@api-extractor-tools/override-keyword

Requires the TypeScript override keyword when the @override TSDoc tag is present.

// ❌ Bad - has @override tag but missing override keyword
class Child extends Parent {
  /**
   * @override
   */
  doSomething() {}
}

// ✅ Good
class Child extends Parent {
  /**
   * @override
   */
  override doSomething() {}
}

This rule provides an auto-fix to add the missing override keyword.

@api-extractor-tools/package-documentation

Requires package entry point files to have a @packageDocumentation comment.

Entry points are determined from package.json fields:

  • main
  • types / typings
  • exports
// ❌ Bad - entry point without @packageDocumentation
export function foo() {}

// ✅ Good
/**
 * This package provides utilities for working with APIs.
 *
 * @packageDocumentation
 */

export function foo() {}

@api-extractor-tools/forgotten-export

Requires that types and symbols referenced by exported APIs are also exported from the entry point.

This rule mirrors API Extractor's ae-forgotten-export message.

// ❌ Bad - MyInterface is used but not exported
interface MyInterface {
  name: string
}

export function myFunction(param: MyInterface): void {}

// ✅ Good - MyInterface is exported
export interface MyInterface {
  name: string
}

export function myFunction(param: MyInterface): void {}

Options:

  • severity (optional): Severity level for forgotten exports. Default: 'warning'
{
  "@api-extractor-tools/forgotten-export": ["warn", { "severity": "warning" }]
}

@api-extractor-tools/incompatible-release-tags

Requires that exported APIs do not reference symbols with less visible release tags.

This rule mirrors API Extractor's ae-incompatible-release-tags message. For example, a @public API should not reference an @internal type.

Release tag visibility hierarchy (from least to most visible):

  • @internal < @alpha < @beta < @public
// ❌ Bad - public API using internal type
/**
 * An internal interface.
 * @internal
 */
interface MyInterface {
  name: string
}

/**
 * A public function.
 * @public
 */
export function myFunction(param: MyInterface): void {}

// ✅ Good - public API using public type
/**
 * A public interface.
 * @public
 */
export interface MyInterface {
  name: string
}

/**
 * A public function.
 * @public
 */
export function myFunction(param: MyInterface): void {}

Options:

  • severity (optional): Severity level for incompatible release tags. Default: 'warning'
{
  "@api-extractor-tools/incompatible-release-tags": [
    "error",
    { "severity": "warning" }
  ]
}

@api-extractor-tools/extra-release-tag

Requires that symbols have at most one release tag.

This rule mirrors API Extractor's ae-extra-release-tag message. Each symbol should have exactly one release tag (@public, @beta, @alpha, or @internal).

// ❌ Bad - multiple release tags
/**
 * A function with multiple tags.
 * @public
 * @beta
 */
export function myFunction(): void {}

// ✅ Good - single release tag
/**
 * A public function.
 * @public
 */
export function myFunction(): void {}

Options:

  • severity (optional): Severity level for extra release tags. Default: 'error'
{
  "@api-extractor-tools/extra-release-tag": ["error", { "severity": "error" }]
}

@api-extractor-tools/public-on-private-member

Prevents the use of @public tag on private or protected class members.

Private and protected members cannot be public API since they are not accessible outside the class or to external consumers.

// ❌ Bad - @public on private member
export class MyClass {
  /**
   * A private property.
   * @public
   */
  private myProperty: string = ''
}

// ✅ Good - @internal on private member
export class MyClass {
  /**
   * A private property.
   * @internal
   */
  private myProperty: string = ''
}

// ✅ Good - @public on public member
export class MyClass {
  /**
   * A public property.
   * @public
   */
  public myProperty: string = ''
}

Options:

  • severity (optional): Severity level for public tags on private/protected members. Default: 'error'
{
  "@api-extractor-tools/public-on-private-member": [
    "error",
    { "severity": "error" }
  ]
}

@api-extractor-tools/public-on-non-exported

Prevents the use of @public tag on symbols that are not exported.

The @public tag indicates that a symbol is part of the public API, but non-exported symbols cannot be accessed by consumers.

// ❌ Bad - @public on non-exported symbol
/**
 * A function.
 * @public
 */
function myFunction(): void {}

// ✅ Good - @public on exported symbol
/**
 * A function.
 * @public
 */
export function myFunction(): void {}

// ✅ Good - @internal on non-exported symbol
/**
 * A function.
 * @internal
 */
function myFunction(): void {}

// ✅ Good - exported separately
/**
 * A function.
 * @public
 */
function myFunction(): void {}

export { myFunction }

Options:

  • severity (optional): Severity level for public tags on non-exported symbols. Default: 'error'
{
  "@api-extractor-tools/public-on-non-exported": [
    "error",
    { "severity": "error" }
  ]
}

@api-extractor-tools/valid-enum-type

Validates the usage of the @enumType TSDoc tag on enum declarations and string literal union type aliases.

The @enumType tag specifies whether an enum is "open" (new members may be added) or "closed" (the set of members is fixed). This is used by the change detector to properly classify API changes.

// ❌ Bad - missing value
/**
 * @enumType
 */
export enum Status {
  Active,
  Inactive,
}

// ❌ Bad - invalid value
/**
 * @enumType invalid
 */
export enum Status {
  Active,
  Inactive,
}

// ❌ Bad - @enumType on invalid construct
/**
 * @enumType open
 */
export function myFunction(): void {}

// ✅ Good - open enum
/**
 * Status values for a resource.
 * @enumType open
 * @public
 */
export enum Status {
  Active = 'active',
  Inactive = 'inactive',
}

// ✅ Good - closed string literal union
/**
 * Supported formats.
 * @enumType closed
 * @public
 */
export type Format = 'json' | 'xml'

Options:

  • requireOnExported (optional): When true, requires all exported enums and string literal unions to have an @enumType tag. Default: false
{
  "@api-extractor-tools/valid-enum-type": [
    "warn",
    { "requireOnExported": true }
  ]
}

Configuration Discovery

Rules that read from api-extractor.json use the following strategy:

  1. Explicit option: Use the configPath rule option
  2. Auto-discovery: Search upward from the linted file for api-extractor.json
  3. Fallback: Use sensible defaults (all rules enabled as warnings)

Recommended Configuration

The recommended configuration enables all rules with these defaults:

| Rule | Severity | | --------------------------- | -------- | | missing-release-tag | warn | | override-keyword | error | | package-documentation | warn | | forgotten-export | warn | | incompatible-release-tags | warn | | extra-release-tag | error | | public-on-private-member | error | | public-on-non-exported | error | | valid-enum-type | warn |

Requirements

  • ESLint >= 8.0.0
  • TypeScript >= 5.5.0

Related

License

MIT