Skip to content

Commit

Permalink
Update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Oct 15, 2024
1 parent c20718d commit bdcf6f6
Show file tree
Hide file tree
Showing 6 changed files with 301 additions and 334 deletions.
21 changes: 0 additions & 21 deletions .eslintrc.cjs

This file was deleted.

39 changes: 39 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
},

rules: {
"@typescript-eslint/no-unused-vars": ["error", {
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
}],
},
},
];
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"devDependencies": {
"@jest/globals": "^29.7.0",
"@preact/preset-vite": "^2.9.1",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"@typescript-eslint/eslint-plugin": "^8.9.0",
"@typescript-eslint/parser": "^8.9.0",
"@napi-rs/canvas": "^0.1.58",
"eslint": "^8.40.0",
"eslint": "^9.12.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"typescript": "^5.0.4",
"typescript": "^5.6.3",
"vite": "^5.4.9"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
Expand Down
3 changes: 3 additions & 0 deletions src/net/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,21 @@ export class NetGameInstance {
}

public async startGame() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await this.client.client.sendStateEvent(this.roomId, 'uk.half-shot.uk.wormgine.game_stage' as any, {
stage: GameStage.InProgress,
} satisfies FullGameStageEvent["content"]);
}

public async sendAck() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await this.client.client.sendEvent(this.roomId, 'uk.half-shot.uk.wormgine.ack' as any, {
ack: true,
} satisfies PlayerAckEvent["content"]);
}

public async sendGameState(data: Record<string, unknown>) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await this.client.client.sendEvent(this.roomId, 'uk.half-shot.wormgine.game_state' as any, data);
}

Expand Down
5 changes: 2 additions & 3 deletions src/net/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ export interface GameConfigEvent {

export interface ClientReadyEvent {
type: "uk.half-shot.uk.wormgine.ready",
content: {
// Need to decide on some config.
}
// Need to decide on some config.
content: Record<string, never>
}

export interface GameStartEvent {
Expand Down
Loading

0 comments on commit bdcf6f6

Please sign in to comment.