chore(ci): add JS & TS linter check (#3394)
This commit is contained in:
parent
472820123a
commit
4d9334b477
62
.github/workflows/check-js.yml
vendored
Normal file
62
.github/workflows/check-js.yml
vendored
Normal file
@ -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
|
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@ -1,13 +0,0 @@
|
||||
name: ci
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
- run: yarn --no-lockfile
|
||||
- run: yarn lint
|
@ -16,6 +16,7 @@
|
||||
"@types/react": "~18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jamesacarr/eslint-formatter-github-actions": "^0.2.0",
|
||||
"@react-native/eslint-config": "^0.72.2",
|
||||
"@release-it/conventional-changelog": "^7.0.2",
|
||||
"@types/jest": "^28.1.2",
|
||||
|
Loading…
Reference in New Issue
Block a user