eslint-config-angular-strict 2.3.56 → 2.3.57
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 +5 -4
- package/index.js +40 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,10 +20,10 @@ A production-ready, opinionated ESLint configuration that enforces best practice
|
|
|
20
20
|
|
|
21
21
|
## Features
|
|
22
22
|
|
|
23
|
-
🅰️ **Angular**:
|
|
24
|
-
📘 **TypeScript**:
|
|
23
|
+
🅰️ **Angular**: 40+ rules for standalone, lifecycle, components/directives standards, metadata, signals, pipes,...<br>
|
|
24
|
+
📘 **TypeScript**: Promise-async, type imports, strict typing, type safety, extraneous classes,...<br>
|
|
25
25
|
✨ **Code Quality**: Complexity max, file length control, import cycles detection, 100+ Unicorn best practices,...<br>
|
|
26
|
-
🎨 **Style**: Airbnb extended, max line length, object/class newlines, sorted
|
|
26
|
+
🎨 **Style**: Airbnb extended, max line length, object/class newlines, sorted classes/imports/objects/types,...<br>
|
|
27
27
|
🔍 **Templates**: 30+ rules with alphabetical attrs, complexity max, control flow, trackBy, a11y, no-any,...
|
|
28
28
|
|
|
29
29
|
## What's Included
|
|
@@ -34,7 +34,8 @@ A production-ready, opinionated ESLint configuration that enforces best practice
|
|
|
34
34
|
- <img src="https://avatars.githubusercontent.com/u/53234240?s=48&" width="16" height="16"> [**Angular ESLint**](https://github.com/angular-eslint/angular-eslint) - Angular-specific rules
|
|
35
35
|
- <img src="https://eslint.org/icon-512.png" width="16" height="16"> [**ESLint**](https://github.com/eslint/eslint) - Core linting engine
|
|
36
36
|
- 📦 [**Import-X**](https://github.com/un-ts/eslint-plugin-import-x) - Import/export validation
|
|
37
|
-
- 🔤 [**NgModule Sort**](https://github.com/ducktordanny/eslint-plugin-ng-module-sort) -
|
|
37
|
+
- 🔤 [**NgModule Sort**](https://github.com/ducktordanny/eslint-plugin-ng-module-sort) - Angular sorting
|
|
38
|
+
- <img src="https://raw.githubusercontent.com/azat-io/eslint-plugin-perfectionist/main/docs/public/logo.svg" width="16" height="16"> [**Perfectionist**](https://github.com/azat-io/eslint-plugin-perfectionist) - Take Your Code to a Beauty Salon
|
|
38
39
|
- <img src="https://avatars.githubusercontent.com/u/144717797?s=48&" width="16" height="16"> [**Stylistic**](https://github.com/eslint-stylistic/eslint-stylistic) - Code formatting rules
|
|
39
40
|
- <img src="https://avatars.githubusercontent.com/u/46634674?s=48&" width="16" height="16"> [**TypeScript ESLint**](https://github.com/typescript-eslint/typescript-eslint) - TypeScript linting
|
|
40
41
|
- 🦄 [**Unicorn**](https://github.com/sindresorhus/eslint-plugin-unicorn) - More than 100 powerful ESLint rules
|
package/index.js
CHANGED
|
@@ -68,7 +68,6 @@ export default [
|
|
|
68
68
|
// Stylistic rules
|
|
69
69
|
'@stylistic/array-element-newline': ['error', { consistent: true, multiline: true }],
|
|
70
70
|
'@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
|
|
71
|
-
'@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
72
71
|
'@stylistic/max-len': ['error', { code: 165, tabWidth: 2 }],
|
|
73
72
|
'@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 5 }],
|
|
74
73
|
'@stylistic/no-confusing-arrow': 'off',
|
|
@@ -94,8 +93,14 @@ export default [
|
|
|
94
93
|
{
|
|
95
94
|
accessibility: 'explicit',
|
|
96
95
|
ignoredMethodNames: [
|
|
97
|
-
'ngAfterContentChecked',
|
|
98
|
-
'
|
|
96
|
+
'ngAfterContentChecked',
|
|
97
|
+
'ngAfterContentInit',
|
|
98
|
+
'ngAfterViewChecked',
|
|
99
|
+
'ngAfterViewInit',
|
|
100
|
+
'ngDoCheck',
|
|
101
|
+
'ngOnChanges',
|
|
102
|
+
'ngOnDestroy',
|
|
103
|
+
'ngOnInit',
|
|
99
104
|
],
|
|
100
105
|
overrides: { accessors: 'explicit', constructors: 'no-public', methods: 'explicit', properties: 'explicit', parameterProperties: 'explicit' },
|
|
101
106
|
},
|
|
@@ -131,24 +136,45 @@ export default [
|
|
|
131
136
|
'error',
|
|
132
137
|
{
|
|
133
138
|
customGroups: [
|
|
134
|
-
{ groupName: 'decorated-public', modifiers: ['decorated', 'public']
|
|
135
|
-
{ groupName: 'decorated-private', modifiers: ['decorated', 'private']
|
|
136
|
-
{
|
|
139
|
+
{ groupName: 'decorated-public', modifiers: ['decorated', 'public'] },
|
|
140
|
+
{ groupName: 'decorated-private', modifiers: ['decorated', 'private'] },
|
|
141
|
+
{
|
|
142
|
+
elementNamePattern: '^ng(OnChanges|OnInit|DoCheck|AfterContentInit|AfterContentChecked|AfterViewInit|AfterViewChecked|OnDestroy)$',
|
|
143
|
+
groupName: 'lifecycle',
|
|
144
|
+
},
|
|
145
|
+
{ anyOf: [{ selector: 'get-method' }, { selector: 'set-method' }], groupName: 'public-accessors' },
|
|
146
|
+
{ anyOf: [{ selector: 'method' }, { selector: 'function-property' }], groupName: 'public-methods' },
|
|
147
|
+
{
|
|
148
|
+
anyOf: [
|
|
149
|
+
{ modifiers: ['private'], selector: 'get-method' },
|
|
150
|
+
{ modifiers: ['private'], selector: 'set-method' },
|
|
151
|
+
],
|
|
152
|
+
groupName: 'private-accessors',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
anyOf: [
|
|
156
|
+
{ modifiers: ['private'], selector: 'method' },
|
|
157
|
+
{ modifiers: ['private'], selector: 'function-property' },
|
|
158
|
+
],
|
|
159
|
+
groupName: 'private-methods',
|
|
160
|
+
},
|
|
137
161
|
],
|
|
138
162
|
groups: [
|
|
139
163
|
'decorated-public',
|
|
140
164
|
'decorated-private',
|
|
141
|
-
['property', 'accessor-property'],
|
|
142
|
-
['private-property', 'private-accessor-property'],
|
|
165
|
+
['property', 'accessor-property', 'static-property', 'static-accessor-property'],
|
|
166
|
+
['private-property', 'private-accessor-property', 'private-static-property', 'private-static-accessor-property'],
|
|
143
167
|
'constructor',
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
168
|
+
'static-block',
|
|
169
|
+
{ group: 'lifecycle', newlinesInside: 1, type: 'unsorted' },
|
|
170
|
+
{ group: 'public-accessors', newlinesInside: 1 },
|
|
171
|
+
{ group: 'public-methods', newlinesInside: 1 },
|
|
172
|
+
{ group: 'private-accessors', newlinesInside: 1 },
|
|
173
|
+
{ group: 'private-methods', newlinesInside: 1 },
|
|
148
174
|
'unknown',
|
|
149
175
|
],
|
|
150
176
|
newlinesBetween: 1,
|
|
151
|
-
newlinesInside:
|
|
177
|
+
newlinesInside: 0,
|
|
152
178
|
},
|
|
153
179
|
],
|
|
154
180
|
'perfectionist/sort-imports': [
|
|
@@ -218,7 +244,7 @@ export default [
|
|
|
218
244
|
'@angular-eslint/template/i18n': 'off',
|
|
219
245
|
'@angular-eslint/template/interactive-supports-focus': 'off',
|
|
220
246
|
'@angular-eslint/template/label-has-associated-control': 'off',
|
|
221
|
-
'@angular-eslint/template/no-call-expression':'off',
|
|
247
|
+
'@angular-eslint/template/no-call-expression': 'off',
|
|
222
248
|
'@angular-eslint/template/no-inline-styles': 'off',
|
|
223
249
|
'@angular-eslint/template/prefer-ngsrc': 'off',
|
|
224
250
|
|