This capability handles adding ESLint to existing Angular workspaces and configuring workspace-level settings.
The primary entry point for adding angular-eslint to an existing workspace. This is automatically invoked when running ng add @angular-eslint/schematics.
/**
* Add angular-eslint to an existing workspace
* @param options - Configuration options for the installation
* @returns Schematic rule that performs the installation
*/
export default function (options: NgAddSchema): Rule;
interface NgAddSchema {
/** Skip installing dependencies after adding the schematic */
skipInstall?: boolean;
}Usage Examples:
# Add ESLint to workspace with automatic dependency installation
ng add @angular-eslint/schematics
# Add ESLint to workspace but skip dependency installation
ng add @angular-eslint/schematics --skipInstallThe ng-add schematic performs the following operations:
package.json with required dependenciesangular.jsonskipInstall is true)The ng-add process updates several workspace-level configuration files:
Adds the following devDependencies:
@angular-eslint/builder@angular-eslint/eslint-plugin@angular-eslint/eslint-plugin-template@angular-eslint/schematics@angular-eslint/template-parser@typescript-eslint/eslint-plugin@typescript-eslint/parsereslintUpdates the workspace configuration to:
@angular-eslint/schematics@angular-eslint/schematics:application@angular-eslint/schematics:libraryCreates a root ESLint configuration file (either legacy .eslintrc.json or modern eslint.config.js format) with:
interface NgAddSchema {
skipInstall?: boolean;
}
const FIXED_ESLINT_V8_VERSION = '8.57.1';
const FIXED_TYPESCRIPT_ESLINT_V7_VERSION = '7.11.0';