-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add JS & TS linter check (#3394)
- Loading branch information
1 parent
4728201
commit 4d9334b
Showing
3 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Check JS | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- '.github/workflows/check-js.yml' | ||
- 'src/**' | ||
- '*.json' | ||
- '*.js' | ||
- '*.jsx' | ||
- '*.ts' | ||
- '*.tsx' | ||
- '*.lock' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/check-js.yml' | ||
- 'src/**' | ||
- '*.json' | ||
- '*.js' | ||
- '*.jsx' | ||
- '*.ts' | ||
- '*.tsx' | ||
- '*.lock' | ||
|
||
jobs: | ||
TypeScript-Check: | ||
name: Check TS (tsc) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install node_modules | ||
uses: ./.github/actions/setup-node | ||
|
||
- name: Install reviewdog | ||
uses: reviewdog/action-setup@v1 | ||
|
||
- name: Check TypeScript | ||
run: | | ||
yarn tsc | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
JS-Lint: | ||
name: Lint JS (eslint, prettier) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install node_modules | ||
uses: ./.github/actions/setup-node | ||
|
||
- name: Run ESLint | ||
run: yarn lint -f @jamesacarr/github-actions | ||
|
||
- name: Run ESLint with auto-fix | ||
run: yarn lint --fix | ||
|
||
- name: Verify no files have changed after auto-fix | ||
run: git diff --exit-code HEAD |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters