Enhance ESLint with better support for large scale monorepos
npx @tessl/cli install tessl/npm-rushstack--eslint-patch@1.12.0@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.
npm install --save-dev @rushstack/eslint-patchThe 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");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.
@rushstack/eslint-patch is built around several key components:
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");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");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");If patches cannot be applied due to unsupported ESLint versions or missing dependencies, the package will throw descriptive errors: