Skip to content

Commit

Permalink
chore(ci): add JS & TS linter check (#3394)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMoch authored Dec 1, 2023
1 parent 4728201 commit 4d9334b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 13 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/check-js.yml
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
13 changes: 0 additions & 13 deletions .github/workflows/ci.yml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4d9334b

Please sign in to comment.