Use main eslint config for copilot extension too#311606
Merged
Conversation
- Moves copilot eslint config into top level eslint config - Adopts some standard rules - Suppress a few new shared rules
Contributor
Screenshot ChangesBase: Changed (5) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates the Copilot extension’s ESLint setup into the repository’s root eslint.config.js, aligning Copilot with the shared lint rules and removing the extension-specific ESLint configuration and scripts.
Changes:
- Adds
eslint-plugin-importat the repo root and wires Copilot’s local ESLint plugin into the root flat config. - Removes
extensions/copilot/eslint.config.mjsand Copilot-local lint/lint-staged scripts, updating pre-commit hygiene accordingly. - Updates ignore patterns and adjusts/suppresses specific lint rules via file-level disables and rule-name updates in Copilot sources/tests.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds eslint-plugin-import dependency needed by the root ESLint config. |
| package-lock.json | Lockfile updates for eslint-plugin-import and transitive deps. |
| eslint.config.js | Integrates Copilot ESLint rules/plugins into the main flat config and adds Copilot-specific overrides. |
| .eslint-ignore | Stops blanket-ignoring extensions/copilot/** and replaces it with targeted ignores for generated/fixture paths. |
| build/hygiene.ts | Removes running Copilot’s lint-staged from the pre-commit hygiene hook. |
| extensions/copilot/package.json | Removes Copilot-local lint scripts and ESLint-related devDependencies now provided at the repo root. |
| extensions/copilot/eslint.config.mjs | Deletes the extension-specific ESLint configuration (moved to root). |
| extensions/copilot/.eslint-ignore | Deletes Copilot-local ignore file (replaced by root .eslint-ignore entries). |
| extensions/copilot/.eslintplugin/no-unexternalized-strings.ts | Removes a Copilot-local rule implementation (now relying on shared/local rules). |
| extensions/copilot/vite.config.ts | Removes an inline suppression comment. |
| extensions/copilot/test/base/extHostContext/simulationWorkspaceExtHost.ts | Updates eslint-disable to copilot-local/* namespace. |
| extensions/copilot/test/base/extHostContext/simulationExtHostToolsService.ts | Removes now-unneeded import/no-restricted-paths suppression header. |
| extensions/copilot/test/base/extHostContext/simulationExtHostContext.ts | Removes now-unneeded import/no-restricted-paths suppression header. |
| extensions/copilot/src/platform/testing/test/node/setupTestDetector.spec.ts | Adds suppression for shared local/code-no-unused-expressions. |
| extensions/copilot/src/platform/test/node/extensionContext.ts | Switches branded service field to declare (type-only). |
| extensions/copilot/src/platform/telemetry/common/ghTelemetrySender.ts | Makes _disposables readonly. |
| extensions/copilot/src/platform/git/vscode-node/gitServiceImpl.ts | Adds suppression for local/code-no-observable-get-in-reactive-context. |
| extensions/copilot/src/platform/endpoint/test/node/testEndpointProvider.ts | Removes import/no-restricted-paths suppression header. |
| extensions/copilot/src/extension/typescriptContext/vscode-node/languageContextService.ts | Adds suppressions for shared local/code-no-unused-expressions. |
| extensions/copilot/src/extension/prompt/test/node/conversation.spec.ts | Adds suppression for shared local/code-no-unused-expressions. |
| extensions/copilot/src/extension/onboardDebug/test/node/debuggableCommandIdentifier.spec.ts | Adds suppression for shared local/code-no-unused-expressions. |
| extensions/copilot/src/extension/intents/node/newNotebookIntent.ts | Adds suppression for shared local/code-no-unused-expressions. |
| extensions/copilot/src/extension/intents/node/agentIntent.ts | Adjusts otelService visibility to match the overridden member. |
| extensions/copilot/src/extension/inlineEdits/node/nextEditProviderTelemetry.ts | Adds suppressions for local/code-no-observable-get-in-reactive-context. |
| extensions/copilot/src/extension/completions-core/vscode-node/lib/src/test/telemetry.ts | Adds suppression for local/code-no-accessor-after-await. |
| extensions/copilot/src/extension/completions-core/.../*.tmLanguage.ts | Updates unexternalized-strings rule name to local/code-no-unexternalized-strings. |
| extensions/copilot/src/extension/common/modelContextProtocol.ts | Updates unexternalized-strings rule name to local/code-no-unexternalized-strings. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts | Fixes type alias terminator to };. |
| extensions/copilot/script/compareStestAlternativeRuns.ts | Adds suppression for local/code-no-dangerous-type-assertions. |
Copilot's findings
- Files reviewed: 31/33 changed files
- Comments generated: 1
Co-authored-by: Copilot <copilot@github.com>
These lint checks should already be handled by the full pr lint checks
rzhao271
reviewed
Apr 23, 2026
| "lint": "eslint . --max-warnings=0", | ||
| "lint-staged": "eslint --max-warnings=0", | ||
| "tsfmt": "npx tsfmt -r --verify", | ||
| "lint": "npx eslint .", |
Collaborator
There was a problem hiding this comment.
Doesn't this rely on an external version of eslint that could change configuration formats?
Collaborator
Author
There was a problem hiding this comment.
I believe it will look up the parent dir chain, in this case finding the eslint copy from vscode/node_modules/.bin
rzhao271
reviewed
Apr 23, 2026
Collaborator
rzhao271
left a comment
There was a problem hiding this comment.
LGTM other than usage of npx
rzhao271
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the copilot extension use our normal eslint setup instead of its own setup. This matches how other built-in extensions already work. It should let us have more consistent rules across the entire codebase
cc @joaomoreno for feedback