Skip to content

Commit

Permalink
Move prettier config to .prettierrc
Browse files Browse the repository at this point in the history
Also fix prettier.sh to work when spaces are in path of prettier.
  • Loading branch information
Macil committed Jun 8, 2019
1 parent 75198fb commit 793474c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -14,3 +14,4 @@ test
changelog.md
tmp
.babelrc
.prettierrc
7 changes: 7 additions & 0 deletions .prettierrc
@@ -0,0 +1,7 @@
{
"semi": false,
"bracketSpacing": false,
"printWidth": 120,
"singleQuote": true,
"trailingComma": "es5"
}
6 changes: 3 additions & 3 deletions configs/prettier.sh
@@ -1,11 +1,11 @@
#!/bin/bash

PRETTIER="`npm bin`/prettier --no-semi --no-bracket-spacing --print-width 120 --single-quote --trailing-comma es5"
PRETTIER="`npm bin`/prettier"

if [ "$1" == "check" ]; then
echo "Running prettier check. Files that should be formatted (shouldn't be any):"
$PRETTIER --list-different '{src,configs,test}/**/*.js' '*.js'
"$PRETTIER" --list-different '{src,configs,test}/**/*.js' '*.js'
else
echo "Running prettier formatter on files:"
$PRETTIER --write '{src,configs,test}/**/*.js' '*.js'
"$PRETTIER" --write '{src,configs,test}/**/*.js' '*.js'
fi

0 comments on commit 793474c

Please sign in to comment.