@bitforgehq/eslint-config-angular
v2.0.0
Published
ESLint flat config presets for Angular 22 projects
Readme
@bitforgehq/eslint-config-angular
ESLint flat config presets for Angular 22 projects. ESLint 9 and 10 supported.
Installation
bun add -D eslint @bitforgehq/eslint-config-angularThat's it — angular-eslint, typescript-eslint, @eslint/js, and
eslint-config-prettier are bundled as dependencies of this package.
Requirements
- Angular 22 (TypeScript >=6.0 <6.1 comes with it)
- ESLint ^9 or ^10
- A valid
tsconfig.json(type-checked rules use the ESLint project service)
Usage
Create eslint.config.js in your project root:
// Web preset (default export is the same)
import config from '@bitforgehq/eslint-config-angular/web';
export default config;// Ionic preset — also allows ion-* component selectors
import config from '@bitforgehq/eslint-config-angular/ionic';
export default config;What's enabled
@eslint/jsrecommended,typescript-eslintrecommended + stylistic (type-checked),angular-eslintrecommended- Template + accessibility rules — running on standalone
.htmlfiles and inside inline templates (processInlineTemplates) - House rules as errors: signals-first (
prefer-signals,prefer-signal-model,prefer-output-emitter-ref,no-uncalled-signals),inject()+providedIn: 'root', OnPush, standalone components,@if/@forcontrol flow, noconsole.log(warn/error allowed), inline type imports,_-prefixed unused-var escape hatch eslint-config-prettierlast — formatting stays Prettier's job- Deliberately NOT enabled:
template/no-call-expression— it would flag every signal read in a template ({{ count() }},@if (loading())), the core idiom of the signals-first architecture
Migrating from v1
- Upgrade your app to Angular 22 first (
ng update). - Remove the old peer deps from your project — they're bundled now:
@angular-eslint/eslint-plugin,@angular-eslint/eslint-plugin-template,@angular-eslint/template-parser,@typescript-eslint/eslint-plugin,@typescript-eslint/parser. Keepeslint(v9 or v10) andtypescript. - Expect new violations: v1 never linted inline templates and set most
rules to
warn; v2 lints everything aterror. Runbun x eslint . --fixfirst — control-flow migration, self-closing tags, type imports, and more are auto-fixable. - Lint runs need a resolvable
tsconfig.json(Angular CLI projects have one already).
Customization
import baseConfig from '@bitforgehq/eslint-config-angular/web';
export default [
...baseConfig,
{
files: ['**/*.ts'],
rules: {
// project-specific overrides
},
},
];