Skip to content

Commit 76067d5

Browse files
authored
feat: upgrade to angular v16 (#76)
- `ng update` to v16 - restore default eslint config to solve errors after upgrade - bump library to v16, going forward will match the library major version to the angular major version it supports closes #75
1 parent d131bfe commit 76067d5

File tree

8 files changed

+2200
-1900
lines changed

8 files changed

+2200
-1900
lines changed

.eslintrc.json

+13-73
Original file line numberDiff line numberDiff line change
@@ -8,88 +8,27 @@
88
"files": [
99
"*.ts"
1010
],
11-
"parserOptions": {
12-
"project": [
13-
"tsconfig.json"
14-
],
15-
"createDefaultProgram": true
16-
},
1711
"extends": [
18-
"plugin:@angular-eslint/ng-cli-compat",
19-
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:@angular-eslint/recommended",
2015
"plugin:@angular-eslint/template/process-inline-templates"
2116
],
2217
"rules": {
23-
"@typescript-eslint/array-type": [
18+
"@angular-eslint/directive-selector": [
2419
"error",
2520
{
26-
"default": "array"
27-
}
28-
],
29-
"@typescript-eslint/consistent-type-definitions": "error",
30-
"@typescript-eslint/dot-notation": "off",
31-
"@typescript-eslint/explicit-member-accessibility": [
32-
"off",
33-
{
34-
"accessibility": "explicit"
35-
}
36-
],
37-
"@typescript-eslint/member-delimiter-style": [
38-
"error",
39-
{
40-
"multiline": {
41-
"delimiter": "none",
42-
"requireLast": true
43-
},
44-
"singleline": {
45-
"delimiter": "semi",
46-
"requireLast": false
47-
}
48-
}
49-
],
50-
"@typescript-eslint/member-ordering": "off",
51-
"@typescript-eslint/naming-convention": "off",
52-
"@typescript-eslint/no-floating-promises": "error",
53-
"@typescript-eslint/no-var-requires": "error",
54-
"@typescript-eslint/quotes": [
55-
"error",
56-
"double",
57-
{
58-
"allowTemplateLiterals": true
59-
}
60-
],
61-
"@typescript-eslint/semi": [
62-
"error",
63-
"never"
64-
],
65-
"brace-style": [
66-
"error",
67-
"1tbs"
68-
],
69-
"comma-dangle": [
70-
"error",
71-
"always-multiline"
72-
],
73-
"id-blacklist": "off",
74-
"id-match": "off",
75-
"import/order": "error",
76-
"no-underscore-dangle": "off",
77-
"padding-line-between-statements": [
78-
"off",
79-
{
80-
"blankLine": "always",
81-
"prev": "*",
82-
"next": "return"
21+
"type": "attribute",
22+
"prefix": "app",
23+
"style": "camelCase"
8324
}
8425
],
85-
"prefer-arrow/prefer-arrow-functions": "off",
86-
"prefer-const": "off",
87-
"space-before-function-paren": [
26+
"@angular-eslint/component-selector": [
8827
"error",
8928
{
90-
"anonymous": "always",
91-
"named": "never",
92-
"asyncArrow": "always"
29+
"type": "element",
30+
"prefix": "app",
31+
"style": "kebab-case"
9332
}
9433
]
9534
}
@@ -99,7 +38,8 @@
9938
"*.html"
10039
],
10140
"extends": [
102-
"plugin:@angular-eslint/template/recommended"
41+
"plugin:@angular-eslint/template/recommended",
42+
"plugin:@angular-eslint/template/accessibility"
10343
],
10444
"rules": {}
10545
}

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 16.0.0 - 2023-05-05
2+
- Support Angular 16 (#76)
3+
- Begin matching major version to major Angular version (hence the jump from `8` -> `16`)
4+
15
# 8.0.1 - 2022-12-03
26
- Fix center image disappearing when other values are updated (#71)
37

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Easy to use QR code generator for Angular projects.
77

88
**Features:**
9-
* Compatible with Angular 15
9+
* Compatible with Angular 16
1010
* Leverages the widely used [qrcode](https://www.npmjs.com/package/qrcode)
1111
package to do the heavy lifting
1212
* Renders to HTML Canvas
@@ -95,8 +95,12 @@ run locally using `ng build && ng serve`
9595
# Angular compatibility matrix
9696
See table below for a history of versions and their Angular compatibility.
9797

98+
From version 16 onwards the library major version will match the Angular
99+
major version.
100+
98101
| Angular Version | ng-qrcode Versions |
99102
|-----------------|--------------------|
103+
| ^16 | ^16 |
100104
| ^15 | ^8 |
101105
| ^14 | ^7 |
102106
| ^13 | ^6 |

package.json

+24-27
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,38 @@
3030
},
3131
"private": true,
3232
"dependencies": {
33-
"@angular/animations": "^15.0.2",
34-
"@angular/common": "^15.0.2",
35-
"@angular/compiler": "^15.0.2",
36-
"@angular/core": "^15.0.2",
37-
"@angular/forms": "^15.0.2",
38-
"@angular/platform-browser": "^15.0.2",
39-
"@angular/platform-browser-dynamic": "^15.0.2",
40-
"@angular/router": "^15.0.2",
33+
"@angular/animations": "^16.0.0",
34+
"@angular/common": "^16.0.0",
35+
"@angular/compiler": "^16.0.0",
36+
"@angular/core": "^16.0.0",
37+
"@angular/forms": "^16.0.0",
38+
"@angular/platform-browser": "^16.0.0",
39+
"@angular/platform-browser-dynamic": "^16.0.0",
40+
"@angular/router": "^16.0.0",
4141
"core-js": "^3.23.1",
4242
"qrcode": "^1.5.0",
4343
"rxjs": "^7.5.5",
4444
"tslib": "^2.4.0",
45-
"zone.js": "~0.12.0"
45+
"zone.js": "~0.13.0"
4646
},
4747
"devDependencies": {
48-
"@angular-devkit/build-angular": "^15.0.2",
49-
"@angular-eslint/builder": "15.1.0",
50-
"@angular-eslint/eslint-plugin": "15.1.0",
51-
"@angular-eslint/eslint-plugin-template": "15.1.0",
52-
"@angular-eslint/schematics": "15.1.0",
53-
"@angular-eslint/template-parser": "15.1.0",
54-
"@angular/cli": "^15.0.2",
55-
"@angular/compiler-cli": "^15.0.2",
56-
"@angular/language-service": "^15.0.2",
48+
"@angular-devkit/build-angular": "^16.0.0",
49+
"@angular-eslint/builder": "16.0.1",
50+
"@angular-eslint/eslint-plugin": "16.0.1",
51+
"@angular-eslint/eslint-plugin-template": "16.0.1",
52+
"@angular-eslint/schematics": "16.0.1",
53+
"@angular-eslint/template-parser": "16.0.1",
54+
"@angular/cli": "^16.0.0",
55+
"@angular/compiler-cli": "^16.0.0",
56+
"@angular/language-service": "^16.0.0",
5757
"@types/jasmine": "~4.3.0",
5858
"@types/jasminewd2": "^2.0.8",
5959
"@types/node": "^18.11.10",
6060
"@types/qrcode": "^1.4.2",
61-
"@typescript-eslint/eslint-plugin": "5.45.0",
62-
"@typescript-eslint/parser": "5.45.0",
61+
"@typescript-eslint/eslint-plugin": "5.59.2",
62+
"@typescript-eslint/parser": "5.59.2",
6363
"angular-cli-ghpages": "^1.0.0-rc.2",
64-
"eslint": "^8.17.0",
65-
"eslint-plugin-import": "2.26.0",
66-
"eslint-plugin-jsdoc": "39.6.4",
67-
"eslint-plugin-prefer-arrow": "latest",
64+
"eslint": "^8.39.0",
6865
"jasmine-core": "~4.5.0",
6966
"jasmine-spec-reporter": "~7.0.0",
7067
"karma": "^6.4.0",
@@ -73,10 +70,10 @@
7370
"karma-jasmine": "~5.1.0",
7471
"karma-jasmine-html-reporter": "^2.0.0",
7572
"karma-mocha-reporter": "^2.2.5",
76-
"ng-packagr": "^15.0.1",
73+
"ng-packagr": "^16.0.0",
7774
"protractor": "~7.0.0",
7875
"ts-node": "^10.8.1",
79-
"typescript": "~4.8.2"
76+
"typescript": "~5.0.4"
8077
},
8178
"keywords": [
8279
"qr",
@@ -89,4 +86,4 @@
8986
"ngx",
9087
"ng2"
9188
]
92-
}
89+
}

projects/ng-qrcode-demo/.eslintrc.json

-109
Original file line numberDiff line numberDiff line change
@@ -2,114 +2,5 @@
22
"extends": "../../.eslintrc.json",
33
"ignorePatterns": [
44
"!**/*"
5-
],
6-
"overrides": [
7-
{
8-
"files": [
9-
"*.ts"
10-
],
11-
"parserOptions": {
12-
"project": [
13-
"projects/ng-qrcode-demo//tsconfig.app.json",
14-
"projects/ng-qrcode-demo//tsconfig.spec.json"
15-
],
16-
"createDefaultProgram": true
17-
},
18-
"rules": {
19-
"@angular-eslint/component-selector": [
20-
"error",
21-
{
22-
"type": "element",
23-
"prefix": "app",
24-
"style": "kebab-case"
25-
}
26-
],
27-
"@angular-eslint/directive-selector": [
28-
"error",
29-
{
30-
"type": "attribute",
31-
"prefix": "app",
32-
"style": "camelCase"
33-
}
34-
],
35-
"@typescript-eslint/array-type": [
36-
"error",
37-
{
38-
"default": "array"
39-
}
40-
],
41-
"@typescript-eslint/consistent-type-definitions": "error",
42-
"@typescript-eslint/dot-notation": "off",
43-
"@typescript-eslint/explicit-member-accessibility": [
44-
"off",
45-
{
46-
"accessibility": "explicit"
47-
}
48-
],
49-
"@typescript-eslint/member-delimiter-style": [
50-
"error",
51-
{
52-
"multiline": {
53-
"delimiter": "none",
54-
"requireLast": true
55-
},
56-
"singleline": {
57-
"delimiter": "semi",
58-
"requireLast": false
59-
}
60-
}
61-
],
62-
"@typescript-eslint/member-ordering": "off",
63-
"@typescript-eslint/no-floating-promises": "error",
64-
"@typescript-eslint/no-var-requires": "error",
65-
"@typescript-eslint/quotes": [
66-
"error",
67-
"double",
68-
{
69-
"allowTemplateLiterals": true
70-
}
71-
],
72-
"@typescript-eslint/semi": [
73-
"error",
74-
"never"
75-
],
76-
"brace-style": [
77-
"error",
78-
"1tbs"
79-
],
80-
"comma-dangle": [
81-
"error",
82-
"always-multiline"
83-
],
84-
"id-blacklist": "off",
85-
"id-match": "off",
86-
"import/order": "error",
87-
"no-underscore-dangle": "off",
88-
"padding-line-between-statements": [
89-
"off",
90-
{
91-
"blankLine": "always",
92-
"prev": "*",
93-
"next": "return"
94-
}
95-
],
96-
"prefer-arrow/prefer-arrow-functions": "off",
97-
"prefer-const": "off",
98-
"space-before-function-paren": [
99-
"error",
100-
{
101-
"anonymous": "always",
102-
"named": "never",
103-
"asyncArrow": "always"
104-
}
105-
]
106-
}
107-
},
108-
{
109-
"files": [
110-
"*.html"
111-
],
112-
"rules": {}
113-
}
1145
]
1156
}

0 commit comments

Comments
 (0)