mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-10-05 09:12:04 +00:00
refactor: upgrade typescript-eslint and start the stylistic migration
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
"plugin:unicorn/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["eslint-plugin-unicorn", "eslint-plugin-jsdoc"],
|
||||
"plugins": ["eslint-plugin-unicorn", "eslint-plugin-jsdoc", "@stylistic/eslint-plugin"],
|
||||
"settings": {
|
||||
"jsdoc": {
|
||||
"mode": "typescript"
|
||||
@@ -63,7 +63,7 @@
|
||||
"argsIgnorePattern": "^_"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/lines-between-class-members": ["error", "always"],
|
||||
"@stylistic/lines-between-class-members": ["error", "always"],
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@angular-eslint/use-lifecycle-interface": "error",
|
||||
"@angular-eslint/prefer-standalone": "off"
|
||||
|
||||
@@ -138,6 +138,7 @@
|
||||
"@ionic/cli": "7.2.1",
|
||||
"@openstapps/prettier-config": "workspace:*",
|
||||
"@openstapps/tsconfig": "workspace:*",
|
||||
"@stylistic/eslint-plugin": "5.10.0",
|
||||
"@types/fontkit": "2.0.9",
|
||||
"@types/geojson": "1.0.6",
|
||||
"@types/glob": "8.1.0",
|
||||
@@ -149,8 +150,8 @@
|
||||
"@types/karma-jasmine": "4.0.5",
|
||||
"@types/node": "22.15.31",
|
||||
"@types/semver": "7.5.8",
|
||||
"@typescript-eslint/eslint-plugin": "7.18.0",
|
||||
"@typescript-eslint/parser": "7.18.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.39.1",
|
||||
"@typescript-eslint/parser": "8.39.1",
|
||||
"cordova-res": "0.15.4",
|
||||
"cypress": "15.0.0",
|
||||
"eslint": "8.57.0",
|
||||
|
||||
@@ -69,6 +69,7 @@ export class FavoriteButtonComponent {
|
||||
event.stopPropagation();
|
||||
|
||||
this.isFavorite$.pipe(take(1)).subscribe(enabled => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
enabled ? this.favoritesService.delete(this.item) : this.favoritesService.put(this.item);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ export class OfflineNoticeComponent {
|
||||
|
||||
retry() {
|
||||
this.spinIcon.nativeElement.classList.remove('spin');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
this.spinIcon.nativeElement.offsetWidth;
|
||||
this.spinIcon.nativeElement.classList.add('spin');
|
||||
this.offlineProvider.retry();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/ban-types */
|
||||
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
||||
/*
|
||||
* Copyright (C) 2020-2021 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
|
||||
@@ -74,7 +74,7 @@ export class ThingTranslateService {
|
||||
/**
|
||||
* Returns the parsed result of the translations
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-empty-object-type
|
||||
getParsedResult(target: object, key: string): any {
|
||||
return this.parser.getValueFromKeyPath(target, key);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export class ThingTranslateService {
|
||||
public get(
|
||||
thing: SCThings,
|
||||
keyPath: string | string[],
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
): string | number | boolean | object {
|
||||
if (!isDefined(keyPath) || keyPath.length === 0) {
|
||||
throw new Error(`Parameter "keyPath" required`);
|
||||
|
||||
@@ -37,7 +37,7 @@ export class TranslateSimplePipe implements PipeTransform {
|
||||
|
||||
destroy$ = inject(DestroyRef);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
private updateValue() {
|
||||
try {
|
||||
this.value =
|
||||
|
||||
Reference in New Issue
Block a user