Add more typescript lints
This commit is contained in:
parent
90b9e22f4d
commit
76030da785
|
@ -1,10 +1,15 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ["./tsconfig.json"],
|
||||
},
|
||||
plugins: ["@typescript-eslint"],
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
"prettier",
|
||||
|
|
|
@ -44,7 +44,7 @@ interface CellProps {
|
|||
onSelectDestination: OnSelectDestination;
|
||||
}
|
||||
|
||||
type FileState = {
|
||||
export type FileState = {
|
||||
[key in RANK]?: PieceState;
|
||||
};
|
||||
|
||||
|
@ -118,10 +118,10 @@ const Cell = ({
|
|||
|
||||
const classNames =
|
||||
selected !== null &&
|
||||
selected.piece.kind === piece.kind &&
|
||||
selected.piece.color === piece.color &&
|
||||
selected.location.file === file &&
|
||||
selected.location.rank === rank
|
||||
selected.piece.kind === piece.kind &&
|
||||
selected.piece.color === piece.color &&
|
||||
selected.location.file === file &&
|
||||
selected.location.rank === rank
|
||||
? ["icon-cell", "selected"]
|
||||
: ["icon-cell"];
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import { ReportHandler } from "web-vitals";
|
|||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
void import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
|
|
|
@ -27,7 +27,7 @@ const validateBoardState = (input: unknown): BoardState | null => {
|
|||
return true;
|
||||
}
|
||||
|
||||
return Object.entries(ranks).some(([rank, pieces]) => {
|
||||
return Object.entries(ranks as { [s: string]: unknown; }).some(([rank, pieces]) => {
|
||||
if (typeof rank !== "string") {
|
||||
console.error("rank is not a string");
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue