@siemens/eslint-config-angular 2.0.0 → 2.1.1
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 +8 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,8 +75,7 @@ export default typescriptEslint.config({
|
|
|
75
75
|
|
|
76
76
|
#### Angular
|
|
77
77
|
|
|
78
|
-
Include the ESLint preset in your root `eslint.config.
|
|
79
|
-
sure `"type": "module"` is set in your root `package.json`:
|
|
78
|
+
Include the ESLint preset in your root `eslint.config.mjs`:
|
|
80
79
|
|
|
81
80
|
```js
|
|
82
81
|
import path from 'path';
|
|
@@ -84,13 +83,12 @@ import { fileURLToPath } from 'url';
|
|
|
84
83
|
import typescriptEslint from 'typescript-eslint';
|
|
85
84
|
import angularTypescriptConfig from '@siemens/eslint-config-angular';
|
|
86
85
|
import angularTemplateConfig from '@siemens/eslint-config-angular/template';
|
|
87
|
-
import prettier from 'eslint-config-prettier';
|
|
88
86
|
|
|
89
87
|
// mimic CommonJS variables
|
|
90
88
|
const __filename = fileURLToPath(import.meta.url);
|
|
91
89
|
const __dirname = path.dirname(__filename);
|
|
92
90
|
|
|
93
|
-
|
|
91
|
+
const tsConfig = typescriptEslint.config({
|
|
94
92
|
extends: [...angularTypescriptConfig],
|
|
95
93
|
files: ['**/*.ts'],
|
|
96
94
|
languageOptions: {
|
|
@@ -119,7 +117,7 @@ export const tsConfig = typescriptEslint.config({
|
|
|
119
117
|
}
|
|
120
118
|
});
|
|
121
119
|
|
|
122
|
-
|
|
120
|
+
const templateConfig = typescriptEslint.config({
|
|
123
121
|
extends: [...angularTemplateConfig],
|
|
124
122
|
files: ['**/*.html']
|
|
125
123
|
});
|
|
@@ -128,13 +126,11 @@ export default typescriptEslint.config(...tsConfig, ...templateConfig);
|
|
|
128
126
|
```
|
|
129
127
|
|
|
130
128
|
For libraries and other things in the `projects` directory,
|
|
131
|
-
|
|
132
|
-
and create an additional
|
|
133
|
-
`eslint.config.js` for each project that looks like this:
|
|
129
|
+
create an additional `eslint.config.mjs` for each project that looks like this:
|
|
134
130
|
|
|
135
131
|
```js
|
|
136
132
|
import typescriptEslint from 'typescript-eslint';
|
|
137
|
-
import { tsConfig, templateConfig } from '../../eslint.config.
|
|
133
|
+
import { tsConfig, templateConfig } from '../../eslint.config.mjs';
|
|
138
134
|
|
|
139
135
|
export default typescriptEslint.config(
|
|
140
136
|
{
|
|
@@ -168,7 +164,7 @@ export default typescriptEslint.config(
|
|
|
168
164
|
);
|
|
169
165
|
```
|
|
170
166
|
|
|
171
|
-
The `@angular-eslint/builder` will
|
|
167
|
+
The `@angular-eslint/builder` will not automatically pick up the library
|
|
172
168
|
config location, manually provide it in `angular.json`:
|
|
173
169
|
|
|
174
170
|
```diff
|
|
@@ -182,7 +178,7 @@ config location, manually provide it in `angular.json`:
|
|
|
182
178
|
"src/**/*.ts",
|
|
183
179
|
"src/**/*.html"
|
|
184
180
|
],
|
|
185
|
-
+ "eslintConfig": "path/to/project/eslint.config.
|
|
181
|
+
+ "eslintConfig": "path/to/project/eslint.config.mjs"
|
|
186
182
|
}
|
|
187
183
|
},
|
|
188
184
|
```
|
|
@@ -252,7 +248,7 @@ Include the commitlint preset in your `package.json`:
|
|
|
252
248
|
Include the shared Prettier config in your `package.json`:
|
|
253
249
|
|
|
254
250
|
```json
|
|
255
|
-
"prettier": "@siemens/prettier-config
|
|
251
|
+
"prettier": "@siemens/prettier-config",
|
|
256
252
|
```
|
|
257
253
|
|
|
258
254
|
### ESLint Plugin
|