Commit 4211f144 authored by Chunchi Che's avatar Chunchi Che

add lint check

parent 69b0f005
Pipeline #17368 passed with stages
in 2 minutes and 14 seconds
{ {
"parser": "@typescript-eslint/parser",
"extends": ["plugin:prettier/recommended"],
"plugins": ["@typescript-eslint"],
"rules": { "rules": {
"eqeqeq": 0 "eqeqeq": 0,
"no-var": "error",
"@typescript-eslint/consistent-type-definitions": [
"error",
"interface"
]
} }
} }
stages: stages:
- lint
- build - build
- test - test
- deploy - deploy
variables: before_script:
GIT_DEPTH: "1" - npm ci
npm_lint:
stage: lint
tags:
- linux
script: npm run lint
npm_build: npm_build:
stage: build stage: build
tags: tags:
- linux - linux
script: script: npm run build
- npm ci
- npm run build
# npm_test: # npm_test:
# stage: test # stage: test
......
This diff is collapsed.
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
"react-scripts": "^5.0.1", "react-scripts": "^5.0.1",
"socket.io-client": "^4.5.1", "socket.io-client": "^4.5.1",
"three": "^0.145.0", "three": "^0.145.0",
"typescript": "^4.7.4",
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
}, },
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
"preview": "vite preview", "preview": "vite preview",
"lint": "eslint --ext .ts --ext .tsx src",
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
...@@ -52,7 +52,14 @@ ...@@ -52,7 +52,14 @@
"devDependencies": { "devDependencies": {
"@types/google-protobuf": "^3.15.6", "@types/google-protobuf": "^3.15.6",
"@types/three": "^0.144.0", "@types/three": "^0.144.0",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@vitejs/plugin-react": "^2.1.0", "@vitejs/plugin-react": "^2.1.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"typescript": "^4.8.4",
"vite": "^3.1.0" "vite": "^3.1.0"
} }
} }
import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { RootState } from "../store"; import { RootState } from "../store";
export type Player = { export interface Player {
name?: string; name?: string;
state?: string; state?: string;
isHost?: boolean; isHost?: boolean;
}; }
export interface playerState { export interface playerState {
player0: Player; player0: Player;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment