From 442519aa60aafe4b9bf0b812b3eceac2f5779a07 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sat, 11 Dec 2021 23:13:36 -0600 Subject: [PATCH 1/3] Check Prettier formatting in CI pipeline Replace precommit hook with a check in GitHub Actions. --- .github/workflows/tests.yml | 1 + package.json | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0321d3f..97cbb09 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,6 +33,7 @@ jobs: - run: npm install - run: npm run lint + - run: npx prettier --check . - run: npm run build - run: npm run test - run: npx testpack-cli --keep=@types/*,ts-jest,typescript jest.config.js tsconfig.json src/e2e.spec.ts src/tsconfig.test.json diff --git a/package.json b/package.json index fde03f2..47564bc 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "build:demo": "wp --config demo/webpack.config.js", "format": "prettier --write '{src,demo/src}/**'", "lint": "tsc -b ./tsconfig.lint.json && eslint . --report-unused-disable-directives", - "precommit": "pretty-quick --staged", "release": "npx release-it", "test": "jest --coverage" }, @@ -54,13 +53,11 @@ "eslint-import-resolver-typescript": "^2.4.0", "eslint-plugin-import": "^2.25.3", "eslint-plugin-jest": "^25.2.1", - "husky": "7.0.4", "jest": "^27.0.1", "jest-when": "^3.2.1", "node-sass": "^7.0.0", "npm-run-all": "^4.1.5", "prettier": "2.2.1", - "pretty-quick": "3.1.2", "sass-loader": "^12.0.0", "style-loader": "^3.0.0", "ts-jest": "^27.0.1", From 2e57420d027d3d646cd6bd30b63b57f67eb548b9 Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sun, 12 Dec 2021 00:21:42 -0600 Subject: [PATCH 2/3] Check Prettier formatting before TypeScript compile Avoid /lib files during Prettier check. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 97cbb09..0b36b84 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,8 +32,8 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - - run: npm run lint - run: npx prettier --check . + - run: npm run lint - run: npm run build - run: npm run test - run: npx testpack-cli --keep=@types/*,ts-jest,typescript jest.config.js tsconfig.json src/e2e.spec.ts src/tsconfig.test.json From 309663592af78695b4bd219a88fcfcea89fa41ff Mon Sep 17 00:00:00 2001 From: Drew Keller Date: Sun, 12 Dec 2021 00:22:41 -0600 Subject: [PATCH 3/3] Reformat demo page with Prettier --- demo/index.html | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/demo/index.html b/demo/index.html index 25724c9..1650b48 100644 --- a/demo/index.html +++ b/demo/index.html @@ -25,7 +25,7 @@