Skip to content

Commit 64bb98b

Browse files
committed
feat: support angular 20
1 parent f3d8e32 commit 64bb98b

File tree

13 files changed

+1950
-2068
lines changed

13 files changed

+1950
-2068
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 219 deletions
This file was deleted.

angular.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
"builder": "@angular-devkit/build-angular:application",
6666
"options": {
6767
"outputPath": {
68-
"base": "dist/ngx-multiple-dates-app"
68+
"base": "dist/ngx-multiple-dates-app",
69+
"browser": ""
6970
},
7071
"index": "projects/ngx-multiple-dates-app/src/index.html",
7172
"tsConfig": "projects/ngx-multiple-dates-app/tsconfig.app.json",
@@ -209,5 +210,31 @@
209210
},
210211
"cli": {
211212
"analytics": false
213+
},
214+
"schematics": {
215+
"@schematics/angular:component": {
216+
"type": "component"
217+
},
218+
"@schematics/angular:directive": {
219+
"type": "directive"
220+
},
221+
"@schematics/angular:service": {
222+
"type": "service"
223+
},
224+
"@schematics/angular:guard": {
225+
"typeSeparator": "."
226+
},
227+
"@schematics/angular:interceptor": {
228+
"typeSeparator": "."
229+
},
230+
"@schematics/angular:module": {
231+
"typeSeparator": "."
232+
},
233+
"@schematics/angular:pipe": {
234+
"typeSeparator": "."
235+
},
236+
"@schematics/angular:resolver": {
237+
"typeSeparator": "."
238+
}
212239
}
213240
}

eslint.config.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// @ts-check
2+
// Allows us to bring in the recommended core rules from eslint itself
3+
const eslint = require('@eslint/js');
4+
// Allows us to use the typed utility for our config, and to bring in the recommended rules for TypeScript projects from typescript-eslint
5+
const tsEslint = require('typescript-eslint');
6+
// Allows us to bring in the recommended rules for Angular projects from angular-eslint
7+
const angular = require('angular-eslint');
8+
9+
// Export our config array, which is composed together thanks to the typed utility function from typescript-eslint
10+
module.exports = tsEslint.config(
11+
{
12+
// Everything in this config object targets our TypeScript files (Components, Directives, Pipes etc)
13+
files: [ '**/*.ts' ],
14+
extends: [
15+
// Apply the recommended core rules
16+
eslint.configs.recommended,
17+
// Apply the recommended TypeScript rules
18+
...tsEslint.configs.recommended,
19+
// Optionally apply stylistic rules from typescript-eslint that improve code consistency
20+
...tsEslint.configs.stylistic,
21+
// Apply the recommended Angular rules
22+
...angular.configs.tsRecommended
23+
],
24+
// Set the custom processor which will allow us to have our inline Component templates extracted
25+
// and treated as if they are HTML files (and therefore have the .html config below applied to them)
26+
processor: angular.processInlineTemplates,
27+
// Override specific rules for TypeScript files (these will take priority over the extended configs above)
28+
rules: {
29+
'@angular-eslint/directive-selector': [
30+
'error',
31+
{
32+
type: 'attribute',
33+
prefix: 'ngx',
34+
style: 'camelCase',
35+
}
36+
],
37+
'@angular-eslint/component-selector': [
38+
'error',
39+
{
40+
type: 'element',
41+
prefix: 'ngx',
42+
style: 'kebab-case',
43+
}
44+
]
45+
}
46+
},
47+
{
48+
files: [ '**/*.spec.ts' ],
49+
rules: {
50+
'@typescript-eslint/no-explicit-any': 'off'
51+
}
52+
},
53+
{
54+
files: [ 'projects/ngx-multiple-dates-app/**/*.ts' ],
55+
rules: {
56+
'@angular-eslint/directive-selector': [
57+
'error',
58+
{
59+
type: 'attribute',
60+
prefix: 'app',
61+
style: 'camelCase',
62+
}
63+
],
64+
'@angular-eslint/component-selector': [
65+
'error',
66+
{
67+
type: 'element',
68+
prefix: 'app',
69+
style: 'kebab-case',
70+
}
71+
]
72+
}
73+
},
74+
{
75+
// Everything in this config object targets our HTML files (external templates,
76+
// and inline templates as long as we have the `processor` set on our TypeScript config above)
77+
files: [ '**/*.html' ],
78+
extends: [
79+
// Apply the recommended Angular template rules
80+
...angular.configs.templateRecommended,
81+
// Apply the Angular template rules which focus on accessibility of our apps
82+
...angular.configs.templateAccessibility
83+
],
84+
rules: { }
85+
}
86+
);

0 commit comments

Comments
 (0)