From 6bc40ed08005394d73679383a25215f84032b096 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Thu, 7 Jul 2022 10:14:45 +0100 Subject: [PATCH] chore: Run prettier --- .eslintrc.js | 39 ++++++++++++++++++--------------------- src/App.tsx | 5 +---- src/components/Board.tsx | 11 ++--------- src/utils/board.ts | 11 ++--------- vite.config.ts | 4 ++-- 5 files changed, 25 insertions(+), 45 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6c71b13..841313f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,27 +1,24 @@ module.exports = { - "env": { - "browser": true, - "es2021": true + env: { + browser: true, + es2021: true, }, - "extends": [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:@typescript-eslint/recommended", - "plugin:react/jsx-runtime", + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react/jsx-runtime', ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaFeatures": { - "jsx": true, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaFeatures: { + jsx: true, }, - "ecmaVersion": "latest", - "sourceType": "module", + ecmaVersion: 'latest', + sourceType: 'module', }, - "plugins": [ - "react", - "@typescript-eslint", - ], - "rules": { - "@typescript-eslint/no-non-null-assertion": "off", + plugins: ['react', '@typescript-eslint'], + rules: { + '@typescript-eslint/no-non-null-assertion': 'off', }, -} +}; diff --git a/src/App.tsx b/src/App.tsx index c56e46c..519b63e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,9 +1,6 @@ import './App.css'; import Board from './components/Board'; -import { - parseFEN, - START_FEN, -} from './utils/board'; +import { parseFEN, START_FEN } from './utils/board'; function App() { const startState = parseFEN(START_FEN); diff --git a/src/components/Board.tsx b/src/components/Board.tsx index fd623d8..d40cced 100644 --- a/src/components/Board.tsx +++ b/src/components/Board.tsx @@ -1,11 +1,6 @@ import { FC, Fragment, useCallback, useMemo, useState } from 'react'; import { encodeFEN, eq, GameState, isChecked } from '../utils/board'; -import { - filterMoves, - generateLegalMoves, - makeMove, - Move, -} from '../utils/move'; +import { filterMoves, generateLegalMoves, makeMove, Move } from '../utils/move'; import { getType, otherSide } from '../utils/piece'; import styles from './Board.module.css'; import Piece from './Piece'; @@ -44,9 +39,7 @@ const Board: FC = (props) => { const [enPassantTarget, setEnPassantTarget] = useState( props.state.enPassantTarget ); - const [halfmoveClock] = useState( - props.state.halfmoveClock - ); + const [halfmoveClock] = useState(props.state.halfmoveClock); const [fullmoveNumber, setFullmoveNumber] = useState( props.state.fullmoveNumber ); diff --git a/src/utils/board.ts b/src/utils/board.ts index 9499daa..2596e1c 100644 --- a/src/utils/board.ts +++ b/src/utils/board.ts @@ -1,12 +1,5 @@ -import { - generatePseudolegalMoves, -} from './move'; -import { - BoardPiece, - pieceFromChar, - Side, - toAlgebraicChar, -} from './piece'; +import { generatePseudolegalMoves } from './move'; +import { BoardPiece, pieceFromChar, Side, toAlgebraicChar } from './piece'; export interface Coordinate { rank: number; diff --git a/vite.config.ts b/vite.config.ts index 2dee0fd..e4984bf 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,6 +8,6 @@ export default defineConfig({ server: { hmr: { clientPort: parseInt(process.env.CLIENT_PORT || '3000'), - } - } + }, + }, });