Skip to content

Commit

Permalink
Add prettier to lint and format scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Nov 11, 2022
1 parent 497b3d1 commit e18b2ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [ "${1:-}" = "--help" ]; then
usage
else
# Format JavaScript app
docker-compose \
run --rm --no-TTY --entrypoint yarn app \
prettier --loglevel warn --write src/

# Format Django app

# Get a list of changed ".py" files and trim "src/django"
Expand Down
3 changes: 3 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
scripts/*

# Lint JavaScript
docker-compose \
run --rm --entrypoint yarn app prettier --check src/

docker-compose \
run --rm --entrypoint ./node_modules/.bin/eslint \
app src/ --ext .js --ext .jsx
Expand Down
10 changes: 9 additions & 1 deletion src/app/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"bracketSameLine": false,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": true,
"overrides": [
{
"files": "*.css",
"options": {
"parser": "css"
}
}
],
"parser": "babel",
"printWidth": 80,
"proseWrap": "always",
Expand Down

0 comments on commit e18b2ba

Please sign in to comment.