@siemens/eslint-config-angular 1.1.2 → 2.0.0-next.2
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 +6 -2
- package/index.mjs +11 -22
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,6 +40,10 @@ will get changed in the patch releases._
|
|
|
40
40
|
|
|
41
41
|
### ESLint
|
|
42
42
|
|
|
43
|
+
Our ESLint configurations does not include any formatting rules.
|
|
44
|
+
Please use a formatter like [Prettier](https://prettier.io/)
|
|
45
|
+
or add a formatting ruleset for ESLint like [ESLint Stylistic](https://eslint.style/).
|
|
46
|
+
|
|
43
47
|
#### TypeScript
|
|
44
48
|
|
|
45
49
|
Include the ESLint preset in your root `eslint.config.mjs`:
|
|
@@ -87,7 +91,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
87
91
|
const __dirname = path.dirname(__filename);
|
|
88
92
|
|
|
89
93
|
export const tsConfig = typescriptEslint.config({
|
|
90
|
-
extends: [...angularTypescriptConfig
|
|
94
|
+
extends: [...angularTypescriptConfig],
|
|
91
95
|
files: ['**/*.ts'],
|
|
92
96
|
languageOptions: {
|
|
93
97
|
parserOptions: {
|
|
@@ -116,7 +120,7 @@ export const tsConfig = typescriptEslint.config({
|
|
|
116
120
|
});
|
|
117
121
|
|
|
118
122
|
export const templateConfig = typescriptEslint.config({
|
|
119
|
-
extends: [...angularTemplateConfig
|
|
123
|
+
extends: [...angularTemplateConfig],
|
|
120
124
|
files: ['**/*.html']
|
|
121
125
|
});
|
|
122
126
|
|
package/index.mjs
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import eslintJs from '@eslint/js';
|
|
6
6
|
import typescriptEslint from 'typescript-eslint';
|
|
7
7
|
import angularEslint from 'angular-eslint';
|
|
8
|
-
import importPlugin from 'eslint-plugin-import';
|
|
9
8
|
import jsdocPlugin from 'eslint-plugin-jsdoc';
|
|
9
|
+
import perfectionist from 'eslint-plugin-perfectionist';
|
|
10
10
|
import preferArrowPlugin from 'eslint-plugin-prefer-arrow';
|
|
11
11
|
|
|
12
12
|
// Keep in sync with eslint-config-typescript (except Angular stuff).
|
|
@@ -18,9 +18,9 @@ export const configBase = typescriptEslint.config({
|
|
|
18
18
|
...angularEslint.configs.tsRecommended
|
|
19
19
|
],
|
|
20
20
|
plugins: {
|
|
21
|
-
'import': importPlugin,
|
|
22
21
|
'jsdoc': jsdocPlugin,
|
|
23
|
-
'prefer-arrow': preferArrowPlugin
|
|
22
|
+
'prefer-arrow': preferArrowPlugin,
|
|
23
|
+
perfectionist
|
|
24
24
|
},
|
|
25
25
|
languageOptions: {
|
|
26
26
|
parserOptions: {
|
|
@@ -49,12 +49,6 @@ export const configBase = typescriptEslint.config({
|
|
|
49
49
|
'space-before-blocks': ['off'],
|
|
50
50
|
|
|
51
51
|
'@typescript-eslint/array-type': ['error'],
|
|
52
|
-
'@typescript-eslint/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
53
|
-
'@typescript-eslint/comma-dangle': ['error'],
|
|
54
|
-
'@typescript-eslint/comma-spacing': ['error'],
|
|
55
|
-
'@typescript-eslint/func-call-spacing': ['error'],
|
|
56
|
-
'@typescript-eslint/indent': ['error', 2, { SwitchCase: 1 }],
|
|
57
|
-
'@typescript-eslint/keyword-spacing': ['error'],
|
|
58
52
|
'@typescript-eslint/member-ordering': ['off'],
|
|
59
53
|
'@typescript-eslint/naming-convention': ['off'],
|
|
60
54
|
'@typescript-eslint/no-non-null-asserted-optional-chain': ['error'],
|
|
@@ -66,10 +60,6 @@ export const configBase = typescriptEslint.config({
|
|
|
66
60
|
{ vars: 'all', args: 'none', ignoreRestSiblings: false }
|
|
67
61
|
],
|
|
68
62
|
'@typescript-eslint/no-var-requires': ['error'],
|
|
69
|
-
'@typescript-eslint/space-infix-ops': ['error'],
|
|
70
|
-
'@typescript-eslint/space-before-blocks': ['error'],
|
|
71
|
-
'@typescript-eslint/type-annotation-spacing': ['error'],
|
|
72
|
-
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
|
|
73
63
|
'@typescript-eslint/no-explicit-any': ['off'],
|
|
74
64
|
'@typescript-eslint/no-empty-function': ['off'],
|
|
75
65
|
'@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],
|
|
@@ -93,7 +83,6 @@ export const configBase = typescriptEslint.config({
|
|
|
93
83
|
'no-multi-spaces': ['error'],
|
|
94
84
|
'no-multiple-empty-lines': ['error'],
|
|
95
85
|
'prefer-arrow/prefer-arrow-functions': ['off'],
|
|
96
|
-
'quote-props': ['error', 'consistent'],
|
|
97
86
|
'semi-spacing': ['error'],
|
|
98
87
|
'space-in-parens': ['error'],
|
|
99
88
|
'space-unary-ops': ['error'],
|
|
@@ -109,17 +98,18 @@ export const configRecommended = typescriptEslint.config({
|
|
|
109
98
|
'no-implied-eval': ['off'],
|
|
110
99
|
'no-loop-func': ['off'],
|
|
111
100
|
'no-useless-constructor': ['off'],
|
|
112
|
-
'
|
|
101
|
+
'perfectionist/sort-imports': [
|
|
113
102
|
'error',
|
|
114
103
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
104
|
+
type: 'alphabetical',
|
|
105
|
+
order: 'asc',
|
|
106
|
+
newlinesBetween: 'always',
|
|
107
|
+
groups: [
|
|
108
|
+
['builtin', 'external'],
|
|
109
|
+
['parent', 'sibling', 'index']
|
|
110
|
+
]
|
|
120
111
|
}
|
|
121
112
|
],
|
|
122
|
-
|
|
123
113
|
'@angular-eslint/component-max-inline-declarations': ['off'],
|
|
124
114
|
'@angular-eslint/prefer-on-push-component-change-detection': ['off'],
|
|
125
115
|
'@angular-eslint/use-component-selector': ['off'],
|
|
@@ -171,7 +161,6 @@ export const configRecommended = typescriptEslint.config({
|
|
|
171
161
|
}
|
|
172
162
|
],
|
|
173
163
|
|
|
174
|
-
'@typescript-eslint/no-extra-semi': ['error'],
|
|
175
164
|
'@typescript-eslint/no-for-in-array': ['error'],
|
|
176
165
|
'@typescript-eslint/no-implied-eval': ['error'],
|
|
177
166
|
'@typescript-eslint/no-loop-func': ['error'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siemens/eslint-config-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.2",
|
|
4
4
|
"description": "Configuration for linting Angular TypeScript and templates using Angular ESLint.",
|
|
5
5
|
"files": [
|
|
6
6
|
"*.mjs",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@eslint/js": "^9.9.1",
|
|
35
35
|
"angular-eslint": "^18.1.0 || ^19.0.0",
|
|
36
36
|
"eslint": "^9.9.1",
|
|
37
|
-
"eslint-plugin-import": "^2.26.0",
|
|
38
37
|
"eslint-plugin-jsdoc": "^50.2.2",
|
|
38
|
+
"eslint-plugin-perfectionist": "^4.6.0",
|
|
39
39
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
40
40
|
"typescript-eslint": "^8.0.0"
|
|
41
41
|
}
|