Skip to content

Commit 2b6ecd1

Browse files
committedAug 14, 2024
Update to Angular v18.1
1 parent db18fb3 commit 2b6ecd1

17 files changed

+8753
-10595
lines changed
 

‎.eslintrc.json

-50
This file was deleted.

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ speed-measure-plugin*.json
3131
!.vscode/extensions.json
3232
.history/*
3333

34-
# misc
34+
# Miscellaneous
35+
/.angular/cache
3536
/.sass-cache
3637
/connect.lock
3738
/coverage

‎README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
A demo angular application with unit and e2e tests, for the article at: http://clade.co.uk/adewole/blog/angular/cross-field-validation
44

5-
I wanted to share my experience and gather feedback on creating a custom Angular cross-field validator that compares and validates the values of multiple groups of input fields and their relative confirm input fields. The app is built with Angular – strict mode, for both reactive and template-driven forms.
5+
An Angular application with a custom cross-field validator which compares and validates the values of multiple groups of input fields and their relative confirm input fields. The application implements cross-field validation for both reactive and template-driven forms.
66

77
By [Ade Oyebadejo](http://www.clade.co.uk/adewole)
88

99
### Technology
1010

1111
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.5.
1212

13-
Version 2.0.0 - Project updated to Angular version 16 Using Node version 18.10.0
14-
Version 3.0.0 - Project updated to Angular version 17 Using Node version 18.13.0
13+
Version 2.0.0 - Project updated to Angular version 16 Using Node version 18.10.0\
14+
Version 3.0.0 - Project updated to Angular version 17 Using Node version 18.13.0\
15+
Version 4.0.0 - Project updated to Angular version 18 Using Node version 22.0.0
1516

1617
### Getting Started
1718

‎angular.json

+33-40
Original file line numberDiff line numberDiff line change
@@ -35,53 +35,51 @@
3535
},
3636
"configurations": {
3737
"production": {
38-
"fileReplacements": [
39-
{
40-
"replace": "src/environments/environment.ts",
41-
"with": "src/environments/environment.prod.ts"
42-
}
43-
],
44-
"optimization": true,
45-
"outputHashing": "all",
46-
"sourceMap": false,
47-
"namedChunks": false,
4838
"budgets": [
4939
{
5040
"type": "initial",
51-
"maximumWarning": "500kb",
52-
"maximumError": "1mb"
41+
"maximumWarning": "2MB",
42+
"maximumError": "2.5MB"
5343
},
5444
{
5545
"type": "anyComponentStyle",
56-
"maximumWarning": "2kb",
57-
"maximumError": "4kb"
46+
"maximumWarning": "2kB",
47+
"maximumError": "4kB"
5848
}
59-
]
49+
],
50+
"outputHashing": "all"
51+
},
52+
"development": {
53+
"optimization": false,
54+
"extractLicenses": false,
55+
"sourceMap": true
6056
}
61-
}
57+
},
58+
"defaultConfiguration": "production"
6259
},
6360
"serve": {
6461
"builder": "@angular-devkit/build-angular:dev-server",
65-
"options": {
66-
"buildTarget": "angular-form-input-cross-validator:build"
67-
},
6862
"configurations": {
6963
"production": {
7064
"buildTarget": "angular-form-input-cross-validator:build:production"
65+
},
66+
"development": {
67+
"buildTarget": "angular-form-input-cross-validator:build:development"
7168
}
72-
}
69+
},
70+
"defaultConfiguration": "development"
7371
},
7472
"extract-i18n": {
75-
"builder": "@angular-devkit/build-angular:extract-i18n",
76-
"options": {
77-
"buildTarget": "angular-form-input-cross-validator:build"
78-
}
73+
"builder": "@angular-devkit/build-angular:extract-i18n"
7974
},
8075
"test": {
8176
"builder": "@angular-devkit/build-angular:karma",
8277
"options": {
8378
"main": "src/test.ts",
84-
"polyfills": "src/polyfills.ts",
79+
"polyfills": [
80+
"zone.js",
81+
"zone.js/testing"
82+
],
8583
"tsConfig": "tsconfig.spec.json",
8684
"karmaConfig": "karma.conf.js",
8785
"assets": [
@@ -94,15 +92,6 @@
9492
"scripts": []
9593
}
9694
},
97-
"lint": {
98-
"builder": "@angular-eslint/builder:lint",
99-
"options": {
100-
"lintFilePatterns": [
101-
"src/**/*.ts",
102-
"src/**/*.html"
103-
]
104-
}
105-
},
10695
"e2e": {
10796
"builder": "@cypress/schematic:cypress",
10897
"options": {
@@ -133,18 +122,22 @@
133122
"watch": true,
134123
"headless": false
135124
}
125+
},
126+
"lint": {
127+
"builder": "@angular-eslint/builder:lint",
128+
"options": {
129+
"lintFilePatterns": [
130+
"src/**/*.ts",
131+
"src/**/*.html"
132+
]
133+
}
136134
}
137135
}
138136
}
139137
},
140138
"cli": {
141-
"cache": {
142-
"enabled": false
143-
},
144139
"schematicCollections": [
145-
"@cypress/schematic",
146-
"@angular-eslint/schematics",
147-
"@schematics/angular"
140+
"@angular-eslint/schematics"
148141
]
149142
}
150143
}

‎eslint.config.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// @ts-check
2+
const eslint = require("@eslint/js");
3+
const tseslint = require("typescript-eslint");
4+
const angular = require("angular-eslint");
5+
6+
module.exports = tseslint.config(
7+
{
8+
files: ["**/*.ts"],
9+
extends: [
10+
eslint.configs.recommended,
11+
...tseslint.configs.recommended,
12+
...tseslint.configs.stylistic,
13+
...angular.configs.tsRecommended,
14+
],
15+
processor: angular.processInlineTemplates,
16+
rules: {
17+
"@angular-eslint/directive-selector": [
18+
"error",
19+
{
20+
type: "attribute",
21+
prefix: "app",
22+
style: "camelCase",
23+
},
24+
],
25+
"@angular-eslint/component-selector": [
26+
"error",
27+
{
28+
type: "element",
29+
prefix: "app",
30+
style: "kebab-case",
31+
},
32+
],
33+
},
34+
},
35+
{
36+
files: ["**/*.html"],
37+
extends: [
38+
...angular.configs.templateRecommended,
39+
...angular.configs.templateAccessibility,
40+
],
41+
rules: {},
42+
}
43+
);

0 commit comments

Comments
 (0)