Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

jonahsnider/aoc-2019

Repository files navigation

Advent of Code 2019

Build Status XO code style codecov

My solutions for the Advent of Code 2019 event.

Project structure

Solutions are in the src folder. Day 1 will be in the src/1 folder, day 2 in the src/2 folder and so on. The index.ts folder has the actual solution functions in it which are called by the solve.ts file. Some solution folders may also have a performance.js file, which is derived from the index.ts file. This is a really ugly but more performant version of the solution.

Prequisites

This project uses Node.js 12 to run.

This project uses Yarn to install dependencies, although you can use another package manager like npm or pnpm.

yarn install
# or `npm install`
# or `pnpm install`

Building

Run the build script to compile the TypeScript into the tsc_output folder. This will compile the src and the test directory, so be careful not to upload the whole folder as a published package.

Style

This project uses Prettier and XO.

You can run Prettier in the project with this command:

yarn run style

You can run XO with this command:

yarn run lint

Note that XO will also error if you have TypeScript errors, not just if your formatting is incorrect.

Linting

This project uses XO (which uses ESLint and some plugins internally) to perform static analysis on the TypeScript. It reports things like unused variables or not following code conventions.

yarn run lint

Note that XO will also error if you have incorrect formatting, not just if your TypeScript code has errors.

Testing

Unit tests are in the test folder. You can run the tests with the test script:

yarn run test

Coverage

This will generate a coverage folder which has a breakdown of coverage of the project. The CI will upload the coverage information to CodeCov which can be viewed here.