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