Specify specific prettier version (#186)

* Add explicit prettier version

* Update CONTRIBUTING.md

* Add .prettierrc.json file to ensure we always use es5 trailing commas
This commit is contained in:
Chris Weaver 2023-07-16 12:52:28 -07:00 committed by GitHub
parent 4b699fdab3
commit 9252807a51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -154,8 +154,8 @@ creating a pull requests with `python -m mypy .` from the `danswer/backend` dire
#### Web
We use `prettier` for formatting. Follow the guide [here](https://prettier.io/docs/en/install.html) to install, and run
`npx prettier --write --trailing-comma es5 .` from the `danswer/web` directory to automatically format.
We use `prettier` for formatting. The desired version (2.8.8) will be installed via a `npm i` from the `danswer/web` directory.
To run the formatter, use `npx prettier --write .` from the `danswer/web` directory.
Like `mypy`, we have no automated formatting yet (coming soon), but we request that, for now,
you run this manually before creating a pull request.

3
web/.prettierrc.json Normal file
View File

@ -0,0 +1,3 @@
{
"trailingComma": "es5"
}

View File

@ -30,5 +30,8 @@
"tailwindcss": "^3.3.1",
"typescript": "5.0.3",
"yup": "^1.1.1"
},
"devDependencies": {
"prettier": "2.8.8"
}
}