Skip to content

Comments

Adds prettier and eslint#138

Merged
lindseywild merged 13 commits intomainfrom
adds-prettier-and-eslint
Feb 20, 2026
Merged

Adds prettier and eslint#138
lindseywild merged 13 commits intomainfrom
adds-prettier-and-eslint

Conversation

@lindseywild
Copy link
Contributor

@lindseywild lindseywild commented Feb 19, 2026

Closes #135.

  • Adds Prettier & ESLint
  • Adds new CI check for linting
  • Updates all current files based on linting / formatting feedback

I've confirmed this still runs on an internal repo.

@lindseywild lindseywild marked this pull request as ready for review February 19, 2026 22:07
@lindseywild lindseywild requested a review from a team as a code owner February 19, 2026 22:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds repository-wide formatting and linting tooling to standardize TypeScript code style across the GitHub Actions codebase and tests, and introduces CI enforcement for lint/format checks.

Changes:

  • Add Prettier + ESLint (flat config) with npm scripts to lint and format TS sources.
  • Add a new CI workflow to run npm run lint and npm run format:check.
  • Apply formatting/lint-driven edits across action sources and tests (plus a small API adjustment to generateIssueBody).

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/site-with-errors.test.ts Prettier-driven formatting updates in tests.
package.json Adds lint/format scripts, devDependencies for Prettier/ESLint, and sets root package to ESM.
package-lock.json Locks newly added lint/format dependencies and their transitive deps.
eslint.config.js Introduces ESLint flat config using typescript-eslint + eslint-config-prettier.
.prettierrc.json Adds Prettier formatting rules (semi, trailing commas, etc.).
.github/workflows/lint.yml New CI workflow to enforce linting and format checks.
.github/actions/fix/src/retry.ts Formatting (comma) update for parameter list.
.github/actions/fix/src/index.ts Formatting updates (trailing commas in multi-line calls).
.github/actions/fix/src/getLinkedPR.ts Formatting updates (trailing commas).
.github/actions/fix/src/assignIssue.ts Formatting updates (trailing commas).
.github/actions/fix/src/Issue.ts Formatting updates for readability and semicolons.
.github/actions/find/src/index.ts Formatting + minor letconst adjustment for findings.
.github/actions/find/src/findForUrl.ts Formatting updates; renames caught error to _e to satisfy linting.
.github/actions/file/tests/generateIssueBody.test.ts Formatting updates (but still calls generateIssueBody with an outdated signature).
.github/actions/file/src/updateFilingsWithNewFindings.ts Formatting (comma) update for parameter list.
.github/actions/file/src/reopenIssue.ts Formatting updates; multi-line request call formatting.
.github/actions/file/src/openIssue.ts Formatting + updates to call generateIssueBody with new signature.
.github/actions/file/src/index.ts Formatting updates; adds an ESLint disable + any cast when attaching issue to a filing.
.github/actions/file/src/generateIssueBody.ts Removes unused repoWithOwner parameter; formatting cleanup.
.github/actions/file/src/closeIssue.ts Formatting updates; multi-line request call formatting.
.github/actions/file/src/Issue.ts Formatting update (trailing comma).
.github/actions/auth/src/index.ts Removes unused imports and reformats reduce logic for localStorage output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 18 to 22
@@ -17,7 +19,9 @@ describe("generateIssueBody", () => {

expect(body).toContain("## What");
expect(body).toContain("## Acceptance Criteria");
expect(body).toContain("The specific axe violation reported in this issue is no longer reproducible.");
expect(body).toContain(
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

generateIssueBody now only accepts a single finding argument, but this test still passes a second repoWithOwner parameter. This makes the test inconsistent with the function’s public API and would fail type-checking if tsc is added later. Update the test calls to pass only the finding object (or reintroduce the second parameter if it’s still intended to be part of the API).

Copilot uses AI. Check for mistakes.
Comment on lines 65 to 66
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(filing as any).issue = { state: "open" } as Issue;
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This bypasses typing with (filing as any) and disables @typescript-eslint/no-explicit-any, which weakens the guarantees around the Filing union (notably NewFiling currently forbids issue). Prefer updating the Filing/NewFiling types (or introducing a post-file “filed” type) so you can assign issue without any and without disabling the rule.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(filing as any).issue = { state: "open" } as Issue;
// Attach an initial Issue placeholder; it will be populated once we have the API response.
(filing as typeof filing & { issue: Issue }).issue = { state: "open" } as Issue;

Copilot uses AI. Check for mistakes.
"@types/node": "^25.2.0",
"eslint": "^10.0.0",
"eslint-config-prettier": "^10.1.8",
"prettier": "^3.8.1",
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

typescript-eslint relies on typescript as a peer dependency, but typescript isn’t declared in this root package.json (it’s only present via the lockfile). To avoid installs depending on npm’s peer-dep behavior and to make the toolchain explicit/reproducible, add typescript to devDependencies here (and keep its version aligned with the workspace/actions as needed).

Suggested change
"prettier": "^3.8.1",
"prettier": "^3.8.1",
"typescript": "^5.7.3",

Copilot uses AI. Check for mistakes.
@smockle
Copy link
Collaborator

smockle commented Feb 20, 2026

I’m going to remove this from the FR queue. If FR support is required, please feel free to re-add it!

.prettierrc.json Outdated
@@ -0,0 +1,6 @@
{
Copy link
Contributor

@JoyceZhu JoyceZhu Feb 20, 2026

Choose a reason for hiding this comment

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

Should we point to our org-level Prettier config instead of configuring options here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, ty for pointing this out!

import tseslint from "typescript-eslint";
import prettierConfig from "eslint-config-prettier";

export default tseslint.config(...tseslint.configs.recommended, prettierConfig, {
Copy link

@abdulahmad307 abdulahmad307 Feb 20, 2026

Choose a reason for hiding this comment

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

do we want to enforce a max limit on lines of code in functions? or is that not something others are comfortable with.
If we do want to enforce it, I think ~25 lines is reasonable. I've worked in teams that enforce 12 but that's a bit extreme.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! I switched to using the default GH Prettier config, so I'd say let's defer to whatever they do there :)

abdulahmad307
abdulahmad307 previously approved these changes Feb 20, 2026
Copy link

@abdulahmad307 abdulahmad307 left a comment

Choose a reason for hiding this comment

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

one question. non blocking.

@lindseywild
Copy link
Contributor Author

@JoyceZhu @abdulahmad307 Updated to use the main GH Prettier config; also confirmed all internal scans are still passing 👍🏻

@lindseywild lindseywild merged commit 95a0df4 into main Feb 20, 2026
6 checks passed
@lindseywild lindseywild deleted the adds-prettier-and-eslint branch February 20, 2026 17:03
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.

Add Prettier & ESLint

4 participants