Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to lint react-app #2013

Merged
merged 6 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always assumed this worked, but now I see this output:
image

Doesn't hurt to have it in, but maybe it's not doing what we thought.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some searching it seems like this flag stopped working in 2020, any updated command seems to not replicate what this did.


- 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