diff --git a/scripts/format b/scripts/format index be1ab8af..c89db70d 100755 --- a/scripts/format +++ b/scripts/format @@ -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" diff --git a/scripts/lint b/scripts/lint index b1e23fc5..b1305746 100755 --- a/scripts/lint +++ b/scripts/lint @@ -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 diff --git a/src/app/.prettierrc b/src/app/.prettierrc index e5197700..9fc3e8ff 100644 --- a/src/app/.prettierrc +++ b/src/app/.prettierrc @@ -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",