Support running @tanstack/eslint-plugin-oracles on TypeScript 7 (tsgo) via an opt-in oxc-parser syntax parser

オープン
#194 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
eslint, javascript, nodejs, typescript
領域
devtools, tooling

調査の方向性

This is a design proposal with four evaluated options rather than a task with a target file, so start by reading packages/eslint-plugin-oracles/src/index.js and src/modules.js to confirm the syntax-only claim, then tests/consumer-typescript.test.js for the existing consumer harness. Any implementation would add a new parser entry point and configs.recommendedSyntaxOnly alongside the existing configs, plus a differential corpus test against @typescript-eslint/parser and a TS 7 stub. Expect multi-package work across the plugin and oracles-setup/SKILL.md, and a maintainer decision on the oxc-parser pin before anyone writes code.

索引モデルが issue の本文から書いたものです。

説明

Problem

On repositories running TypeScript 7 (tsgo, e.g. [email protected].*), @tanstack/eslint-plugin-oracles currently cannot be run via @typescript-eslint/parser:

  • oracles-setup step 2 unconditionally installs @tanstack/eslint-plugin-oracles (+ transitive dependencies), and step 3 then reports an environment limit because @typescript-eslint/[email protected] declares peerDependencies.typescript: ">=4.8.4 <6.1.0" (failing with ERESOLVE, and if forced, crashing with Cannot read properties of undefined (reading 'Cjs') against TS 7's root export stub).
  • However, @tanstack/eslint-plugin-oracles itself is 100% syntax-only:
    • None of the rules in packages/eslint-plugin-oracles/src/ use parserServices or TypeScript's type checker (src/index.js explicitly notes the rules need no type information).
    • src/modules.js parses imported modules via ESLint's new Linter({ cwd }).verify(...), reusing whatever parser the consumer configures in languageOptions.parser with project/projectService/programs stripped.
    • The rules rely only on ESTree/TS-ESTree AST nodes, scopeManager, sourceCode.getDisableDirectives(), sourceCode.getInlineConfigNodes(), and linterOptions.noInlineConfig.

Options Evaluated (as of Nov 2026)

  1. @typescript-eslint/parser (8.73.0):

    • Peer dependency remains typescript >=4.8.4 <6.1.0; no TS 7-only v9/prerelease exists.
    • Its new EXPERIMENTAL_backend: 'tsgo' (PR #12803) still requires classic TypeScript 6 installed side-by-side (@typescript/native), which conflicts with oracles-setup's rule not to alter the repository's TypeScript dependency.
  2. Oxlint jsPlugins (1.94.0, alpha):

    • Cannot run @tanstack/eslint-plugin-oracles unmodified:
      • context.languageOptions.parser.parse is not implemented yet in Oxlint's JS plugin host (apps/oxlint/src-js/plugins/context.ts), breaking src/modules.js's imported-module parsing.
      • sourceCode.getInlineConfigNodes() is absent, breaking no-oracle-disable.js.
      • No linterOptions.noInlineConfig or ESLint flat-config preset support.
  3. tsgolint (oxlint-tsgolint):

    • Go backend for built-in type-aware typescript/* rules only; has no custom JS/TS plugin host and is unnecessary for syntax-only rules.
  4. Opt-in syntax-only ESLint parser backed by oxc-parser (Recommended):

    • oxc-parser parses JS/TS into ESTree/TS-ESTree with zero typescript dependency.
    • Paired with @typescript-eslint/scope-manager and @typescript-eslint/visitor-keys (plus loc and token generation for ESLint SourceCode), it plugs straight into ESLint 9/10's languageOptions.parser with no changes to src/modules.js or any rule.
    • Experimental verification: Running the unmodified @tanstack/eslint-plugin-oracles under ESLint 9.39 with [email protected] (oxc-parser 0.148) while hard-blocking any import 'typescript' via registerHooks:
      • On all 13 *oracle*.ts files in packages/oracles: identical 6 findings (rule, location, text) vs @typescript-eslint/parser (2.5s vs 3.4s).
      • Across all 77 .ts/.tsx/.js/.mjs files under packages/ with all 7 rules + noInlineConfig: identical 37 findings (exact hash match 7fa07d0778), zero fatal errors, and ~2× faster (2.2s vs 4.3s).

Proposed Direction

  1. Ship an opt-in syntax-only parser (e.g. @tanstack/eslint-plugin-oracles/parser and/or configs.recommendedSyntaxOnly / productionSyntaxOnly) built on oxc-parser + @typescript-eslint/scope-manager + @typescript-eslint/visitor-keys.
    • Keep it opt-in so it never overrides a consumer's @typescript-eslint/parser (and parserServices) on repos that run typed lint rules on oracle files.
    • Pin oxc-parser and gate upgrades with a differential corpus test against @typescript-eslint/parser plus a TS 7 stub test (mirroring tests/consumer-typescript.test.js).
    • Note Node engine alignment (oxc-parser requires ^20.19 || >=22.12).
  2. Update oracles-setup/SKILL.md:
    • Once the opt-in parser ships, use it for TS 7, TS < 4.8, and JS-only repos so consumers never need @typescript-eslint/parser or changes to their typescript version.
    • In the meantime, skip installing @tanstack/eslint-plugin-oracles in step 2 when step 1 detects an environment where oracle lint cannot run (e.g. TS 7 without an alternative parser).
    • (Minor cleanup noticed during audit: oracles-setup/SKILL.md references an unparsedModule report that no longer exists in packages/eslint-plugin-oracles/src/.)
主要言語
JavaScript
スター
13
フォーク
1
平均マージ
11時間 8分
マージ済み PR(30日)
67

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/oracles のほかの issue

TanStack/oracles の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。