Add a bunch of rules

This commit is contained in:
NightKev 2025-06-17 18:12:32 -07:00
parent 9557f91187
commit 7f29b786c1
4 changed files with 50 additions and 23 deletions

View File

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

View File

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

View File

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

View File

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