mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-08-12 18:24:18 -07:00
Adding Linting and Formatting (#77)
Addresses #11 item "Linting/formatting (eg eslnt, prettier)": * Adding eslint, prettier, and config targeting Google, typescript, and both nodejs and client builds * Addressing linter-found issues * Adding lint and lint:fix commands * Adding documentation * Renaming workflow and adding lint check * Adding documentation about VSCode linting/formatting, ran formatting on a few files, set up exclude list for gatsby develop, setup build to fail on error
This commit is contained in:
parent
16a9e67db0
commit
a432a0d8c9
16 changed files with 310 additions and 208 deletions
|
@ -1,5 +1,25 @@
|
|||
# Justice40 Client
|
||||
|
||||
## Linting and Formatting
|
||||
|
||||
This project uses [ESLint](https://eslint.org/) for code linting and [Prettier](https://prettier.io/) for formatting. They are integrated via [gatsby-plugin-prettier-eslint](https://www.gatsbyjs.com/plugins/gatsby-plugin-prettier-eslint/).
|
||||
|
||||
Linting is a required check before merges can happen, please lint your code, for the sake of consistency!
|
||||
|
||||
To use:
|
||||
|
||||
1. During development:
|
||||
|
||||
1. `npx gatsby develop` will automatically run prettier and eslint during development as files change, watch the console for updates.
|
||||
2. Alternatively, if you're using VSCode:
|
||||
1. Install the [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) plugins
|
||||
2. Enable `editor.formatOnSave`, and optionally `"editor.codeActionsOnSave": {"source.fixAll": true},` to apply settings on save
|
||||
|
||||
2. Before a PR: `npm run lint:fix` can be run locally to apply auto-fixes to issues that can be fixed
|
||||
3. Before merge (automatic): `npm run lint` is run against all PRs by a github action.
|
||||
|
||||
The ruleset is simply the base ruleset + [Google](https://github.com/google/eslint-config-google).
|
||||
|
||||
## Localization
|
||||
|
||||
### About
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue