chore: Run prettier
This commit is contained in:
parent
d5ef78427c
commit
6bc40ed080
5 changed files with 25 additions and 45 deletions
39
.eslintrc.js
39
.eslintrc.js
|
@ -1,27 +1,24 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"env": {
|
env: {
|
||||||
"browser": true,
|
browser: true,
|
||||||
"es2021": true
|
es2021: true,
|
||||||
},
|
},
|
||||||
"extends": [
|
extends: [
|
||||||
"eslint:recommended",
|
'eslint:recommended',
|
||||||
"plugin:react/recommended",
|
'plugin:react/recommended',
|
||||||
"plugin:@typescript-eslint/recommended",
|
'plugin:@typescript-eslint/recommended',
|
||||||
"plugin:react/jsx-runtime",
|
'plugin:react/jsx-runtime',
|
||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
parser: '@typescript-eslint/parser',
|
||||||
"parserOptions": {
|
parserOptions: {
|
||||||
"ecmaFeatures": {
|
ecmaFeatures: {
|
||||||
"jsx": true,
|
jsx: true,
|
||||||
},
|
},
|
||||||
"ecmaVersion": "latest",
|
ecmaVersion: 'latest',
|
||||||
"sourceType": "module",
|
sourceType: 'module',
|
||||||
},
|
},
|
||||||
"plugins": [
|
plugins: ['react', '@typescript-eslint'],
|
||||||
"react",
|
rules: {
|
||||||
"@typescript-eslint",
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import Board from './components/Board';
|
import Board from './components/Board';
|
||||||
import {
|
import { parseFEN, START_FEN } from './utils/board';
|
||||||
parseFEN,
|
|
||||||
START_FEN,
|
|
||||||
} from './utils/board';
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const startState = parseFEN(START_FEN);
|
const startState = parseFEN(START_FEN);
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
import { FC, Fragment, useCallback, useMemo, useState } from 'react';
|
import { FC, Fragment, useCallback, useMemo, useState } from 'react';
|
||||||
import { encodeFEN, eq, GameState, isChecked } from '../utils/board';
|
import { encodeFEN, eq, GameState, isChecked } from '../utils/board';
|
||||||
import {
|
import { filterMoves, generateLegalMoves, makeMove, Move } from '../utils/move';
|
||||||
filterMoves,
|
|
||||||
generateLegalMoves,
|
|
||||||
makeMove,
|
|
||||||
Move,
|
|
||||||
} from '../utils/move';
|
|
||||||
import { getType, otherSide } from '../utils/piece';
|
import { getType, otherSide } from '../utils/piece';
|
||||||
import styles from './Board.module.css';
|
import styles from './Board.module.css';
|
||||||
import Piece from './Piece';
|
import Piece from './Piece';
|
||||||
|
@ -44,9 +39,7 @@ const Board: FC<Props> = (props) => {
|
||||||
const [enPassantTarget, setEnPassantTarget] = useState(
|
const [enPassantTarget, setEnPassantTarget] = useState(
|
||||||
props.state.enPassantTarget
|
props.state.enPassantTarget
|
||||||
);
|
);
|
||||||
const [halfmoveClock] = useState(
|
const [halfmoveClock] = useState(props.state.halfmoveClock);
|
||||||
props.state.halfmoveClock
|
|
||||||
);
|
|
||||||
const [fullmoveNumber, setFullmoveNumber] = useState(
|
const [fullmoveNumber, setFullmoveNumber] = useState(
|
||||||
props.state.fullmoveNumber
|
props.state.fullmoveNumber
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
import {
|
import { generatePseudolegalMoves } from './move';
|
||||||
generatePseudolegalMoves,
|
import { BoardPiece, pieceFromChar, Side, toAlgebraicChar } from './piece';
|
||||||
} from './move';
|
|
||||||
import {
|
|
||||||
BoardPiece,
|
|
||||||
pieceFromChar,
|
|
||||||
Side,
|
|
||||||
toAlgebraicChar,
|
|
||||||
} from './piece';
|
|
||||||
|
|
||||||
export interface Coordinate {
|
export interface Coordinate {
|
||||||
rank: number;
|
rank: number;
|
||||||
|
|
|
@ -8,6 +8,6 @@ export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
hmr: {
|
hmr: {
|
||||||
clientPort: parseInt(process.env.CLIENT_PORT || '3000'),
|
clientPort: parseInt(process.env.CLIENT_PORT || '3000'),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue