Skip to content

Created Lint check CI action#36

Open
Adithyan-Dinesh-Trenser wants to merge 1 commit into
nightlyfrom
gradienthealth/create-lint-check-ci-action
Open

Created Lint check CI action#36
Adithyan-Dinesh-Trenser wants to merge 1 commit into
nightlyfrom
gradienthealth/create-lint-check-ci-action

Conversation

@Adithyan-Dinesh-Trenser

Copy link
Copy Markdown

Add ESLint CI Lint Check

Introduces a GitHub Actions workflow that runs ESLint on every push and PR, scoped to only the lines changed in each push — so existing lint debt doesn't block new work.

What's included

.github/workflows/lint.yml

  • Triggers on all branch pushes and on PRs targeting nightly / production
  • Uses eslint-plugin-diff to lint only changed lines (not the entire codebase)
  • Handles edge cases: new branches, force pushes, and rebases by falling back to HEAD~1 when the before commit is unavailable
  • Installs lint dependencies directly via npm install --no-save (no package.json changes required)
  • Deduplicates @typescript-eslint plugin to avoid conflicts with eslint-config-react-app

.eslintrc.json

  • Copied from Viewer
  • Base ESLint config shared between local development and CI
  • Extends react-app, eslint:recommended, @typescript-eslint/recommended, and prettier
  • Enforces curly (brace style) as an error; disables import/no-anonymous-default-export
  • Registers Cypress globals to suppress false positives in test files

Test plan

  • Push a branch with a lint error on a changed line — workflow should fail
  • Push a branch with clean changes — workflow should pass
  • Open a PR to nightly or production — lint runs against the PR base SHA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant