From 70ae05a4d9b946b2addfda0758f13547c8df44c6 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Thu, 11 Nov 2021 23:03:03 -0500 Subject: [PATCH] Use `npm-run-all` to run `test` and `lint` scripts (#1604) --- .github/workflows/main.yml | 2 +- package.json | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a614a39000..4f34c6fc57 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: with: node-version: 16 - run: npm install - - run: npx xo + - run: npm run lint # Force update snapshots, https://github.com/avajs/ava/discussions/2754 - run: npx nyc ava --update-snapshots env: diff --git a/package.json b/package.json index 9508dcb53a..7020db5935 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,14 @@ "node": ">=12" }, "scripts": { - "test": "xo && nyc ava && markdownlint '**/*.md'", + "fix": "run-p --continue-on-error fix:*", + "fix:js": "npm run lint:js -- --fix", + "fix:md": "npm run lint:md -- --fix", + "lint": "run-p --continue-on-error lint:*", + "lint:js": "xo", + "lint:md": "markdownlint \"**/*.md\"", + "test": "npm-run-all --continue-on-error lint test:*", + "test:js": "nyc ava", "create-rule": "node ./scripts/create-rule.mjs && npm run generate-rules-table && npm run generate-usage-example", "run-rules-on-codebase": "node ./test/run-rules-on-codebase/lint.mjs", "integration": "node ./test/integration/test.mjs", @@ -73,6 +80,7 @@ "lodash-es": "4.17.21", "markdownlint-cli": "^0.29.0", "mem": "^9.0.1", + "npm-run-all": "^4.1.5", "nyc": "^15.1.0", "outdent": "^0.8.0", "typescript": "^4.4.2",