Skip to main content
These APIs are not officially supported by ESLint. They may change or be removed at any time without notice. Use them at your own risk.

Overview

The eslint/use-at-your-own-risk module exports internal APIs that are not part of the official ESLint API. These exports are provided for advanced use cases and tooling integration, but come with no stability guarantees.

Import Path

const { builtinRules, shouldUseFlatConfig } = require("eslint/use-at-your-own-risk");

Exports

builtinRules

A Map containing all built-in ESLint rules.
builtinRules
Map<string, Rule>
A Map where keys are rule names and values are rule implementations
Example:
const { builtinRules } = require("eslint/use-at-your-own-risk");

// Get a specific rule
const semiRule = builtinRules.get("semi");

// List all rule names
const ruleNames = Array.from(builtinRules.keys());
console.log(ruleNames); // ["semi", "quotes", "no-unused-vars", ...]

// Check if a rule exists
if (builtinRules.has("no-console")) {
  console.log("Rule exists");
}

// Iterate over all rules
for (const [ruleName, ruleModule] of builtinRules) {
  console.log(ruleName, ruleModule.meta);
}
Use cases:
  • Building custom linting tools
  • Introspecting rule metadata
  • Creating rule documentation generators
  • Testing rule implementations

shouldUseFlatConfig

A function that determines whether the flat config system should be used.
shouldUseFlatConfig
function
Returns a boolean indicating if flat config should be used
Signature:
function shouldUseFlatConfig(): boolean
Returns:
result
boolean
true if flat config should be used, false otherwise
Example:
const { shouldUseFlatConfig } = require("eslint/use-at-your-own-risk");

if (shouldUseFlatConfig()) {
  console.log("Using flat config (eslint.config.js)");
} else {
  console.log("Using legacy config (.eslintrc.*)");
}
As of ESLint v9+, flat config is the default configuration system. This function is primarily useful for tools that need to support both configuration formats.

Why “Use at Your Own Risk”?

These APIs are marked as unsupported because:
  1. No Stability Guarantee - They may change in minor or patch releases
  2. No Deprecation Policy - They can be removed without prior notice
  3. Implementation Details - They expose internal implementation that may be refactored
  4. No Documentation Maintenance - Official docs may become outdated

When to Use

Consider using these APIs only if:
  • You’re building development tools or plugins
  • You need access to internal ESLint functionality
  • You’re willing to update your code when ESLint changes
  • The official API doesn’t provide what you need

Alternatives

Before using these unsupported APIs, consider:
  • For rule access: Use the official ESLint class and configuration system
  • For config detection: Use the ESLint class which handles config automatically
  • For custom tooling: Check if the official API can be extended

ESLint Class

Official ESLint API

Linter Class

Core linting engine

Custom Rules

Create custom rules

Plugins

Build plugins

Build docs developers (and LLMs) love