A TypeScript ESLint ruleset designed for large teams and projects
npx @tessl/cli install tessl/npm-rushstack--eslint-config@4.4.0@rushstack/eslint-config is a TypeScript ESLint ruleset designed for large teams and projects. It provides battle-tested configurations optimized for scalability, readability, and maintainability in enterprise development environments. The package offers three distinct profiles along with multiple mixins for additional functionality, designed to work seamlessly with Prettier and modern development workflows.
npm install --save-dev @rushstack/eslint-config eslint typescriptFor legacy ESLint configurations:
// Required at the top of .eslintrc.js
require('@rushstack/eslint-config/patch/modern-module-resolution');
module.exports = {
extends: ["@rushstack/eslint-config/profile/node"],
parserOptions: { tsconfigRootDir: __dirname }
};For flat ESLint configurations (ESLint 9+):
import nodeProfile from "@rushstack/eslint-config/flat/profile/node";
export default [
...nodeProfile
];Simple Node.js project:
// .eslintrc.js
require('@rushstack/eslint-config/patch/modern-module-resolution');
module.exports = {
extends: ["@rushstack/eslint-config/profile/node"],
parserOptions: { tsconfigRootDir: __dirname }
};Web application with React:
// .eslintrc.js
require('@rushstack/eslint-config/patch/modern-module-resolution');
module.exports = {
extends: [
"@rushstack/eslint-config/profile/web-app",
"@rushstack/eslint-config/mixins/react"
],
parserOptions: { tsconfigRootDir: __dirname },
settings: {
react: {
version: "18.0"
}
}
};Flat configuration for Node.js:
// eslint.config.js
import nodeProfile from "@rushstack/eslint-config/flat/profile/node";
import tsdocMixin from "@rushstack/eslint-config/flat/mixins/tsdoc";
export default [
...nodeProfile,
...tsdocMixin
];@rushstack/eslint-config is designed around several key principles:
Core ESLint configuration profiles that form the foundation of the ruleset. Each profile is optimized for specific runtime environments and security requirements.
// Legacy format exports
const profileConfig: {
extends?: string[];
rules: Record<string, any>;
plugins?: string[];
env?: Record<string, boolean>;
parser?: string;
parserOptions?: Record<string, any>;
overrides?: Array<{
files: string[];
rules: Record<string, any>;
}>;
};
// Flat format exports
const flatConfig: Array<{
files?: string[];
rules: Record<string, any>;
plugins?: Record<string, any>;
languageOptions?: {
parser?: any;
parserOptions?: Record<string, any>;
};
}>;Optional configuration extensions that add specialized functionality to base profiles. Mixins must be loaded after profiles in the extends array.
// Legacy mixin structure
const mixinConfig: {
plugins?: string[];
settings?: Record<string, any>;
overrides: Array<{
files: string[];
rules: Record<string, any>;
}>;
};
// Flat mixin structure
const flatMixinConfig: Array<{
files?: string[];
plugins?: Record<string, any>;
rules: Record<string, any>;
settings?: Record<string, any>;
}>;Essential utilities for ESLint configuration resolution and extended functionality. The modern-module-resolution patch is required for proper operation.
// Patch modules (require-only, no exports)
require('@rushstack/eslint-config/patch/modern-module-resolution');
require('@rushstack/eslint-config/patch/eslint-bulk-suppressions');
require('@rushstack/eslint-config/patch/custom-config-package-names');Legacy entry points that throw errors and redirect users to updated paths for better organization and clarity.
// Deprecated entry points (throw errors with migration instructions)
require('@rushstack/eslint-config'); // Error: Use profile paths instead
require('@rushstack/eslint-config/react'); // Error: Use mixins/react instead
require('@rushstack/eslint-config/patch-eslint6'); // Error: Use patch/modern-module-resolution insteadDeprecated Paths:
@rushstack/eslint-config → Use @rushstack/eslint-config/profile/[node|web-app|node-trusted-tool]@rushstack/eslint-config/react → Use @rushstack/eslint-config/mixins/react@rushstack/eslint-config/patch-eslint6 → Use @rushstack/eslint-config/patch/modern-module-resolutioninterface ESLintConfig {
extends?: string[];
rules: Record<string, RuleConfig>;
plugins?: string[];
env?: Record<string, boolean>;
parser?: string;
parserOptions?: {
tsconfigRootDir?: string;
project?: string | string[];
ecmaVersion?: number;
sourceType?: 'module' | 'script';
};
overrides?: Array<{
files: string[];
rules: Record<string, RuleConfig>;
}>;
settings?: Record<string, any>;
}
interface FlatESLintConfig {
files?: string[];
ignores?: string[];
rules: Record<string, RuleConfig>;
plugins?: Record<string, any>;
languageOptions?: {
parser?: any;
parserOptions?: Record<string, any>;
globals?: Record<string, boolean>;
};
settings?: Record<string, any>;
}
type RuleConfig =
| 'off' | 'warn' | 'error'
| 0 | 1 | 2
| ['off' | 'warn' | 'error' | 0 | 1 | 2, ...any[]];
interface ReactSettings {
react: {
version: string;
};
}