Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(prettier): add scripts/prettier-test.sh #384

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
},
"betterScripts": {
"docs": "jsdoc -c jsdoc.json && node ./scripts/jsdoc-inject-dist.js",
"lint": "prettier test/**.js src/**.js --write && eslint ./ && tslint -c tslint.json src/index.d.ts",
"lint": "./scripts/prettier-test.sh && eslint ./ && tslint -c tslint.json src/index.d.ts",
"lint:fix": "prettier test/**.js src/**.js --write",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint:fix should probably also run eslint --fix after prettier... Either directly, or by using prettier-eslint

"changelog": "conventional-changelog -p angular -i ./CHANGELOG.md -s",
"test": "cross-env BABEL_ENV=commonjs mocha",
"test:web": "testem ci",
Expand Down
12 changes: 12 additions & 0 deletions scripts/prettier-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

PRETTIER=./node_modules/.bin/prettier
INPUT_FILES="./src/**.js ./test/**.js"

$PRETTIER $INPUT_FILES --list-different

if [ "$?" != "0" ] ; then
echo "Prettier: this files need to be fixed (use npm run lint:fix)"
exit 1
fi