Skip to content

Commit 485b357

Browse files
authored
Angular v20 Update
* Upgrade to ng 19 * Update husky files. * Readme updates * Update github build to use node 20 * eslint and workflow updates. * Run `ng update @angular/core@20 @angular/cli@20` * Angular 20 update. * version tick
1 parent 955d0d6 commit 485b357

17 files changed

+9436
-13316
lines changed

.eslintignore

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

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Description
2+
3+
A brief overview of your completed or ongoing work.
4+
5+
### Developement Checklist
6+
7+
- [ ] Bump version up (`package.json` **and** `package-lock.json`)
8+
9+
### Preview(s)
10+
11+
- Add screenshots, gifs, videos, etc. here for a quick preview if applicable.

.github/workflows/on-merge-main-deploy-gpr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
contents: read
1515
packages: write
1616
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-node@v3
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
1919
with:
2020
node-version: '20.x'
2121
registry-url: 'https://npm.pkg.github.com'

.github/workflows/on-merge-main-deploy-npmjs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
deploy_npmjs_package:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
1515
with:
1616
node-version: '20.x'
1717
registry-url: 'https://registry.npmjs.org'

.github/workflows/verify-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
verify_pull_request:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v3
7+
- uses: actions/checkout@v4
88
- name: Checkout 🛎️
99
run: npm ci
1010

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,22 @@ Customization with optional inputs and icon
152152

153153
## Compatibility <a name="compatibility"></a>
154154

155-
| Angular version | @proangular/ngx-scroll-top | Status |
156-
| --------------- | -------------------------- | ---------- |
157-
| v19 | v19.0.0 | Compatible |
158-
| v18 | ------ | Untested |
159-
| v17 | ------ | Untested |
160-
| v16 | ------ | Untested |
161-
| v15 | ------ | Untested |
162-
| v14 | v1.x.x | Compatible |
163-
| v13 | v1.x.x | Compatible |
164-
| v12 | v1.x.x | Compatible |
155+
| <<<<<<< HEAD | Angular version | @proangular/ngx-scroll-top | Install | |
156+
| ------------------------------------------- | --------------- | ----------------------------------------- | --------------- | ---------- | ---------- | ---------- | --- | ------ | -------- | --- |
157+
| ------------------------------------------- | | v20 | v20.0.0 |
158+
| `ng add @proangular/ngx-scroll-top@^20.0.0` | | v19 | v19.0.0 |
159+
| `ng add @proangular/ngx-scroll-top@^19.0.0` | | v18 | ------ | Untested | | v17 |
160+
| ------ | Untested | | v16 | ------ | Untested | | v15 | ------ | Untested | |
161+
| v14 | v1.x.x | `ng add @proangular/ngx-scroll-top@1.1.8` | | v13 | v1.x.x |
162+
| `ng add @proangular/ngx-scroll-top@1.1.8` | | v12 | v1.x.x |
163+
| `ng add @proangular/ngx-scroll-top@1.1.8` | ======= | Angular version |
164+
| @proangular/ngx-scroll-top | Status | | --------------- |
165+
| -------------------------- | ---------- | | v19 | v19.0.0 | Compatible | | v18 |
166+
| ------ | Untested | | v17 | ------ | Untested | | v16 | ------ | Untested | |
167+
| v15 | ------ | Untested | | v14 | v1.x.x | Compatible | | v13 | v1.x.x |
168+
| Compatible | | v12 | v1.x.x | Compatible |
169+
170+
> > > > > > > main
165171
166172
<p align="right">[ <a href="#index">Index</a> ]</p>
167173

angular.json

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"prefix": "app",
1616
"architect": {
1717
"build": {
18-
"builder": "@angular-devkit/build-angular:application",
18+
"builder": "@angular/build:application",
1919
"options": {
2020
"outputPath": "dist/ngx-scroll-top",
2121
"index": "src/index.html",
@@ -61,7 +61,7 @@
6161
"defaultConfiguration": "production"
6262
},
6363
"serve": {
64-
"builder": "@angular-devkit/build-angular:dev-server",
64+
"builder": "@angular/build:dev-server",
6565
"configurations": {
6666
"production": {
6767
"buildTarget": "ngx-scroll-top:build:production"
@@ -73,10 +73,10 @@
7373
"defaultConfiguration": "development"
7474
},
7575
"extract-i18n": {
76-
"builder": "@angular-devkit/build-angular:extract-i18n"
76+
"builder": "@angular/build:extract-i18n"
7777
},
7878
"test": {
79-
"builder": "@angular-devkit/build-angular:karma",
79+
"builder": "@angular/build:karma",
8080
"options": {
8181
"polyfills": [
8282
"zone.js",
@@ -112,5 +112,31 @@
112112
"schematicCollections": [
113113
"@angular-eslint/schematics"
114114
]
115+
},
116+
"schematics": {
117+
"@schematics/angular:component": {
118+
"type": "component"
119+
},
120+
"@schematics/angular:directive": {
121+
"type": "directive"
122+
},
123+
"@schematics/angular:service": {
124+
"type": "service"
125+
},
126+
"@schematics/angular:guard": {
127+
"typeSeparator": "."
128+
},
129+
"@schematics/angular:interceptor": {
130+
"typeSeparator": "."
131+
},
132+
"@schematics/angular:module": {
133+
"typeSeparator": "."
134+
},
135+
"@schematics/angular:pipe": {
136+
"typeSeparator": "."
137+
},
138+
"@schematics/angular:resolver": {
139+
"typeSeparator": "."
140+
}
115141
}
116142
}

eslint.config.js

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
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+
// Component selectors should follow given naming rules.
18+
// @see http://codelyzer.com/rules/component-selector/
19+
'@angular-eslint/component-selector': [
20+
'error',
21+
{
22+
type: 'element',
23+
prefix: 'ngx',
24+
style: 'kebab-case',
25+
},
26+
],
27+
// Directive selectors should follow given naming rules.
28+
// @see http://codelyzer.com/rules/directive-selector/
29+
'@angular-eslint/directive-selector': [
30+
'error',
31+
{
32+
type: 'attribute',
33+
prefix: 'ngx',
34+
style: 'camelCase',
35+
},
36+
],
37+
// Prefer to declare @Output as readonly since they are not supposed
38+
// to be reassigned.
39+
// @see http://codelyzer.com/rules/prefer-output-readonly/
40+
'@angular-eslint/prefer-output-readonly': ['error'],
41+
// Enforce use of component selector rules.
42+
// @see http://codelyzer.com/rules/component-selector/
43+
'@angular-eslint/use-component-selector': ['error'],
44+
// Disallows using ViewEncapsulation.None.
45+
// @see http://codelyzer.com/rules/use-component-view-encapsulation/
46+
'@angular-eslint/use-component-view-encapsulation': ['error'],
47+
// Ensure that components implement life cycle interfaces if they use
48+
// them.
49+
// @see http://codelyzer.com/rules/use-life-cycle-interface/
50+
'@angular-eslint/use-lifecycle-interface': ['error'],
51+
// Require consistently using either T[] or Array<T> for arrays.
52+
// @see https://typescript-eslint.io/rules/array-type/
53+
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
54+
// Enforce consistent usage of type assertions.
55+
// @see https://typescript-eslint.io/rules/consistent-type-assertions/
56+
'@typescript-eslint/consistent-type-assertions': [
57+
'error',
58+
{
59+
assertionStyle: 'as',
60+
objectLiteralTypeAssertions: 'never',
61+
},
62+
],
63+
// Enforce type definitions to consistently use either interface or type.
64+
// @see https://typescript-eslint.io/rules/consistent-type-definitions/
65+
'@typescript-eslint/consistent-type-definitions': 'error',
66+
// Require explicit return types on functions and class methods.
67+
// @see https://typescript-eslint.io/rules/explicit-function-return-type/
68+
'@typescript-eslint/explicit-function-return-type': [
69+
'error',
70+
{ allowExpressions: true },
71+
],
72+
// Require explicit accessibility modifiers on class properties and methods.
73+
// @see https://typescript-eslint.io/rules/explicit-member-accessibility/
74+
'@typescript-eslint/explicit-member-accessibility': [
75+
'error',
76+
{ accessibility: 'explicit' },
77+
],
78+
// Require explicit return and argument types on exported functions' and
79+
// classes' public class methods.
80+
// @see https://typescript-eslint.io/rules/explicit-module-boundary-types/
81+
'@typescript-eslint/explicit-module-boundary-types': 'error',
82+
// Require a consistent member declaration order.
83+
// @see https://typescript-eslint.io/rules/member-ordering/
84+
'@typescript-eslint/member-ordering': [
85+
'error',
86+
{
87+
default: [
88+
'constructor',
89+
'static-field',
90+
'instance-field',
91+
'static-method',
92+
'instance-method',
93+
],
94+
},
95+
],
96+
// Enforce naming conventions for everything across a codebase.
97+
// @see https://typescript-eslint.io/rules/naming-convention/
98+
'@typescript-eslint/naming-convention': [
99+
'error',
100+
{
101+
selector: 'classProperty',
102+
format: ['PascalCase', 'camelCase'],
103+
modifiers: ['public'],
104+
},
105+
{
106+
selector: 'function',
107+
format: ['camelCase'],
108+
},
109+
{
110+
selector: 'interface',
111+
format: ['PascalCase'],
112+
custom: {
113+
regex: '^I[A-Z]',
114+
match: false,
115+
},
116+
},
117+
{
118+
selector: 'enumMember',
119+
format: ['UPPER_CASE'],
120+
},
121+
],
122+
// Disallow empty functions.
123+
// @see https://typescript-eslint.io/rules/no-empty-function/
124+
'@typescript-eslint/no-empty-function': 'error',
125+
// Disallow the declaration of empty interfaces.
126+
// @see https://typescript-eslint.io/rules/no-empty-interface/
127+
'@typescript-eslint/no-empty-interface': 'off',
128+
// Disallow the any type.
129+
// @see https://typescript-eslint.io/rules/no-explicit-any/
130+
'@typescript-eslint/no-explicit-any': 'error',
131+
// Disallow TypeScript namespaces.
132+
// @see https://typescript-eslint.io/rules/no-namespace/
133+
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
134+
// Disallow unused expressions.
135+
// @see https://typescript-eslint.io/rules/no-unused-expressions/
136+
'@typescript-eslint/no-unused-expressions': 'error',
137+
// Disallow unused variables.
138+
// @see https://typescript-eslint.io/rules/no-unused-vars/
139+
'@typescript-eslint/no-unused-vars': [
140+
'error',
141+
{
142+
argsIgnorePattern: '^_',
143+
ignoreRestSiblings: true,
144+
varsIgnorePattern: '^_',
145+
},
146+
],
147+
// Enforce the use of for-of loop over the standard for loop where
148+
// possible.
149+
// @see https://typescript-eslint.io/rules/prefer-for-of/
150+
'@typescript-eslint/prefer-for-of': ['warn'],
151+
// Enforce using function types instead of interfaces with call
152+
// signatures.
153+
// @see https://typescript-eslint.io/rules/prefer-function-type/
154+
'@typescript-eslint/prefer-function-type': ['warn'],
155+
// Disallow two overloads that could be unified into one with a union
156+
// or an optional/rest parameter.
157+
// @see https://typescript-eslint.io/rules/unified-signatures/
158+
'@typescript-eslint/unified-signatures': 'warn',
159+
// Require the use of === and !==
160+
// @see https://eslint.org/docs/latest/rules/eqeqeq
161+
eqeqeq: ['error'],
162+
// Require for-in loops to include an if statement
163+
// @see https://eslint.org/docs/latest/rules/guard-for-in
164+
'guard-for-in': ['error'],
165+
// Disallow bitwise operators
166+
// @see https://eslint.org/docs/latest/rules/no-bitwise
167+
'no-bitwise': ['error'],
168+
// Disallow the use of arguments.caller or arguments.callee
169+
// @see https://eslint.org/docs/latest/rules/no-caller
170+
'no-caller': ['error'],
171+
// Disallow the use of console
172+
// @see https://eslint.org/docs/latest/rules/no-console
173+
'no-console': ['error', { allow: ['warn', 'error'] }],
174+
// Disallow duplicate module imports
175+
// @see https://eslint.org/docs/latest/rules/no-duplicate-imports
176+
'no-duplicate-imports': ['error'],
177+
// Disallow empty block statements
178+
// @see https://eslint.org/docs/latest/rules/no-empty
179+
'no-empty': 'error',
180+
// Disallow the use of eval()
181+
// @see https://eslint.org/docs/latest/rules/no-eval
182+
'no-eval': ['error'],
183+
// Disallow new operators with the String, Number, and Boolean objects
184+
// @see https://eslint.org/docs/latest/rules/no-new-wrappers
185+
'no-new-wrappers': ['error'],
186+
// Disallow throwing literals as exceptions
187+
// @see https://eslint.org/docs/latest/rules/no-throw-literal
188+
'no-throw-literal': ['error'],
189+
// Require let or const instead of var
190+
// @see https://eslint.org/docs/latest/rules/no-var
191+
'no-var': ['error'],
192+
// Require or disallow method and property shorthand syntax for object
193+
// literals
194+
// @see https://eslint.org/docs/latest/rules/object-shorthand
195+
'object-shorthand': ['error'],
196+
// Enforce variables to be declared either together or separately in
197+
// functions
198+
// @see https://eslint.org/docs/latest/rules/one-var
199+
'one-var': ['error', 'never'],
200+
// Require using arrow functions for callbacks
201+
// @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
202+
'prefer-arrow/prefer-arrow-functions': 'off',
203+
// Require const declarations for variables that are never reassigned
204+
// after declared
205+
// @see https://eslint.org/docs/latest/rules/prefer-const
206+
'prefer-const': ['error'],
207+
// Enforce the consistent use of the radix argument when using
208+
// parseInt()
209+
// @see https://eslint.org/docs/latest/rules/radix
210+
radix: ['error'],
211+
// Enforce consistent spacing after the // or /* in a comment
212+
// @see https://eslint.org/docs/latest/rules/spaced-comment
213+
'spaced-comment': ['error', 'always', { block: { balanced: true } }],
214+
},
215+
},
216+
{
217+
files: ['**/*.html'],
218+
extends: [
219+
...angular.configs.templateRecommended,
220+
...angular.configs.templateAccessibility,
221+
],
222+
rules: {},
223+
},
224+
);

0 commit comments

Comments
 (0)