Skip to content

build(oxlint): restrict test frameworks other than vitest - #45

Merged
furedea merged 2 commits into
mainfrom
build/restrict-other-test-frameworks
Nov 15, 2026
Merged

furedea merged 2 commits into
mainfrom
build/restrict-other-test-frameworks

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

概要

vitest 以外のテストフレームワークの利用を oxlint で禁止します.furedea/agent-config#195 の不安定な ast-grep ルール ts_no_other_test_framework を置き換えるものです.

  • no-restricted-globals: グローバルの jest を禁止(スコープを考慮するため,ローカル変数・引数・分割代入の jest は報告されません)
  • no-restricted-imports: jest,@jest/globals,mocha,chai,sinon,jasmine,ava,tape,node:test の import を禁止(メッセージは vitest の利用を促すもの)

Refs furedea/agent-config#74

検証

  • 使い捨てファイルで確認(確認後に削除済み)
    • グローバルの jest.fn() は報告される
    • 引数・分割代入の jest は報告されない
    • @jest/globals と node:test の import は報告される
  • pnpm run check(format,lint,typecheck,test,knip,audit)が成功

計画からの変更点

なし

🤖 Generated with Claude Code

Ban the jest global and imports of jest, @jest/globals, mocha, chai,
sinon, jasmine, ava, tape and node:test. no-restricted-globals is
scope-aware, so local, parameter or destructured jest bindings are not
reported.

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

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread .oxlintrc.json Resolved
@github-actions

Copy link
Copy Markdown

Review summary

This PR only changes .oxlintrc.json. It adds no-restricted-globals for jest and no-restricted-imports for non-vitest test frameworks. The config is valid and does not conflict with the existing rules or overrides. I found no blocking issues.

  • P3: the paths entries only match exact specifiers, so subpath imports such as chai/register-expect.js and sinon/pkg/..., and other @jest/* packages, are not caught. Adding a patterns entry would close that gap (see the inline comment).

Blocking findings (P0/P1): 0

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 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-15T13:37:54.608669Z 4f80a4e 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.

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

ℹ️ 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 .oxlintrc.json Resolved
no-restricted-imports paths match only exact specifiers, so imports
such as chai/register-expect.js or @jest/expect were not reported. Add
a patterns entry covering each package's subpaths.

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

furedea commented Nov 15, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

No blocking issues found. This PR only changes .oxlintrc.json: it adds no-restricted-globals for jest and no-restricted-imports for the other test frameworks. The rule config looks right: path names and glob groups cover subpath imports such as @jest/globals and chai/..., and node:test is listed. No existing override redefines these rules.

Gaps worth knowing about, none of them blocking: no-restricted-imports does not catch dynamic import("mocha") or require(...). The package is ESM-only, so this matters little.

Findings: P0: 0, P1: 0, P2: 0, P3: 0.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 4f80a4e6cc

ℹ️ 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 bf969e1 into main Nov 15, 2026
19 checks passed
@furedea
furedea deleted the build/restrict-other-test-frameworks branch November 15, 2026 13:47
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