Add a bunch of rules

This commit is contained in:
NightKev 2025-06-17 18:12:32 -07:00
parent 62864071e7
commit 6a8867abe1
4 changed files with 50 additions and 23 deletions

View File

@ -38,7 +38,18 @@
},
// TODO: Configure and enable import sorting
"assist": { "actions": { "source": { "organizeImports": "off" } } },
"assist": {
"actions": {
"source": {
"organizeImports": {
"level": "off",
"options": {
"groups": []
}
}
}
}
},
"linter": {
"enabled": true,
"rules": {
@ -53,7 +64,8 @@
"fix": "safe"
},
"noUnusedFunctionParameters": "error",
"noUnusedLabels": "error"
"noUnusedLabels": "error",
"noPrivateImports": "error"
},
"style": {
"useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome
@ -108,16 +120,37 @@
"noUselessSwitchCase": "off", // Explicit > Implicit
"noUselessConstructor": "error",
"noBannedTypes": "warn", // TODO: Refactor and make this an error
"noThisInStatic": "error"
"noThisInStatic": "error",
"noUselessThisAlias": "error",
"noUselessTernary": "error"
},
"performance": {
"noNamespaceImport": "error",
"noDelete": "error"
},
"nursery": {
"useAdjacentGetterSetter": "warn",
"noConstantBinaryExpression": "warn",
"noTsIgnore": "warn",
"noAwaitInLoop": "warn",
"useJsonImportAttribute": "error",
"useIndexOf": "warn",
"useObjectSpread": "info",
"useNumericSeparators": "info",
"useIterableCallbackReturn": "warn",
"useSingleJsDocAsterisk": "warn",
"noShadow": "warn"
}
}
},
"javascript": {
"formatter": { "quoteStyle": "double", "arrowParentheses": "asNeeded" }
"formatter": {
"quoteStyle": "double",
"arrowParentheses": "asNeeded"
},
"parser": {
"jsxEverywhere": false
}
},
"overrides": [
{
@ -130,6 +163,9 @@
},
"style": {
"noNonNullAssertion": "off"
},
"nursery": {
"noFloatingPromises": "error"
}
}
}

View File

@ -3,7 +3,7 @@ import i18next from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import HttpBackend from "i18next-http-backend";
import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor";
import pkg from "../../package.json";
import pkg from "../../package.json" with { type: "json" };
//#region Interfaces/Types

View File

@ -41,24 +41,15 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
this.setup();
}
/**
* Sets the updating state and updates button states accordingly.
* If value is true (updating), disables the buttons; if false, enables the buttons.
* @param {boolean} value - The new updating state.
*/
set isUpdating(value) {
/** When set to `true`, disables the buttons; when set to `false`, enables the buttons. */
get isUpdating(): boolean {
return this._isUpdating;
}
set isUpdating(value: boolean) {
this._isUpdating = value;
this.setButtonsState(!value);
}
/**
* Gets the current updating state.
* @returns {boolean} - The current updating state.
*/
get isUpdating() {
return this._isUpdating;
}
setup() {
const titleWindow = addWindow(0, 0, 114, 18, false, false, undefined, undefined, WindowVariant.THIN);
this.add(titleWindow);

View File

@ -2,8 +2,8 @@ import { getAppRootDir } from "#test/sprites/spritesUtils";
import fs from "fs";
import path from "path";
import { beforeAll, describe, expect, it } from "vitest";
import _masterlist from "../../public/images/pokemon/variant/_masterlist.json";
import _exp_masterlist from "../../public/images/pokemon/variant/_exp_masterlist.json";
import _masterlist from "../../public/images/pokemon/variant/_masterlist.json" with { type: "json" };
import _exp_masterlist from "../../public/images/pokemon/variant/_exp_masterlist.json" with { type: "json" };
type PokemonVariantMasterlist = typeof _masterlist;
type PokemonExpVariantMasterlist = typeof _exp_masterlist;
@ -26,9 +26,9 @@ describe("check if every variant's sprite are correctly set", () => {
femaleVariant = masterlist.female;
backVariant = masterlist.back;
// @ts-ignore
// @ts-expect-error
delete masterlist.female; // TODO: resolve ts-ignore
//@ts-ignore
//@ts-expect-error
delete masterlist.back; //TODO: resolve ts-ignore
});