diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7398cb2..97bf123 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,4 +15,5 @@ jobs: key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}} restore-keys: ${{runner.os}}-npm- - run: npm ci + - run: npm run style:check - run: npm test diff --git a/docs/development.md b/docs/development.md index 34af86f..68352e8 100644 --- a/docs/development.md +++ b/docs/development.md @@ -15,7 +15,8 @@ bash> npm run build It also has a pre-commit hook configured via [husky](https://www.npmjs.com/package/husky) that should run the build script -before each commit. +before each commit. Additionally, this hook formats code and lints it, as +well. ## Releasing diff --git a/package.json b/package.json index ab2f137..ee98908 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,12 @@ "private": true, "scripts": { "build": "ncc build src/main.ts", - "format": "prettier --write src __test__", + "format:check": "prettier --check src __test__", + "format:write": "prettier --write src __test__", "lint": "eslint src __test__", - "check": "run-p --continue-on-error --aggregate-output format lint", - "pre-commit": "run-s check test build", + "style:check": "run-p --continue-on-error --aggregate-output format:check lint", + "style:write": "run-p --continue-on-error --aggregate-output format:write lint", + "pre-commit": "run-s style:write test build", "test": "jest" }, "husky": {