eslint-config-angular-strict 2.2.2 → 2.2.4
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/index.js +1 -2
- package/package.json +1 -1
- package/tests/sample.component.ts +12 -25
package/index.js
CHANGED
|
@@ -139,9 +139,8 @@ export default [
|
|
|
139
139
|
'no-restricted-globals': 'off',
|
|
140
140
|
'no-return-assign': 'off',
|
|
141
141
|
'no-underscore-dangle': 'off',
|
|
142
|
-
'prefer-destructuring': 'off',
|
|
143
142
|
'radix': ['error', 'as-needed'],
|
|
144
|
-
'sort-keys': ['error', 'asc', { allowLineSeparatedGroups: true }]
|
|
143
|
+
'sort-keys': ['error', 'asc', { allowLineSeparatedGroups: true, natural: true }]
|
|
145
144
|
},
|
|
146
145
|
},
|
|
147
146
|
|
package/package.json
CHANGED
|
@@ -1,34 +1,21 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
|
|
3
|
-
// Test component with intentional violations to validate ESLint rules
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
4
2
|
|
|
5
3
|
@Component({
|
|
6
4
|
selector: 'app-sample',
|
|
7
5
|
templateUrl: './sample.component.html',
|
|
8
|
-
styleUrls: ['./sample.component.css'] // Should trigger consistent-component-styles
|
|
9
6
|
})
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
|
|
8
|
+
export class SampleComponent {
|
|
9
|
+
@Input() config: any;
|
|
12
10
|
private _items!: string[]; // Non-null assertion
|
|
13
11
|
public name = 'sample';
|
|
14
12
|
|
|
15
|
-
constructor() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this._items = this.config?.items || [];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Method should be after getter based on member-ordering
|
|
26
|
-
processItems() {
|
|
27
|
-
return this._items.map(item => item.toUpperCase()); // Missing arrow function parens
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Getter should be before methods
|
|
31
|
-
get itemCount(): number {
|
|
32
|
-
return this._items?.length || 0;
|
|
13
|
+
constructor() {
|
|
14
|
+
const obj1 = {
|
|
15
|
+
a: 1,
|
|
16
|
+
C: 4,
|
|
17
|
+
b: 2,
|
|
18
|
+
c: 3,
|
|
19
|
+
};
|
|
33
20
|
}
|
|
34
|
-
}
|
|
21
|
+
}
|