diff --git a/package.json b/package.json index 6dfc9d2a..9da64e8a 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "jest-serializer-vue": "^2.0.2", "node-sass": "^4.9.2", "parcel-bundler": "^1.10.3", + "prettier": "^1.16.1", "vue-template-compiler": "2.5.15" }, "browserslist": [ diff --git a/prettier.config.json b/prettier.config.json new file mode 100644 index 00000000..5149b1b7 --- /dev/null +++ b/prettier.config.json @@ -0,0 +1,5 @@ +{ + "trailingComma": "es5", + "semi": false, + "singleQuote": true +} diff --git a/script/format b/script/format index 1ef619a1..eb6230f3 100755 --- a/script/format +++ b/script/format @@ -4,6 +4,8 @@ FILES_TO_FORMAT="atst/ tests/ app.py script/" if [ "$1" == "check" ]; then pipenv run black --check ${FILES_TO_FORMAT} + yarn run prettier --check "js/**/*.js" --config ./prettier.config.json else pipenv run black ${FILES_TO_FORMAT} + yarn run prettier --write "js/**/*.js" --config ./prettier.config.json fi diff --git a/yarn.lock b/yarn.lock index b4552884..e10607fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6755,6 +6755,11 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +prettier@^1.16.1: + version "1.16.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.1.tgz#534c2c9d7853f8845e5e078384e71973bd74089f" + integrity sha512-XXUITwIkGb3CPJ2hforHah/zTINRyie5006Jd2HKy2qz7snEJXl0KLfsJZW/wst9g6R2rFvqba3VpNYdu1hDcA== + pretty-format@^23.6.0: version "23.6.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760"