diff --git a/.github/workflows/format-and-lint.yml b/.github/workflows/format-and-lint.yml new file mode 100644 index 0000000..ce67376 --- /dev/null +++ b/.github/workflows/format-and-lint.yml @@ -0,0 +1,23 @@ +name: Format and lint + +on: + workflow_dispatch: + pull_request: + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: "install and check format" + run: | + npm install + npm run format:check + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: "install and lint" + run: | + npm install + npm run lint diff --git a/.prettierignore b/.prettierignore index bed904a..23a8cb5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,8 @@ test/data coverage dist +scripts/ **/*.md **/*.txt +**/*.sh +**/*.yml diff --git a/package.json b/package.json index e7c5c9d..f513994 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "build": "tsc -p tsconfig.build.json", "lint": "eslint '**/*.{ts,js}'", "fix": "eslint --fix '**/*.{ts,js}'", - "format": "prettier -w **", - "format:check": "prettier -c **", + "format": "prettier -w .", + "format:check": "prettier -c .", "test": "jest", "test:watch": "jest --watch", "coverage": "jest --coverage",