Skip to content

Commit

Permalink
chore: Add Code Linting to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ITenthusiasm committed Jan 3, 2024
1 parent ebfa731 commit 729e62b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Linter
on:
push:
branches: ["**"]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"
- name: "Install Dependencies"
run: npm ci
- name: "Check Formatting"
id: prettier
run: npx prettier --ignore-path .gitignore --check .
continue-on-error: true
- name: "Run ESLint"
id: eslint
run: npx eslint --ignore-path .gitignore .
continue-on-error: true
- name: "Validate TypeScript Types"
id: ts
run: npx tsc --noEmit
continue-on-error: true
- name: "Bail If Checks Failed"
if: steps.prettier.outcome != 'success' || steps.eslint.outcome != 'success' || steps.ts.outcome != 'success'
run: |
echo "One or more code quality checks failed. Exiting with code 1..."
exit 1

0 comments on commit 729e62b

Please sign in to comment.