Skip to content

Dependencies

Daniel Mundra edited this page Jan 6, 2022 · 2 revisions

Node

You need the latest version of Node and NPM installed. There are multiple ways to download NPM but recommendations are to use NPM.

Install

Clone the GitHub repository and cd into that directory.

git clone https://github.com/GSA/openacr.git
cd openacr

Then install the dependencies with the following NPM command:

npm install

Source code management

Linting

We use prettier and eslint to keep the code clean and matching common standards for typescript and javascript. The configurations are located in:

  • .eslintignore
  • .eslingrc
  • .prettierignore
  • .prettierrc.json

Caveat: since we are creating a new JSON scheme the typescript code does use 'any' for various function arguments.

pre-commit

We use pre-commit to run some checks and cleanup when you make a commit:

  • Remove trailing whitespace.
  • Fix end of file.
  • Adjust mixed line endings.
  • Remove byte order marker.
  • Check and fix YAML/JSON files.
  • Check for any large files.
  • Replace smart quotes with regular ones.
  • Run prettier.

Pre-commit is also run on pull requests and will add a commit with any changes automatically. To set it up locally install pre-commit and then run the following command in the repo folder:

pre-commit install

The configurations for pre-commit are located in the files:

  • .pre-commit-config.yaml
  • .pre-commit-search-and-replace.yaml