Skip to content

Commit cda3891

Browse files
authored
chore: update dependencies & lint rules (#142)
1 parent b04dea0 commit cda3891

File tree

9 files changed

+881
-678
lines changed

9 files changed

+881
-678
lines changed

.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"createDefaultProgram": true
1010
},
1111
"extends": [
12+
"plugin:@typescript-eslint/strict-type-checked",
13+
"plugin:@typescript-eslint/stylistic-type-checked",
1214
"plugin:@angular-eslint/recommended",
1315
"plugin:@angular-eslint/template/process-inline-templates"
1416
],
@@ -31,6 +33,12 @@
3133
]
3234
}
3335
},
36+
{
37+
"files": ["*.spec.ts"],
38+
"rules": {
39+
"@typescript-eslint/dot-notation": "off"
40+
}
41+
},
3442
{
3543
"files": ["*.html"],
3644
"extends": ["plugin:@angular-eslint/template/recommended"],

package-lock.json

Lines changed: 854 additions & 664 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"major-release": "npm run major-release_",
2929
"dryBuild": "run-s lib demo",
3030
"update": "npx npm-check-updates -u",
31-
"prettier-check": "prettier . --check"
31+
"prettier-check": "prettier . --check",
32+
"prettier-fix": "prettier . --fix"
3233
},
3334
"dependencies": {
3435
"@angular/animations": "^16.0.0",
@@ -58,12 +59,12 @@
5859
"@angular/compiler-cli": "^16.0.0",
5960
"@angular/language-service": "^16.0.0",
6061
"@types/jasmine": "^4.3.0",
61-
"@typescript-eslint/eslint-plugin": "^5.59.2",
62-
"@typescript-eslint/parser": "^5.59.2",
62+
"@typescript-eslint/eslint-plugin": "^6.1.0",
63+
"@typescript-eslint/parser": "^6.1.0",
6364
"copyfiles": "^2.1.1",
6465
"eslint": "^8.39.0",
6566
"gh-pages": "^5.0.0",
66-
"jasmine-core": "^4.5.0",
67+
"jasmine-core": "^5.0.1",
6768
"karma": "^6.4.1",
6869
"karma-chrome-launcher": "~3.2.0",
6970
"karma-coverage": "^2.2.0",
@@ -72,6 +73,6 @@
7273
"ng-packagr": "^16.0.0",
7374
"npm-run-all": "^4.1.5",
7475
"prettier": "^3.0.0",
75-
"typescript": "~5.0.4"
76+
"typescript": "~5.1.6"
7677
}
7778
}

projects/material-css-vars/src/lib/material-css-vars.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("MaterialCssVarsService", () => {
2424
],
2525
});
2626
service = TestBed.inject(MaterialCssVarsService);
27-
renderer = (service as any).renderer;
27+
renderer = service["renderer"];
2828
});
2929

3030
it("should be created", () => {

projects/material-css-vars/src/lib/material-css-vars.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ export class MaterialCssVarsService {
163163
threshold: HueValue,
164164
palettePrefix: MatCssPalettePrefix,
165165
) {
166+
// ToDo: address this lint error
167+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
166168
if (!threshold || !palettePrefix || this.isAutoContrast) {
167169
return;
168170
}
@@ -345,7 +347,7 @@ export class MaterialCssVarsService {
345347
const isContrast: boolean = name.includes(
346348
MaterialCssVarsService.CONTRAST_PREFIX,
347349
);
348-
let noRgb: string = "";
350+
let noRgb = "";
349351
if (isContrast) {
350352
noRgb = value.replace(")", "-no-rgb)");
351353
} else {

projects/material-css-vars/src/test/integration.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ class ButtonComponent {
1717
function getButtonComputedStyle(
1818
fixture: ComponentFixture<ButtonComponent>,
1919
): CSSStyleDeclaration {
20-
const buttonElement = fixture.debugElement.query(
21-
By.css("button"),
22-
).nativeElement;
20+
const buttonElement = fixture.debugElement.query(By.css("button"))
21+
.nativeElement as HTMLButtonElement;
2322
return getComputedStyle(buttonElement);
2423
}
2524

src/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class AppComponent {
4545
];
4646

4747
spinnerMode: ProgressSpinnerMode = "indeterminate";
48-
spinnerValue: number = 25;
48+
spinnerValue = 25;
4949
spinnerColor: ThemePalette = "primary";
5050
availableSpinnerColors = [
5151
{ name: "none", color: "" },
@@ -67,7 +67,7 @@ export class AppComponent {
6767
],
6868
};
6969

70-
allComplete: boolean = false;
70+
allComplete = false;
7171

7272
constructor(
7373
private _dialog: MatDialog,

src/app/app.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ import { MaterialCssVarsModule } from "../../projects/material-css-vars/src/lib/
8585
warn: "#f44336",
8686
}),
8787
],
88-
providers: [{ provide: APP_BASE_HREF, useValue: window["_app_base"] || "/" }],
88+
providers: [{ provide: APP_BASE_HREF, useValue: window._app_base ?? "/" }],
8989
bootstrap: [AppComponent],
9090
})
91+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
9192
export class AppModule {}

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ if (environment.production) {
1010

1111
platformBrowserDynamic()
1212
.bootstrapModule(AppModule)
13-
.catch((err) => console.error(err));
13+
.catch((err) => {
14+
console.error(err);
15+
});
1416

1517
declare global {
1618
interface Window {

0 commit comments

Comments
 (0)