Skip to content

Migrate to ESLint 9#1747

Merged
rzhao271 merged 3 commits intomainfrom
copilot/migrate-to-eslint-9
Mar 27, 2026
Merged

Migrate to ESLint 9#1747
rzhao271 merged 3 commits intomainfrom
copilot/migrate-to-eslint-9

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Summary

Migrates the project from ESLint 8 (legacy .eslintrc.* configuration format) to ESLint 9 (flat config format).

Changes

Dependencies (package.json)

  • eslint: ^8.52.0^9.39.4
  • @typescript-eslint/eslint-plugin + @typescript-eslint/parser replaced by typescript-eslint@^8.57.2 — the official unified package that bundles the parser and plugin, plus provides the config() and configs helpers for flat config
  • Added @stylistic/eslint-plugin@^2.13.0 — replaces formatting rules removed in ESLint 9 core (semi, indent, quotes, no-extra-semi) and in @typescript-eslint v8 (@typescript-eslint/semi, @typescript-eslint/indent, @typescript-eslint/member-delimiter-style)
  • Added globals@^15.15.0 — provides environment globals for flat config (replaces the old env key)

Configuration

  • Deleted all .eslintrc.json / .eslintrc.base.json / .eslintignore files
  • Created eslint.config.base.js — a shared factory function using tseslint.config() and tseslint.configs.base for TypeScript package configs
  • Created eslint.config.js at the root (for root-level JS files) and in each package directory

Rule changes

  • Formatting rules renamed from @typescript-eslint/* / core to @stylistic/* (same behavior, just the canonical ESLint 9 location)
  • Removed no-buffer-constructor — removed from ESLint 9 core (the Buffer() constructor has been deprecated in Node.js since v6)
  • Removed two spurious eslint-disable-next-line no-console comments in jsonrpc/src/common/connection.ts and jsonrpc/src/common/events.ts — the lines use RAL().console, not console, so the disable comments were never needed; ESLint 9 correctly flags them as unused

Lint scripts

  • Removed --ext ts from all lint scripts (the flag was removed in ESLint 9; file extensions are now controlled via files globs in the flat config)

Verification

  • npm run lint (all packages) — no errors; pre-existing indentation warnings unchanged
  • npm run compile — TypeScript build passes
  • npm test — all unit/integration tests pass (177 tests across textDocument, types, jsonrpc, protocol, server packages)

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@rzhao271
Copy link
Copy Markdown
Contributor

@copilot consider replacing the typescript eslint plugins with typescript-eslint package.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot consider replacing the typescript eslint plugins with typescript-eslint package.

Done in 60bab62. Replaced @typescript-eslint/eslint-plugin + @typescript-eslint/parser with the unified typescript-eslint package. Updated eslint.config.base.js to use tseslint.config() helper and tseslint.configs.base for the parser/plugin setup.

@rzhao271
Copy link
Copy Markdown
Contributor

@copilot Double-check whether stylistic is still needed now that there's typescript-eslint.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot Double-check whether stylistic is still needed now that there's typescript-eslint.

@stylistic/eslint-plugin is still needed. typescript-eslint v8 removed all formatting rules (semi, indent, quotes, member-delimiter-style, no-extra-semi) — they were migrated to @stylistic/eslint-plugin in @typescript-eslint v7 and are no longer part of the plugin at all. Confirmed: none of those five rules exist in the typescript-eslint v8 plugin. The stylistic config exposed by typescript-eslint only covers TypeScript-specific patterns like array type style and type assertion consistency, not text formatting.

@rzhao271 rzhao271 marked this pull request as ready for review March 27, 2026 21:04
@rzhao271 rzhao271 enabled auto-merge (squash) March 27, 2026 21:04
@rzhao271 rzhao271 merged commit 85a9202 into main Mar 27, 2026
7 checks passed
@rzhao271 rzhao271 deleted the copilot/migrate-to-eslint-9 branch March 27, 2026 21:24
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.

3 participants