Skip to content

Modern ESLint configuration with strict rules for Angular development

License

Notifications You must be signed in to change notification settings

Jbz797/eslint-config-angular-strict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

238 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Strict ESLint Logo

Angular Strict ESLint

Modern ESLint configuration with strict rules for Angular development

NPM Version GitHub license NPM Downloads


Overview

A production-ready, opinionated ESLint configuration that enforces best practices for Angular applications. Combines rules from industry-leading plugins into a single package with zero additional configuration required.

Features

🅰️ Angular: 30+ rules for standalone, lifecycle, components/directives standards, metadata, signals, pipes,...
📘 TypeScript: Member ordering, promise-async, type imports, strict typing, type safety, extraneous classes,...
Code Quality: Complexity max, file length control, import cycles detection, 100+ Unicorn best practices,...
🎨 Style: Airbnb extended, max line length, arrow parens, object/class newlines, sorted keys/imports,...
🔍 Templates: 30+ rules with alphabetical attrs, complexity max, control flow, trackBy, a11y, no-any,...

What's Included

No additional ESLint installation needed! Everything is bundled.

Installation

1. Install Package

npm install eslint-config-angular-strict --save-dev

or

yarn add eslint-config-angular-strict --dev

⚠️ Important: Remove any existing eslint dependency from your project - it's included!

2. Configure ESLint

Create an eslint.config.js file (ESLint 9 flat config format):

import angularStrict from 'eslint-config-angular-strict';

export default [
  ...angularStrict,
  // Your custom overrides here
];

3. Update package.json

Add the following to your package.json:

{
  "type": "module"
}

TypeScript Configuration

Make sure your tsconfig.json is properly configured:

{
  "compilerOptions": {
    (...),
    "allowUnusedLabels": false,
    "exactOptionalPropertyTypes": true,
    "noImplicitOverride": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "strict": true
  },
  "angularCompilerOptions": {
    "strictInjectionParameters": true,
    "strictStandalone": true,
    "strictTemplates": true
  }
}

Contributing

Contributions are welcome! Please open an issue or submit a PR.

License

MIT © Jean-benoit Gautier

About

Modern ESLint configuration with strict rules for Angular development

Topics

Resources

License

Stars

Watchers

Forks