Add yarn format to autoformat code

Uses Prettier under the hood. Requires opt-in via `@prettier` pragma:
https://prettier.io/docs/en/options.html#require-pragma
This commit is contained in:
Daniel Gasienica 2018-04-13 16:01:46 -04:00
parent 56a5006392
commit 347fc8287a

View file

@ -43,6 +43,7 @@
"jshint": "yarn grunt jshint", "jshint": "yarn grunt jshint",
"lint": "yarn eslint && yarn grunt lint && yarn tslint", "lint": "yarn eslint && yarn grunt lint && yarn tslint",
"tslint": "tslint --config tslint.json --format stylish --project .", "tslint": "tslint --config tslint.json --format stylish --project .",
"format": "prettier --require-pragma --single-quote --write \"ts/**/*.ts\"",
"transpile": "tsc", "transpile": "tsc",
"clean-transpile": "rimraf ts/**/*.js ts/*.js", "clean-transpile": "rimraf ts/**/*.js ts/*.js",
"open-coverage": "open coverage/lcov-report/index.html", "open-coverage": "open coverage/lcov-report/index.html",