Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

ESLint 9 Migration

Đang mở
#3,863 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
eslint, nodejs, typescript
Lĩnh vực
ci-cd, tooling

Hướng nghiên cứu

Đọc hướng dẫn di chuyển ESLint, sau đó so sánh .eslintrc.json và .eslintignore với các tệp được yêu cầu là eslint.config.js và eslint.ignores.js. Chạy các bước kiểm tra linting và test sau khi di chuyển, rồi giải quyết hoặc chủ động cấu hình các phát hiện được liệt kê để gỡ chặn việc nâng cấp lên gts v7 và giúp CI chạy qua.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

size: m type: process

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.

Required Technical Changes
  1. Create eslint.ignores.js: Export the array of ignore patterns (migrated from .eslintignore).
  2. Create eslint.config.js:
    • Extend gts.
    • Import ignore patterns.
    • Declare globals.node for **/*.js files to prevent no-undef errors.
  3. Clean up: Delete .eslintrc.json and .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:
  1. Mute the findings (Short-term): Should we disable these rules in eslint.config.js to unblock the gts v7 upgrade? This would maintain the current state of the codebase while adopting the new tooling.
  2. 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?
  3. 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.js allowed all linting checks and tests to pass successfully when testing this changes locally.

Ngôn ngữ chính
TypeScript
Star
12.3k
Fork
2k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của googleapis/google-api-nodejs-client

Tất cả issue của googleapis/google-api-nodejs-client

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.