diff --git a/Makefile b/Makefile index 8ad5c8d881..495549741c 100644 --- a/Makefile +++ b/Makefile @@ -524,6 +524,7 @@ jshint: $(UI_DEPS_FLAG_FILE) ui-next-lint: $(NPM_BIN) --prefix awx/ui_next install $(NPM_BIN) run --prefix awx/ui_next lint + $(NPM_BIN) run --prefix awx/ui_next prettier-check ui-next-test: $(NPM_BIN) --prefix awx/ui_next install diff --git a/awx/ui_next/CONTRIBUTING.md b/awx/ui_next/CONTRIBUTING.md index b9c39d9791..b1bf60cf69 100644 --- a/awx/ui_next/CONTRIBUTING.md +++ b/awx/ui_next/CONTRIBUTING.md @@ -29,6 +29,7 @@ Have questions about this document or anything not covered here? Feel free to re - All code submissions are done through pull requests against the `devel` branch. - If collaborating with someone else on the same branch, please use `--force-with-lease` instead of `--force` when pushing up code. This will prevent you from accidentally overwriting commits pushed by someone else. For more information, see https://git-scm.com/docs/git-push#git-push---force-with-leaseltrefnamegt +- We use a [code formatter](https://prettier.io/). Before adding a new commit or opening a PR, please apply the formatter using `npm run prettier` ## Setting up your development environment diff --git a/awx/ui_next/package.json b/awx/ui_next/package.json index 5ed872d98f..aab41746ae 100644 --- a/awx/ui_next/package.json +++ b/awx/ui_next/package.json @@ -11,7 +11,8 @@ "add-locale": "lingui add-locale", "extract-strings": "lingui extract", "compile-strings": "lingui compile", - "prettier": "prettier --write \"src/**/*.{js,jsx,scss}\"" + "prettier": "prettier --write \"src/**/*.{js,jsx,scss}\"", + "prettier-check": "prettier --check \"src/**/*.{js,jsx,scss}\"" }, "keywords": [], "author": "",