eslint-config-angular-strict 2.2.39 → 2.2.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -23
- package/index.js +43 -37
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -18,6 +18,13 @@
|
|
|
18
18
|
|
|
19
19
|
This package includes **ESLint 9** and uses the new **flat configuration format** : [ESLint 9 Migration Guide](https://eslint.org/docs/latest/use/configure/migration-guide).
|
|
20
20
|
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **Angular**: Standalone components, lifecycle enforcement, component standards, and more...
|
|
24
|
+
- **TypeScript**: Strict typing, member ordering, modern patterns, and more...
|
|
25
|
+
- **Quality**: Modern JavaScript, anti-patterns prevention, performance optimization, and more...
|
|
26
|
+
- **Style**: Airbnb compliance, max length, import organization, and more...
|
|
27
|
+
|
|
21
28
|
## What's Included
|
|
22
29
|
|
|
23
30
|
#### ✨ **No additional ESLint installation needed!** Everything is bundled.
|
|
@@ -27,12 +34,13 @@ This package includes **ESLint 9** and uses the new **flat configuration format*
|
|
|
27
34
|
- <img src="https://eslint.org/icon-512.png" width="16" height="16"> [**ESLint 9**](https://github.com/eslint/eslint)
|
|
28
35
|
- <img src="https://avatars.githubusercontent.com/u/144717797?s=48&" width="16" height="16"> [**Stylistic**](https://github.com/eslint-stylistic/eslint-stylistic)
|
|
29
36
|
- <img src="https://avatars.githubusercontent.com/u/46634674?s=48&" width="16" height="16"> [**TypeScript ESLint**](https://github.com/typescript-eslint/typescript-eslint)
|
|
37
|
+
- 🦄 [**Unicorn**](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
|
30
38
|
|
|
31
39
|
## Requirements
|
|
32
40
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
41
|
+
- **Angular 18+**
|
|
42
|
+
- **Node.js 18+**
|
|
43
|
+
- **TypeScript 5+**
|
|
36
44
|
|
|
37
45
|
## Installation
|
|
38
46
|
|
|
@@ -93,26 +101,6 @@ Make sure your `tsconfig.json` is properly configured:
|
|
|
93
101
|
}
|
|
94
102
|
```
|
|
95
103
|
|
|
96
|
-
## Features
|
|
97
|
-
|
|
98
|
-
### <img src="https://avatars.githubusercontent.com/u/139426?s=48&" width="20" height="20"> Angular Rules
|
|
99
|
-
|
|
100
|
-
- 🏗️ **Best practices**: Standalone components, view encapsulation, and more...
|
|
101
|
-
- 🎯 **Component standards**: Class suffixes, kebab-case selectors, and more...
|
|
102
|
-
- 🔄 **Lifecycle enforcement**: Interface usage, method ordering, and more...
|
|
103
|
-
|
|
104
|
-
### <img src="https://avatars.githubusercontent.com/u/46634674?s=48&" width="20" height="20"> TypeScript Rules
|
|
105
|
-
|
|
106
|
-
- 📦 **Code organization**: Import/export management, type definitions, and more...
|
|
107
|
-
- ⚡ **Modern patterns**: Optional chaining, destructuring, async/await, and more...
|
|
108
|
-
- 🛡️ **Strict typing**: Member ordering, type safety, no explicit any, and more...
|
|
109
|
-
|
|
110
|
-
### 🎨 Style & Formatting
|
|
111
|
-
|
|
112
|
-
- 📋 **Airbnb compliance**: 531 strict rules from eslint-config-airbnb-extended, and more...
|
|
113
|
-
- 📏 **Code structure**: Max line length, proper spacing, and more...
|
|
114
|
-
- 🔤 **Import organization**: Alphabetical ordering with framework prioritization, and more...
|
|
115
|
-
|
|
116
104
|
## Contributing
|
|
117
105
|
|
|
118
106
|
Contributions are welcome! Please open an issue or submit a PR.
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import angular from '@angular-eslint/eslint-plugin';
|
|
2
2
|
import angularTemplate from '@angular-eslint/eslint-plugin-template';
|
|
3
3
|
import angularTemplateParser from '@angular-eslint/template-parser';
|
|
4
|
+
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
4
5
|
import importX from 'eslint-plugin-import-x';
|
|
5
6
|
import stylistic from '@stylistic/eslint-plugin';
|
|
6
7
|
import tsEslint from '@typescript-eslint/eslint-plugin';
|
|
@@ -8,7 +9,6 @@ import tsParser from '@typescript-eslint/parser';
|
|
|
8
9
|
import { configs, rules } from 'eslint-config-airbnb-extended';
|
|
9
10
|
|
|
10
11
|
export default [
|
|
11
|
-
// Global plugins configuration for all files
|
|
12
12
|
{
|
|
13
13
|
ignores: ['dist/**', 'node_modules/**'],
|
|
14
14
|
plugins: {
|
|
@@ -19,8 +19,8 @@ export default [
|
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
-
// Airbnb strict rules
|
|
23
22
|
...configs.base.all,
|
|
23
|
+
eslintPluginUnicorn.configs.all,
|
|
24
24
|
rules.base.importsStrict,
|
|
25
25
|
rules.typescript.typescriptEslintStrict,
|
|
26
26
|
{
|
|
@@ -62,32 +62,15 @@ export default [
|
|
|
62
62
|
'@angular-eslint/use-lifecycle-interface': 'error',
|
|
63
63
|
'@angular-eslint/use-pipe-transform-interface': 'error',
|
|
64
64
|
|
|
65
|
-
//
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
|
|
74
|
-
// Stylistic rules
|
|
75
|
-
'@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
|
|
76
|
-
'@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
77
|
-
'@stylistic/max-len': ['error', { code: 170, tabWidth: 2 }],
|
|
78
|
-
'@stylistic/object-curly-newline': [
|
|
79
|
-
'error',
|
|
80
|
-
{
|
|
81
|
-
ExportDeclaration: { consistent: true, minProperties: 10, multiline: true },
|
|
82
|
-
ImportDeclaration: { consistent: true, minProperties: 10, multiline: true },
|
|
83
|
-
ObjectExpression: { consistent: true, minProperties: 4, multiline: true },
|
|
84
|
-
ObjectPattern: { consistent: true, minProperties: 4, multiline: true },
|
|
85
|
-
TSEnumBody: { consistent: true, minProperties: 4, multiline: true },
|
|
86
|
-
TSInterfaceBody: { consistent: true, minProperties: 4, multiline: true },
|
|
87
|
-
TSTypeLiteral: { consistent: true, minProperties: 4, multiline: true },
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
'@stylistic/padded-blocks': ['error', { blocks: 'never', classes: 'always', switches: 'never' }],
|
|
65
|
+
// ESLint rules
|
|
66
|
+
'class-methods-use-this': 'off',
|
|
67
|
+
'max-lines': ['error', { max: 400, skipBlankLines: true, skipComments: true }],
|
|
68
|
+
'no-param-reassign': ['error', { props: false }],
|
|
69
|
+
'no-plusplus': 'off',
|
|
70
|
+
'no-return-assign': 'off',
|
|
71
|
+
'no-underscore-dangle': ['error', { allowAfterThis: true }],
|
|
72
|
+
'radix': ['error', 'as-needed'],
|
|
73
|
+
'sort-keys': ['error', 'asc', { allowLineSeparatedGroups: true, natural: true }],
|
|
91
74
|
|
|
92
75
|
// Import rules
|
|
93
76
|
'import-x/no-anonymous-default-export': 'error',
|
|
@@ -113,15 +96,38 @@ export default [
|
|
|
113
96
|
],
|
|
114
97
|
'import-x/prefer-default-export': 'off',
|
|
115
98
|
|
|
116
|
-
//
|
|
117
|
-
'
|
|
118
|
-
'
|
|
119
|
-
'
|
|
120
|
-
'
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
99
|
+
// Stylistic rules
|
|
100
|
+
'@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
|
|
101
|
+
'@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
102
|
+
'@stylistic/max-len': ['error', { code: 170, tabWidth: 2 }],
|
|
103
|
+
'@stylistic/object-curly-newline': [
|
|
104
|
+
'error',
|
|
105
|
+
{
|
|
106
|
+
ExportDeclaration: { consistent: true, minProperties: 10, multiline: true },
|
|
107
|
+
ImportDeclaration: { consistent: true, minProperties: 10, multiline: true },
|
|
108
|
+
ObjectExpression: { consistent: true, minProperties: 4, multiline: true },
|
|
109
|
+
ObjectPattern: { consistent: true, minProperties: 4, multiline: true },
|
|
110
|
+
TSEnumBody: { consistent: true, minProperties: 4, multiline: true },
|
|
111
|
+
TSInterfaceBody: { consistent: true, minProperties: 4, multiline: true },
|
|
112
|
+
TSTypeLiteral: { consistent: true, minProperties: 4, multiline: true },
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
'@stylistic/padded-blocks': ['error', { blocks: 'never', classes: 'always', switches: 'never' }],
|
|
116
|
+
|
|
117
|
+
// TypeScript ESLint rules
|
|
118
|
+
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'no-type-imports' }],
|
|
119
|
+
'@typescript-eslint/member-ordering': 'error',
|
|
120
|
+
'@typescript-eslint/no-extraneous-class': ['error', { allowEmpty: true, allowStaticOnly: true }],
|
|
121
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
122
|
+
'@typescript-eslint/promise-function-async': ['error', { checkArrowFunctions: false }],
|
|
123
|
+
'@typescript-eslint/sort-type-constituents': 'error',
|
|
124
|
+
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
|
|
125
|
+
|
|
126
|
+
// Unicorn rules
|
|
127
|
+
'unicorn/no-abusive-eslint-disable': 'off',
|
|
128
|
+
'unicorn/no-array-for-each': 'off',
|
|
129
|
+
'unicorn/no-useless-promise-resolve-reject': 'off',
|
|
130
|
+
'unicorn/switch-case-braces': 'off',
|
|
125
131
|
},
|
|
126
132
|
},
|
|
127
133
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-angular-strict",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.42",
|
|
4
4
|
"description": "Modern ESLint configuration with strict rules for Angular development.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"eslint-config-airbnb-extended": "2.3.1",
|
|
49
49
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
50
50
|
"eslint-plugin-import-x": "4.16.1",
|
|
51
|
+
"eslint-plugin-unicorn": "61.0.2",
|
|
51
52
|
"typescript-eslint": "8.45.0"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|