update eslint configs
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
"extends": ["eslint:recommended", "next/core-web-vitals", "prettier"],
|
||||
"settings": {
|
||||
"next": {
|
||||
"rootDir": "client/"
|
||||
"rootDir": "."
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": true
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"daisyui": "^2.52.0",
|
||||
"eslint-config-next": "^13.4.12",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"typescript": "^5.1.6"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
"devDependencies": {
|
||||
"concurrently": "^8.2.0",
|
||||
"eslint": "^8.45.0",
|
||||
"eslint-config-next": "^13.4.12",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-tailwindcss": "^0.4.1"
|
||||
|
||||
11
server/.eslintrc
Normal file
11
server/.eslintrc
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/stylistic",
|
||||
"prettier"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"root": true
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Game, User } from "@chessu/types";
|
||||
import { db } from "../index.js";
|
||||
|
||||
export const activeGames: Array<Game> = [];
|
||||
export const activeGames: Game[] = [];
|
||||
|
||||
export const save = async (game: Game) => {
|
||||
try {
|
||||
|
||||
@@ -44,7 +44,7 @@ export const findByNameEmail = async (user: User, includePassword = false, limit
|
||||
`SELECT id, name, email, wins, losses, draws FROM "user" LIMIT $1`,
|
||||
[limit ?? 10]
|
||||
);
|
||||
return res.rows as Array<User & { password?: string }>;
|
||||
return res.rows as (User & { password?: string })[];
|
||||
} catch (err: unknown) {
|
||||
console.log(err);
|
||||
return null;
|
||||
@@ -58,7 +58,7 @@ export const findByNameEmail = async (user: User, includePassword = false, limit
|
||||
} FROM "user" WHERE name=$1 OR email=$2 LIMIT $3`,
|
||||
[user.name, user.email, limit ?? 1]
|
||||
);
|
||||
return res.rows as Array<User & { password?: string }>;
|
||||
return res.rows as (User & { password?: string })[];
|
||||
} catch (err: unknown) {
|
||||
console.log(err);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user