Skip to content

Commit 10e71ba

Browse files
committed
build: update linting setup
Updates the linting setup to the latest eslint which involved fixing some breaking changes.
1 parent d629cb3 commit 10e71ba

File tree

6 files changed

+8359
-8118
lines changed

6 files changed

+8359
-8118
lines changed

.eslintrc.json

Lines changed: 7 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -3,114 +3,21 @@
33
"overrides": [
44
{
55
"files": ["*.ts"],
6-
"plugins": ["ban"],
7-
"parserOptions": {
8-
"project": [
9-
"tsconfig.json"
10-
],
11-
"createDefaultProgram": true
12-
},
136
"extends": [
14-
"plugin:@angular-eslint/ng-cli-compat",
15-
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:@angular-eslint/recommended",
1610
"plugin:@angular-eslint/template/process-inline-templates"
1711
],
1812
"rules": {
19-
"@angular-eslint/component-class-suffix": "off",
2013
"@angular-eslint/component-selector": "off",
21-
"@angular-eslint/directive-class-suffix": "off",
22-
"@angular-eslint/directive-selector": "off",
23-
"@typescript-eslint/dot-notation": "off",
24-
"@angular-eslint/no-host-metadata-property": "off",
25-
"@typescript-eslint/member-delimiter-style": "off",
26-
"@typescript-eslint/naming-convention": [
27-
"error",
28-
{
29-
"selector": "property",
30-
"format": ["camelCase"],
31-
"filter": {
32-
"regex": "^(\\[attr\\.|\\[class\\.|\\[style\\.)",
33-
"match": false
34-
}
35-
}
36-
],
37-
"@angular-eslint/no-output-on-prefix": "off",
38-
"@typescript-eslint/explicit-member-accessibility": [
39-
"off",
40-
{
41-
"accessibility": "explicit"
42-
}
43-
],
44-
"@typescript-eslint/no-inferrable-types": "off",
45-
"@typescript-eslint/member-ordering": "off",
46-
"@typescript-eslint/no-unused-vars": "error",
47-
"@typescript-eslint/no-non-null-assertion": "off",
48-
"@typescript-eslint/quotes": [
49-
"error",
50-
"single",
51-
{
52-
"avoidEscape": true,
53-
"allowTemplateLiterals": true
54-
}
55-
],
56-
"@typescript-eslint/semi": [
57-
"error"
58-
],
59-
"arrow-parens": [
60-
"off",
61-
"always"
62-
],
63-
"brace-style": [
64-
"error",
65-
"1tbs"
66-
],
67-
"import/order": "off",
68-
"linebreak-style": [
69-
"error",
70-
"unix"
71-
],
72-
"max-len": [
73-
"error",
74-
{
75-
"code": 100
76-
}
77-
],
78-
"ban/ban": [
79-
"error",
80-
{"name": "fit"},
81-
{"name": "fdescribe"},
82-
{"name": "xit"},
83-
{"name": "xdescribe"},
84-
{"name": ["Object", "assign"], "message": "Use the spread operator instead."}
85-
],
86-
"no-duplicate-imports": "error",
87-
"no-redeclare": "error",
88-
"object-shorthand": "error",
89-
"no-underscore-dangle": "off",
90-
"prefer-arrow/prefer-arrow-functions": "off",
91-
"jsdoc/newline-after-description": "error",
92-
"quote-props": "off"
14+
"@angular-eslint/no-output-on-prefix": "off"
9315
}
9416
},
9517
{
96-
"files": [
97-
"*.html"
98-
],
99-
"extends": [
100-
"plugin:@angular-eslint/template/recommended"
101-
],
102-
"rules": {
103-
"@angular-eslint/template/accessibility-alt-text": "error",
104-
"@angular-eslint/template/accessibility-elements-content": "error",
105-
"@angular-eslint/template/accessibility-label-for": "error",
106-
"@angular-eslint/template/accessibility-table-scope": "error",
107-
"@angular-eslint/template/accessibility-valid-aria": "error",
108-
"@angular-eslint/template/click-events-have-key-events": "error",
109-
"@angular-eslint/template/mouse-events-have-key-events": "error",
110-
"@angular-eslint/template/no-autofocus": "error",
111-
"@angular-eslint/template/no-distracting-elements": "error",
112-
"@angular-eslint/template/no-positive-tabindex": "error"
113-
}
18+
"files": ["*.html"],
19+
"extends": ["plugin:@angular-eslint/template/recommended"],
20+
"rules": {}
11421
}
11522
]
11623
}

angular.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,13 @@
118118
},
119119
"cli": {
120120
"analytics": false
121+
},
122+
"schematics": {
123+
"@angular-eslint/schematics:application": {
124+
"setParserOptionsProject": true
125+
},
126+
"@angular-eslint/schematics:library": {
127+
"setParserOptionsProject": true
128+
}
121129
}
122130
}

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,29 @@
2929
"url": "https://github.com/crisbeto/angular-svg-round-progressbar/issues"
3030
},
3131
"homepage": "https://github.com/crisbeto/angular-svg-round-progressbar",
32-
"peerDependencies": {},
32+
"peerDependencies": {
33+
"@angular/common": "^18.0.0",
34+
"@angular/core": "^18.0.0"
35+
},
3336
"devDependencies": {
3437
"@angular-devkit/architect": "^0.1800.2",
3538
"@angular-devkit/build-angular": "^18.0.2",
36-
"@angular-eslint/builder": "~14.1.2",
37-
"@angular-eslint/eslint-plugin": "~14.1.2",
38-
"@angular-eslint/eslint-plugin-template": "~14.1.2",
39-
"@angular-eslint/template-parser": "~14.1.2",
39+
"@angular-eslint/builder": "~18.0.1",
40+
"@angular-eslint/schematics": "~18.0.1",
41+
"@angular-eslint/eslint-plugin": "~18.0.1",
42+
"@angular-eslint/eslint-plugin-template": "~18.0.1",
43+
"@angular-eslint/template-parser": "~18.0.1",
4044
"@angular/cli": "^18.0.2",
4145
"@angular/common": "^18.0.1",
4246
"@angular/compiler": "^18.0.1",
4347
"@angular/compiler-cli": "^18.0.1",
4448
"@angular/core": "^18.0.1",
4549
"@angular/forms": "^18.0.1",
4650
"@angular/platform-browser": "^18.0.1",
47-
"@angular/platform-browser-dynamic": "^18.0.1",
48-
"@typescript-eslint/eslint-plugin": "~6.13.1",
49-
"@typescript-eslint/parser": "~6.13.1",
51+
"@typescript-eslint/eslint-plugin": "^7.2.0",
52+
"@typescript-eslint/parser": "^7.2.0",
5053
"angular-cli-ghpages": "^1.0.7",
51-
"eslint": "^8.55.0",
54+
"eslint": "^8.57.0",
5255
"eslint-plugin-ban": "^1.5.2",
5356
"eslint-plugin-import": "^2.25.2",
5457
"eslint-plugin-jsdoc": "^31.1.0",

src/lib/round-progress/round-progress.component.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,31 +99,31 @@ export class RoundProgressComponent implements OnChanges {
9999
to = this._clamp(to);
100100
from = this._clamp(from);
101101

102-
const self = this;
103102
const changeInValue = to - from;
104-
const duration = self.duration;
103+
const duration = this.duration;
105104

106105
// Avoid firing change detection for each of the animation frames.
107-
self.ngZone.runOutsideAngular(() => {
106+
this.ngZone.runOutsideAngular(() => {
108107
const start = () => {
109-
const startTime = self.service.getTimestamp();
110-
const id = ++self.lastAnimationId;
111-
112-
requestAnimationFrame(function animation() {
113-
const currentTime = Math.min(self.service.getTimestamp() - startTime, duration);
114-
const easingFn = self.easing[self.animation as keyof RoundProgressEase];
108+
const startTime = this.service.getTimestamp();
109+
const id = ++this.lastAnimationId;
110+
const animation = () => {
111+
const currentTime = Math.min(this.service.getTimestamp() - startTime, duration);
112+
const easingFn = this.easing[this.animation as keyof RoundProgressEase];
115113
const value = easingFn(currentTime, from, changeInValue, duration);
116114

117-
self._updatePath(value);
115+
this._updatePath(value);
118116

119-
if (self.onRender.observers.length > 0) {
120-
self.onRender.emit(value);
117+
if (this.onRender.observers.length > 0) {
118+
this.onRender.emit(value);
121119
}
122120

123-
if (id === self.lastAnimationId && currentTime < duration) {
121+
if (id === this.lastAnimationId && currentTime < duration) {
124122
requestAnimationFrame(animation);
125123
}
126-
});
124+
}
125+
126+
requestAnimationFrame(animation);
127127
};
128128

129129
if (this.animationDelay > 0) {

src/lib/round-progress/round-progress.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ export class RoundProgressService {
99
private hasPerf: boolean;
1010
public supportsSvg: boolean;
1111

12-
constructor(@Optional() @Inject(DOCUMENT) document: any) {
12+
constructor(@Optional() @Inject(DOCUMENT) document?: Document) {
1313
this.supportsSvg = !!(
1414
document &&
1515
document.createElementNS &&
1616
document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect
1717
);
1818

19-
this.base = document && document.head.querySelector('base');
19+
this.base = document?.head?.querySelector('base') as HTMLBaseElement;
2020
this.hasPerf =
2121
typeof window !== 'undefined' &&
2222
window.performance &&

0 commit comments

Comments
 (0)