npm install -g yarn
yarn install --frozen-lockfile
yarn start
Browse to http://localhost:8080/ to view your app.
The application will automatically reload on file change. Note this is a full reload, not a hot module replacement.
This project has a lint config which tries to avoid writing bugs combined with a config which ensures consistent code style. Running yarn lint
which automatically reformat your code and fix some lint errors.
# Run linter with autofix
yarn lint
The linter is Eslint with the configuration of create-react-app
. Prettier is integrated in eslint
to automatically provide a consistent code style.
By default yarn test
will only run the tests related to changed files. Press a
to run all tests or press enter
to rerun the tests. Read the tools "usage" output to see other run options.
# Starts test runner in watch mode
yarn test
The test runner is Jest which provides support for test coverage reporting, mocks and snapshot testing.
Consider this code as inherited code from previous developers. This means you can't make any assumptions on the fitness of the code. It might be incorrect, unmaintainable, untestable, incomplete or just plain bad. Feel free to improve some or all of it.
This folder contains a Battleship game implemented in vanilla JavaScript with a React interface. A basic Webpack with Babel configuration is used instead of a more complex approach. Importing CSS in JavaScript is supported and exposed as global CSS. Currently the application does not have much CSS.
BattleJSip by Xpirit Netherlands BV is licensed under CC BY-SA 4.0