Skip to content

extensions/copilot: Enhance robustness of dynamic ESLint rule loader - #333353

Open
Deniz Güney Yıldırım (denizguney) wants to merge 2 commits into
microsoft:mainfrom
denizguney:patch-20
Open

extensions/copilot: Enhance robustness of dynamic ESLint rule loader#333353
Deniz Güney Yıldırım (denizguney) wants to merge 2 commits into
microsoft:mainfrom
denizguney:patch-20

Conversation

@denizguney

Copy link
Copy Markdown
Contributor

Add try-catch blocks and module validation around dynamic rule loading in the Copilot ESLint plugin index to prevent initialization crashes from unhandled file system or import exceptions.

Add try-catch blocks and module validation around dynamic rule loading in the Copilot ESLint plugin index to prevent initialization crashes from unhandled file system or import exceptions.
Copilot AI balanced review requested due to automatic review settings August 29, 2026 20:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves resilience of the Copilot-local ESLint rule loader.

Changes:

  • Catches directory-read and rule-import failures.
  • Registers rules only when a default export exists.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +19 to +23
if (ruleModule.default) {
rules[path.basename(file, '.ts')] = ruleModule.default;
}
} catch (error) {
console.error(`Failed to load ESLint rule from ${file}:`, error);
…e loader

Replace silent catch blocks with explicit fail-fast error throwing and default export validation to prevent cascading configuration errors in eslint.config.js.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants