Enhance ESLint with better support for large scale monorepos
—
Custom Config Package Names patch removes ESLint's strict requirement that shareable config package names must include 'eslint-config' as a prefix, enabling more flexible naming patterns for rig packages and integrated tooling solutions.
Applies runtime patches to ESLint's ConfigArrayFactory to bypass the 'eslint-config' naming requirement for shareable configurations.
/**
* Applies the custom config package names patch to ESLint
* Must be required before ESLint processes any configuration
*/
require("@rushstack/eslint-patch/custom-config-package-names");Usage Example:
// .eslintrc.js
require("@rushstack/eslint-patch/modern-module-resolution");
require("@rushstack/eslint-patch/custom-config-package-names");
module.exports = {
extends: [
'@your-company/build-rig/profile/default/includes/eslint/node' // No 'eslint-config' prefix required
],
parserOptions: { tsconfigRootDir: __dirname }
};The patch modifies ESLint's config resolution to handle non-standard package names:
// Internal patch implementation (not directly callable)
interface ConfigArrayFactory {
_loadExtendedShareableConfig(extendName: string): unknown;
}
interface Naming {
normalizePackageName(name: string, prefix: string): string;
}This patch specifically enables Rush Stack rig packages to provide ESLint configurations:
Rig Package Structure:
@your-company/build-rig/
├── package.json
├── profiles/
│ └── default/
│ └── includes/
│ └── eslint/
│ ├── node.js # ESLint config for Node.js projects
│ └── browser.js # ESLint config for browser projectsConsumer Usage:
module.exports = {
extends: [
'@your-company/build-rig/profile/default/includes/eslint/node'
]
};The patch enables these naming patterns:
@company/build-rig/profile/web (rig package with profile)@company/tooling-config (generic tooling package)company-tools/eslint (scoped tooling)my-company-standards (company standards package)Works across all supported ESLint versions:
Often used together with the modern module resolution patch:
// Recommended combination for rig packages
require("@rushstack/eslint-patch/modern-module-resolution");
require("@rushstack/eslint-patch/custom-config-package-names");
module.exports = {
extends: ['@company/build-rig/profile/web/eslint']
};The patch gracefully handles resolution failures:
Install with Tessl CLI
npx tessl i tessl/npm-rushstack--eslint-patch