Skip to content

build(lint): enable typescript-style linter rules - #41

Merged
furedea merged 4 commits into
mainfrom
build/enable-typescript-style-linters
Nov 14, 2026
Merged

furedea merged 4 commits into
mainfrom
build/enable-typescript-style-linters

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor
  • agent-config の波 2(feat(hooks): migrate TypeScript style rules to ast-grep and jev-lint checks agent-config#195)が挙げた規則のうち,oxlint の 2 規則をこのテンプレートで有効化した.
  • .oxlintrc.json に no-empty と typescript/switch-exhaustiveness-check を追加した.
  • .ls-lint.yml は変更しない(origin/main と同一).ファイル名の語彙の検査は agent-config の ast-grep 規則へ移り,ls-lint はファイル名の形だけを見る.

規則と置き換える文章

文章の場所は agent-config の agents/skills/typescript-style/references/ からの相対パス.

設定ファイル 規則 置き換える文章
.oxlintrc.json no-empty(allowEmptyCatch: false) errors.md「Do not swallow errors with an empty catch」
.oxlintrc.json typescript/switch-exhaustiveness-check(型情報つき.pnpm run typecheck の --type-aware で実行) types.md「Handle a union with an exhaustive switch…」の網羅性(satisfies never の形は文章に残る)

このテンプレートで有効化しない規則

  • ファイル名の語彙(utils / helpers / manager / common / formatter などの禁止)は,このテンプレートの ls-lint では検査しない.ls-lint に否定の構文がなく,長い複合拡張子の奥にある禁止語も検出できないため.agent-config の ast-grep 規則が担う(別の担当が実装する).対応する文章(code_style.md「Name files by the domain or action…」,tooling.md「Avoid utils.ts and helpers.ts」,code_style.md「Avoid manager…」のファイル名の部分)は,その規則が入るまで typescript-style に残る.

違反数(修正前)

規則 違反数
no-empty 0
typescript/switch-exhaustiveness-check 0

検証

  • 一時ファイルで,空の catch {} と網羅していない switch を各規則が検出することを確認した.一時ファイルはリポジトリに含めていない.
  • pnpm run format:check,pnpm run lint,pnpm run typecheck,pnpm run test が成功した.git diff origin/main は .oxlintrc.json だけで,.ls-lint.yml(生成した正規表現,.test / .spec のキー,禁止語の副拡張子のキー)の変更は残っていない.

Refs furedea/agent-config#74

🤖 Generated with Claude Code

Enable oxlint no-empty and typescript/switch-exhaustiveness-check.

Make ls-lint reject utils, helpers, manager, common and formatter tokens
in .ts and .tsx file names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T11:41:38.245552Z fb0c2b6 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread .ls-lint.yml Resolved
@github-actions

Copy link
Copy Markdown

Review summary (read-only)

  • No blocking findings (P0/P1).
  • oxlint: no-empty with allowEmptyCatch: false and typescript/switch-exhaustiveness-check are set up correctly. The second rule is type-aware, so it only runs through the --type-aware typecheck script.
  • ls-lint regex: I traced the generated complement pattern by hand. Within a single token it correctly rejects exactly utils/util/helpers/helper/manager/common/formatter, and still allows prefixes and longer words (uti, utilities, commonly, helperx).
  • P2 (inline): a name that puts the banned word in a dot-separated part (string.utils.ts, date.helpers.ts) gets the extension .utils.ts. That falls through to the permissive .* rule, so the .-split check described in the comment isn't actually enforced. The same applies to unlisted sub-extensions such as .d.ts and .config.ts.

🤖 Generated with Claude Code

@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: af9138362e

ℹ️ 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 .ls-lint.yml Resolved
Reject forbidden words used as a sub-extension (string.utils.ts) and
accept a leading underscore (_internal.ts) in .ts and .tsx file names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary: no blocking findings.

  • .oxlintrc.json: no-empty with allowEmptyCatch: false and typescript/switch-exhaustiveness-check are configured correctly. The second rule needs type information, so it only runs through the --type-aware path in pnpm run typecheck, as the PR description says.
  • .ls-lint.yml: I traced the generated complement regex by hand for the forbidden whole tokens (util/utils/helper/helpers/manager/common/formatter), for prefixes (c, comm, helpe), and for longer words (utilities, commonly, managers). It rejects and accepts the right names. It is no looser than the previous .* rule (still lowercase [a-z0-9] tokens joined by ./_, with no empty tokens). I could not run the regex in this environment.

No inline comments were posted.

@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: 498a2ace15

ℹ️ 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 .ls-lint.yml Resolved
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary: I found no blocking issues and posted no inline comments.

  • .oxlintrc.json: no-empty (allowEmptyCatch: false) and typescript/switch-exhaustiveness-check are set correctly. The second rule needs type information, so it only runs in pnpm run typecheck (oxlint --type-aware), not in pnpm run lint. That matches the PR description.
  • .ls-lint.yml: I traced the generated complement regex level by level for all seven forbidden words. Every excluded character class removes exactly the next letter of its word. The top-level class leaves out only c/f/h/m/u, and those are handled by their own branches. Each exact word fails (utils, helper, common, …), while longer words and prefixes still pass (utilities, commons, format, helpe). For allowed names it accepts the same set as the old .* pattern, so existing files are unaffected. [^\s\S] is a valid RE2 pattern that never matches. The a.test.utils.ts gap is a known limit and is already documented.
  • Tests: this PR only changes config, and the PR description records manual checks with temporary files, so I'm not asking for new tests.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 2e2927c39b

ℹ️ 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".

Revert .ls-lint.yml to origin/main. The file-name rule stays as prose in the
typescript-style skill.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary: no findings.

This PR changes only .oxlintrc.json, adding no-empty (with allowEmptyCatch: false) and typescript/switch-exhaustiveness-check. no-empty runs in pnpm run lint. The type-aware rule runs through pnpm run typecheck (oxlint --type-aware), and CI runs both of those jobs, so the new rules are enforced. The JSON is valid and no existing code breaks either rule. There's no runtime behavior to cover with tests.

Blocking findings (P0/P1): 0

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: fb0c2b6750

ℹ️ 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".

@furedea
furedea merged commit a1a0716 into main Nov 14, 2026
19 checks passed
@furedea
furedea deleted the build/enable-typescript-style-linters branch November 14, 2026 13:09
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