Skip to content

Commit

Permalink
Add workflow to lint react-app (#2013)
Browse files Browse the repository at this point in the history
Co-authored-by: Dylan Barkowsky <[email protected]>
Co-authored-by: dbarkowsky <[email protected]>
  • Loading branch information
3 people authored Jan 5, 2024
1 parent dee89ca commit ac629e6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/react-app-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: React App Linting Check

on:
pull_request:
types: [opened, synchronize]
branches: [main]
paths:
- 'react-app/**'
- '.github/workflows/react-app-lint.yml'
workflow_dispatch:

jobs:
lint-api:
name: Lint React App
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
# Could optimize this by only installing necessary dependencies
- name: Install Dependencies
working-directory: ./react-app
run: npm i --only=dev

- name: Run ESLint
working-directory: ./react-app
run: npm run lint

- name: Run Prettier
working-directory: ./react-app
run: npm run check
1 change: 1 addition & 0 deletions react-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off', // ie. {}
'@typescript-eslint/no-non-null-assertion': 'off', // Allow use of non-null assertion operator (!).
'@typescript-eslint/no-explicit-any': 'off', // Warn if 'any' type is used.
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/ban-types': [
'error',
{
Expand Down

0 comments on commit ac629e6

Please sign in to comment.