Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbz797/eslint-config-angular-strict
Stricts rules to enforce a consistent code style for Angular development
https://github.com/jbz797/eslint-config-angular-strict
angular eslint eslint-plugin linting-rules stricts-rules typescript
Last synced: 11 days ago
JSON representation
Stricts rules to enforce a consistent code style for Angular development
- Host: GitHub
- URL: https://github.com/jbz797/eslint-config-angular-strict
- Owner: Jbz797
- License: mit
- Created: 2022-05-30T14:31:48.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T16:05:29.000Z (4 months ago)
- Last Synced: 2024-10-09T01:37:47.304Z (29 days ago)
- Topics: angular, eslint, eslint-plugin, linting-rules, stricts-rules, typescript
- Language: JavaScript
- Homepage:
- Size: 96.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Angular Strict ESLint
Stricts rules to enforce a consistent code style for Angular development
## Installation
ℹ️ `eslint` dependencies are included, so you can remove all `eslint` related dependencies from your project.
```sh
npm install eslint-config-angular-strict --save-dev
```or
```sh
yarn add eslint-config-angular-strict --dev
```## Configure ESLint
Within your **ESLint** config file:
```javascript
{
"root": true,
"overrides": [
{
"extends": ["angular-strict/typescript"],
"files": ["*.ts"],
"parserOptions": {
"project": ["./tsconfig.json"] // Specify your tsconfig relative path
}
},
{
"extends": ["angular-strict/template"],
"files": ["*.html"]
}
]
}
```## Configuring Eslint for Typescript only projects
Within your **ESLint** config file:
```javascript
{
"root": true,
"overrides": [
{
"extends": ["angular-strict/typescript"],
"files": ["*.ts"],
"parserOptions": {
"project": ["./tsconfig.json"] // Specify your tsconfig relative path
}
}
]
}
```## Tsconfig
For better consistency, please add this options to your `tsconfig.json`:
```javascript
{
"compilerOptions": {
(...),
"forceConsistentCasingInFileNames": true, // Ensure that casing is correct in imports
"noImplicitAny": true, // Enable error reporting for expressions and declarations with an implied any type
"noImplicitOverride": true, // Ensure overriding members in derived classes are marked with an override modifier
"strict": true // Enable all strict type checking options
},
"angularCompilerOptions": {
"strictInjectionParameters": true, // Reports an error for a supplied parameter whose injection type cannot be determined
"strictInputAccessModifiers": true, // Whether access modifiers such as private/protected/readonly are honored when assigning a binding expression to an @Input()
"strictTemplates": true // Enables strict template type checking
}
}
```## Extends
- [@angular-eslint](https://github.com/angular-eslint/angular-eslint)
- [@typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
- [airbnb-typescript](https://github.com/iamturns/eslint-config-airbnb-typescript)
- [airbnb](https://github.com/airbnb/javascript)