Skip to content

Commit

Permalink
Use eslint 9.x + update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Paranoiaque committed Aug 13, 2024
1 parent d74de54 commit 170dd8f
Show file tree
Hide file tree
Showing 14 changed files with 1,696 additions and 3,053 deletions.
4,589 changes: 1,611 additions & 2,978 deletions package-lock.json

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"sonar": "sonar-scanner"
},
"dependencies": {
"@angular/animations": "^18.1.2",
"@angular/common": "^18.1.2",
"@angular/compiler": "^18.1.2",
"@angular/core": "^18.1.2",
"@angular/forms": "^18.1.2",
"@angular/platform-browser": "^18.1.2",
"@angular/platform-browser-dynamic": "^18.1.2",
"@angular/router": "^18.1.2",
"@angular/animations": "^18.1.4",
"@angular/common": "^18.1.4",
"@angular/compiler": "^18.1.4",
"@angular/core": "^18.1.4",
"@angular/forms": "^18.1.4",
"@angular/platform-browser": "^18.1.4",
"@angular/platform-browser-dynamic": "^18.1.4",
"@angular/router": "^18.1.4",
"@ngx-translate/http-loader": "^8.0.0",
"angular-oauth2-oidc": "^17.0.2",
"bootstrap": "^5.3.3",
Expand All @@ -47,15 +47,15 @@
"tslib": "^2.6.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.1.2",
"@angular-eslint/builder": "18.1.0",
"@angular-eslint/eslint-plugin": "18.1.0",
"@angular-eslint/eslint-plugin-template": "18.1.0",
"@angular-eslint/schematics": "18.1.0",
"@angular-eslint/template-parser": "18.1.0",
"@angular/cdk": "^18.1.2",
"@angular/cli": "~18.1.2",
"@angular/compiler-cli": "^18.1.2",
"@angular-devkit/build-angular": "^18.1.4",
"@angular-eslint/builder": "18.2.0",
"@angular-eslint/eslint-plugin": "18.2.0",
"@angular-eslint/eslint-plugin-template": "18.2.0",
"@angular-eslint/schematics": "18.2.0",
"@angular-eslint/template-parser": "18.2.0",
"@angular/cdk": "^18.1.4",
"@angular/cli": "~18.1.4",
"@angular/compiler-cli": "^18.1.4",
"@iconify-icons/akar-icons": "^1.2.19",
"@iconify-icons/clarity": "^1.2.8",
"@iconify-icons/emojione-monotone": "^1.2.4",
Expand All @@ -77,40 +77,40 @@
"@iconify/icons-vaadin": "^1.2.4",
"@iconify/icons-whh": "^1.2.3",
"@types/jasmine": "~5.1.4",
"@typescript-eslint/eslint-plugin": "7.17.0",
"@typescript-eslint/parser": "7.17.0",
"@typescript-eslint/eslint-plugin": "8.1.0",
"@typescript-eslint/parser": "8.1.0",
"cordova-android": "^13.0.0",
"cordova-electron": "^4.0.0",
"cordova-ios": "^7.1.1",
"cordova-plugin-device": "^3.0.0",
"cordova-plugin-googleplus": "8.5.2",
"cordova-plugin-inappbrowser": "^6.0.0",
"cordova-plugin-statusbar": "^4.0.0",
"electron": "^31.3.0",
"electron": "^31.3.1",
"electron-builder": "^24.13.3",
"eslint": "^8.57.0",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-sonar": "^0.14.1",
"eslint-plugin-sonarjs": "^1.0.4",
"iconify-icon": "^2.1.0",
"jasmine-core": "~5.2.0",
"karma": "~6.4.3",
"karma": "~6.4.4",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.1",
"karma-firefox-launcher": "^2.1.3",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"prettier": "^3.3.3",
"prettier-eslint": "^16.3.0",
"sonarqube-scanner": "^4.0.1"
"sonarqube-scanner": "^4.2.0"
},
"overrides": {
"electron@<=31.0.0": "$electron",
"electron-builder@<=24.0.0": "$electron-builder",
"@typescript-eslint/parser@<=7.0.0": "7.17.0"
"@typescript-eslint/parser@<=7.0.0": "7.18.0"
},
"cordova": {
"platforms": [
Expand Down
14 changes: 9 additions & 5 deletions .eslintrc.json → src/.eslintrc.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
"filenames",
"prettier",
"security",
"sonar"
"sonarjs"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"overrides": [
{
"files": [
Expand Down Expand Up @@ -37,8 +43,7 @@
"prefix": "app",
"style": "kebab-case"
}
],
"sonar/deprecation": 1
]
}
},
{
Expand All @@ -55,8 +60,7 @@
{
"parser": "angular"
}
],
"sonar/deprecation": 1
]
}
}
]
Expand Down
10 changes: 3 additions & 7 deletions src/app/alliance/alliance-evict-popup.sub-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ export class AllianceEvictPopupSubComponent {
}

possible() {
if (
this.user.getPropertyNb('recruiter') > 0 &&
this.info.allow_eject === 1
) {
return true;
}
return false;
return (
this.user.getPropertyNb('recruiter') > 0 && this.info.allow_eject === 1
);
}
}
10 changes: 0 additions & 10 deletions src/app/attacks/attacks-diamond.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@ export class AttacksDiamondComponent implements OnInit, OnDestroy {
});
this.socket.on('realWaveAttackSum', data => {
this.realWaveAttackSum = data;
const newTab = [];
let j = 0;
for (const i in this.realWaveAttackSum) {
if (
this.realWaveAttackSum[i as keyof typeof this.realWaveAttackSum] > 0
) {
newTab.push(j);
j++;
}
}
});
this.socket.on('waveAttackSum', data => {
this.waveAttackSum = data;
Expand Down
25 changes: 21 additions & 4 deletions src/app/attacks/attacks-seabattles.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,42 @@
@case (1) {
<div
class="case unknown"
role="button"
tabIndex="0"
(click)="selectCase(x, y)"></div>
aria-hidden="true"
(click)="selectCase(x, y)"
(keyup.enter)="selectCase(x, y)"></div>
}
@case (3) {
<div
class="case {{ 'player' + getCase(x, y).color_id }}"
(click)="selectCase(x, y)">
role="button"
tabIndex="0"
aria-hidden="true"
(click)="selectCase(x, y)"
(keyup.enter)="selectCase(x, y)">
<div class="army"></div>
</div>
}
@case (4) {
<div
class="case {{ 'player' + getCase(x, y).color_id }}"
(click)="selectCase(x, y)">
role="button"
tabIndex="0"
aria-hidden="true"
(click)="selectCase(x, y)"
(keyup.enter)="selectCase(x, y)">
<div class="capital"></div>
</div>
}
@default {
<div class="case" (click)="selectCase(x, y)"></div>
<div
class="case"
role="button"
tabIndex="0"
aria-hidden="true"
(click)="selectCase(x, y)"
(keyup.enter)="selectCase(x, y)"></div>
}
}
}
Expand Down
19 changes: 10 additions & 9 deletions src/app/details/details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ export class DetailsComponent implements OnInit {
const buildingList = this.user.getBuildings();

for (const i in buildingList) {
if (this.user.getPropertyNb(buildingList[i].code) > 0) {
if (buildingList[i].consumption) {
const consumption = buildingList[i].consumption;
for (const consum in consumption) {
this.variation[consum as keyof typeof this.variation] -=
consumption[consum as keyof typeof consumption] *
this.user.getPropertyNb(buildingList[i].code);
this.nbvariation[consum as keyof typeof this.nbvariation]++;
}
if (
this.user.getPropertyNb(buildingList[i].code) > 0 &&
buildingList[i].consumption
) {
const consumption = buildingList[i].consumption;
for (const consum in consumption) {
this.variation[consum as keyof typeof this.variation] -=
consumption[consum as keyof typeof consumption] *
this.user.getPropertyNb(buildingList[i].code);
this.nbvariation[consum as keyof typeof this.nbvariation]++;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ export class MainComponent implements OnInit, OnDestroy {
this.checkMaintenance(result.maintenance);
}
}
} catch (e) {
} catch (e: unknown) {
this.displayServerModal = true;
console.log(e);
}

if (this.displayServerModal) {
Expand Down
7 changes: 4 additions & 3 deletions src/app/messages/messages.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ export class MessagesComponent implements OnInit, OnDestroy {
}
});

this.socket.on('msgInfo', msgInfo => {
this.currentMsg = msgInfo;
this.socket.on('msgInfo', (msgInfo: object) => {
this.currentMsg = msgInfo as typeof this.currentMsg;
this.reported = 0;
setTimeout(() => {
this.scroller.scrollToAnchor('msgBlock');
Expand Down Expand Up @@ -174,7 +174,8 @@ export class MessagesComponent implements OnInit, OnDestroy {
return;
}

const url = this.socket.url + '/api/playerProfile/' + username + '.json';
const url =
this.socket.url + '/api/playerProfile/' + username.toString() + '.json';

this.sub = this.http.get(url).subscribe(result => {
const res = result as { membre_id: number; username: string };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ export class OptionsAccountInformationPopupSubComponent

reader.readAsDataURL(files[0]);
reader.onload = (event2: ProgressEvent<FileReader>) => {
const playerImage = {
name: name,
data: event2.target!.result,
};
this.socket.emit('accountImgUpload', playerImage);
if (event2.target) {
const playerImage = {
name: name,
data: event2.target.result,
};
this.socket.emit('accountImgUpload', playerImage);
}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class SanctuaryStrengthUpdatePopupSubComponent {
}

canUpdate() {
if (this.info.price) {
if (Object.keys(this.info.price).length > 0) {
if (this.info.sanctuaries_power >= 125) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/storeroom/storeroom.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class StoreroomComponent implements OnInit, OnDestroy {
this.storeroomList = [];
this.storeroomMyList = [];

this.storeroom_ress = [].constructor(10);
this.storeroom_ress = [].constructor(10) as typeof this.storeroom_ress;
this.storeroomMin = {
min: 0,
rate: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { AppModule } from './app/app.module';

platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => {
.catch((err: unknown) => {
console.error(err);
});
4 changes: 1 addition & 3 deletions src/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,10 @@ export class UserComponent {
}

getDatasAlliance() {
const datas = this.getProperty('datas') as {
return this.getProperty('datas') as {
alliance: { create: number };
war: { minmembers: number };
};

return datas;
}

questValidateAuto() {
Expand Down

0 comments on commit 170dd8f

Please sign in to comment.