Skip to content

Use main eslint config for copilot extension too#311606

Merged
mjbvz merged 3 commits intomainfrom
dev/mjbvz/advisory-swallow
Apr 23, 2026
Merged

Use main eslint config for copilot extension too#311606
mjbvz merged 3 commits intomainfrom
dev/mjbvz/advisory-swallow

Conversation

@mjbvz
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz commented Apr 21, 2026

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

  • Moves copilot eslint config into top level eslint config
  • Adopts some standard rules
  • Suppress a few new shared rules

cc @joaomoreno for feedback

- Moves copilot eslint config into top level eslint config
- Adopts some standard rules
- Suppress a few new shared rules
Copilot AI review requested due to automatic review settings April 21, 2026 05:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Screenshot Changes

Base: 938f78a9 Current: 287f4efc

Changed (5)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/Light
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Dark
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-import at the repo root and wires Copilot’s local ESLint plugin into the root flat config.
  • Removes extensions/copilot/eslint.config.mjs and 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

mjbvz and others added 2 commits April 20, 2026 23:14
Co-authored-by: Copilot <copilot@github.com>
These lint checks should already be handled by the full pr lint checks
@mjbvz mjbvz marked this pull request as ready for review April 23, 2026 20:11
@mjbvz mjbvz added this to the 1.118.0 milestone Apr 23, 2026
@mjbvz mjbvz enabled auto-merge April 23, 2026 21:05
"lint": "eslint . --max-warnings=0",
"lint-staged": "eslint --max-warnings=0",
"tsfmt": "npx tsfmt -r --verify",
"lint": "npx eslint .",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this rely on an external version of eslint that could change configuration formats?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it will look up the parent dir chain, in this case finding the eslint copy from vscode/node_modules/.bin

Copy link
Copy Markdown
Collaborator

@rzhao271 rzhao271 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than usage of npx

@mjbvz mjbvz merged commit 74fca43 into main Apr 23, 2026
53 of 56 checks passed
@mjbvz mjbvz deleted the dev/mjbvz/advisory-swallow branch April 23, 2026 21:29
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