Skip to content

feat: enforce machine-checkable frontend pattern rules in lint#27409

Closed
ibetitsmike wants to merge 1 commit into
mike/frontend-review-skillfrom
mike/frontend-pattern-checks
Closed

feat: enforce machine-checkable frontend pattern rules in lint#27409
ibetitsmike wants to merge 1 commit into
mike/frontend-review-skillfrom
mike/frontend-pattern-checks

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What

Adds site/scripts/check-frontend-patterns.mjs, a deterministic checker for the text-detectable subset of the FE rule contract, wired into pnpm lint as lint:patterns (so the existing CI lint job enforces it with no workflow changes):

  • FE10/no-queryselector-in-stories: querySelector in *.stories.tsx (baseline: 98 occurrences in 22 files)
  • FE10/no-class-substring-selectors: [class*=]-style selectors in stories/tests (baseline: 1)
  • FE7/no-retyped-query-keys: string-literal query keys in stories/tests that re-type a key constant defined in api/queries/ (baseline: 72 in 15 files)
  • FE7/no-empty-catch: empty catch blocks (baseline: 0, fully enforced)

Existing violations are recorded in frontend-patterns-baseline.json as a ratchet: new violations fail CI, and fixing violations requires node scripts/check-frontend-patterns.mjs --update so counts only go down.

Why

These four patterns are recurring review complaints (the re-typed query key check mirrors feedback on #27385) and are reliably detectable with text matching, so there is no reason to spend reviewer attention on them. The semantic rules stay with the frontend-review skill; this only automates the mechanical subset.

Both ratchet directions are tested: adding a violation fails with file:line output, and dropping below the baseline prompts a ratchet update.

Stacked on #27407 and #27408.

This PR was written by Mux, an AI coding agent, on behalf of Mike.

@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from adbeac5 to 7a71e72 Compare July 22, 2026 09:21
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-review-skill branch from 0f8489b to 96d9ed2 Compare July 22, 2026 09:21
@ibetitsmike ibetitsmike changed the title feat(site): enforce machine-checkable frontend pattern rules in lint feat: enforce machine-checkable frontend pattern rules in lint Jul 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: adbeac5e0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/check-frontend-patterns.mjs Outdated
Comment thread site/scripts/check-frontend-patterns.mjs Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-review-skill branch from 96d9ed2 to a166ce3 Compare July 22, 2026 09:26
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch 3 times, most recently from e890b3f to df056cb Compare July 22, 2026 11:11
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-review-skill branch from a166ce3 to 759a612 Compare July 22, 2026 11:11
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df056cb3ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/check-frontend-patterns.mjs Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-review-skill branch from 759a612 to 0e80cef Compare July 22, 2026 11:18
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from df056cb to ebbc3f4 Compare July 22, 2026 11:18
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebbc3f4faf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/check-frontend-patterns.mjs Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from ebbc3f4 to 4cdea6a Compare July 22, 2026 11:28
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4cdea6ac9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/check-frontend-patterns.mjs Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from 4cdea6a to 09590ad Compare July 22, 2026 11:35
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09590ada56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/check-frontend-patterns.mjs Outdated
Comment thread site/scripts/check-frontend-patterns.mjs
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from 09590ad to 101a890 Compare July 22, 2026 11:43
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 101a890e80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/check-frontend-patterns.mjs Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from 101a890 to 3fa30c4 Compare July 22, 2026 11:49
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3fa30c4fdb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/check-frontend-patterns.mjs Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from 3fa30c4 to 3f30db9 Compare July 22, 2026 11:57
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f30db9004

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/scripts/frontend-patterns-baseline.json Outdated
Comment thread site/scripts/check-frontend-patterns.mjs
Comment thread site/scripts/check-frontend-patterns.mjs Outdated
Adds scripts/check-frontend-patterns.mjs, a deterministic checker for
the text-detectable subset of the FE rule contract: querySelector in
stories (FE10), class-attribute selectors in tests (FE10), re-typed
query key literals (FE7), and empty catch blocks (FE7). Existing
violations are recorded in a ratchet baseline so only new violations
fail; fixes ratchet the baseline down via --update. Wired into pnpm
lint as lint:patterns.
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-pattern-checks branch from 3f30db9 to 762d3e5 Compare July 22, 2026 12:09
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Closing this approach: the deterministic checks will be replaced with proper linting instead of a standalone ratchet script.

Comment from Mux, an AI coding agent, on behalf of Mike.

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant