or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

bulk-suppressions.mdcustom-config-package-names.mdindex.mdmodern-module-resolution.md
tile.json

tessl/npm-rushstack--eslint-patch

Enhance ESLint with better support for large scale monorepos

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@rushstack/eslint-patch@1.12.x

To install, run

npx @tessl/cli install tessl/npm-rushstack--eslint-patch@1.12.0

index.mddocs/

@rushstack/eslint-patch

@rushstack/eslint-patch enhances ESLint with better support for large scale monorepos through runtime patches that enable enhanced functionality. It operates as "monkey patches" that modify the ESLint engine in memory, maintaining full compatibility with existing ESLint versions and editor extensions.

Package Information

  • Package Name: @rushstack/eslint-patch
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install --save-dev @rushstack/eslint-patch

Core Imports

The package does not have a default entry point and must be imported using specific feature paths. Attempting to import the main entry point will throw an error with usage instructions:

// For modern module resolution patch
require("@rushstack/eslint-patch/modern-module-resolution");

// For custom config package names patch  
require("@rushstack/eslint-patch/custom-config-package-names");

// For bulk suppressions patch
require("@rushstack/eslint-patch/eslint-bulk-suppressions");

Basic Usage

Add patches to the top of your .eslintrc.js file:

// Load patches (order matters for some combinations)
require("@rushstack/eslint-patch/modern-module-resolution");
require("@rushstack/eslint-patch/custom-config-package-names");
require("@rushstack/eslint-patch/eslint-bulk-suppressions");

module.exports = {
  extends: ['@your-company/eslint-config'],
  parserOptions: { tsconfigRootDir: __dirname }
};

The patches automatically detect and support ESLint versions 6.x, 7.x, 8.x, and 9.x.

Architecture

@rushstack/eslint-patch is built around several key components:

  • Runtime Patching System: Core infrastructure that detects ESLint version and applies appropriate patches
  • Module Resolution Override: Patches ESLint's plugin and config loading to support monorepo scenarios
  • Suppression Management: File-based bulk suppression system for managing legacy lint violations
  • Version Compatibility: Automatic detection and handling of different ESLint major versions

Capabilities

Modern Module Resolution

Allows ESLint config packages to provide their own plugin dependencies, eliminating the need to copy+paste devDependencies across projects in a monorepo.

// Entry point that applies the patch
require("@rushstack/eslint-patch/modern-module-resolution");

Modern Module Resolution

Custom Config Package Names

Removes ESLint's requirement for 'eslint-config' to appear in shareable config package names, enabling rig packages to provide ESLint configurations.

// Entry point that applies the patch  
require("@rushstack/eslint-patch/custom-config-package-names");

Custom Config Package Names

Bulk Suppressions

Enables machine-generated lint suppressions to be stored in a separate .eslint-bulk-suppressions.json file rather than cluttering source code with thousands of // eslint-ignore-next-line directives.

// Entry point that applies the patch
require("@rushstack/eslint-patch/eslint-bulk-suppressions");

Bulk Suppressions

Error Handling

If patches cannot be applied due to unsupported ESLint versions or missing dependencies, the package will throw descriptive errors:

  • Unsupported ESLint version: Versions outside 6.x-9.x range
  • Missing ESLint installation: Cannot locate ESLint modules to patch
  • Module resolution failures: Cannot find required ESLint internal modules
  • Default entry point access: The main entry point throws an error by design to prevent accidental usage without specific feature imports

Supported ESLint Versions

  • ESLint 6.x
  • ESLint 7.x
  • ESLint 8.x
  • ESLint 9.x (including flat config support)