ESLint 9 Migration
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- eslint, nodejs, typescript
调研方向
阅读 ESLint 迁移指南,然后将 .eslintrc.json 和 .eslintignore 与所需的 eslint.config.js 和 eslint.ignores.js 文件进行比较。迁移后运行 linting 检查和测试,并解决列出的发现或有意进行配置,以解除对 gts v7 升级的阻碍并确保 CI 通过。
由索引模型根据 Issue 内容生成。
描述
The Pull Request chore(deps): update dependency gts to v7 #3856 is currently blocked due to CI failures.
The core of the issue is that gts v7 upgrades the linter to ESLint v9, which introduces a breaking change by switching to a new "Flat Config" system. The existing configuration infrastructure is incompatible with this new version.
Resolving this requires a two-step approach.
Step 1: Infrastructure Migration (ESLint 9 Flat Config)
ESLint 9 drops support for .eslintrc.json and .eslintignore. The project must migrate to eslint.config.js and eslint.ignores.js.
Findings & Reference
In Flat Config, ignore patterns are strictly relative to the configuration file, and global variables (like process or module in Node.js) must be explicitly declared in the config for JavaScript files.
- Reference: ESLint Migration Guide - Ignoring Files
Required Technical Changes
- Create
eslint.ignores.js: Export the array of ignore patterns (migrated from.eslintignore). - Create
eslint.config.js:- Extend
gts. - Import ignore patterns.
- Declare
globals.nodefor**/*.jsfiles to preventno-undeferrors.
- Extend
- Clean up: Delete
.eslintrc.jsonand.eslintignore.
Step 2: Code Compliance (New Linting Findings)
After migrating to ESLint v9, the new linter identifies several violations in the existing codebase that were previously ignored or not checked with the same intensity. We need to determine the best path forward for these findings, whether is to mute the findings, fix the findings, or come up with a hybrid approach.
Findings
The following rules are failing across multiple files (many of which are autogenerated):
@typescript-eslint/no-unused-vars@typescript-eslint/no-explicit-any@typescript-eslint/no-unused-expressions
Open Questions:
- Mute the findings (Short-term): Should we disable these rules in
eslint.config.jsto unblock thegtsv7 upgrade? This would maintain the current state of the codebase while adopting the new tooling. - Fix the findings (Long-term): Since many of these files are autogenerated, should we block the upgrade until the generator logic is updated to produce compliant code?
- Hybrid Approach: Mute them now but create a follow-up task to address the generator's output?
NOTE: muting these rules in the new
eslint.config.jsallowed all linting checks and tests to pass successfully when testing this changes locally.
- 主要语言
- TypeScript
- 星标
- 12.3k
- 派生
- 2k
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
googleapis/google-api-nodejs-client 的其他 Issue
-
难度 5/5 一周以上 新手友好度 32/100
googleapis/google-api-nodejs-client#3932 · 1 条评论 ·
维护者通常 1 天内回复
-
[Discovery Engine] streamAnswer is typed as one AnswerQueryResponse, but REST returns frame arrays未关闭
难度 3/5 1-2 天 新手友好度 64/100
googleapis/google-api-nodejs-client#3930 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 76/100
googleapis/google-api-nodejs-client#3927 · 1 个 reaction ·
维护者通常 1 天内回复
-
size: l type: feature request
难度 4/5 3-5 天 新手友好度 35/100
googleapis/google-api-nodejs-client#3926 ·
维护者通常 1 天内回复
-
type: feature request
难度 5/5 一周以上 新手友好度 15/100
googleapis/google-api-nodejs-client#3903 ·
维护者通常 1 天内回复
查看 googleapis/google-api-nodejs-client 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 78/100
lichess-org/api#678 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
PostHog/posthog.com#20628 ·
维护者通常 1 天内回复
-
bug status:Needs Triage
难度 1/5 1 小时以内 新手友好度 92/100
jupyterlab/jupyterlab#19964 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
agentscope-ai/QwenPaw#8064 · 1 条评论 ·
维护者通常 1 天内回复
-
area: notebooks-jupyter bug theme: new notebook frontend
难度 2/5 1-3 小时 新手友好度 88/100
posit-dev/positron#16347 · 1 条评论 ·
维护者通常 1 天内回复