Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork688
Description
name: Bug report
about: Create a report to help us improve
Checklist
- I have tried restarting my IDE and the issue persists.
- I have read theFAQ and my problem is not listed.
Tell us about your environment
- ESLint version: 9.17.0 (development environment issue, not rule-specific)
- eslint-plugin-vue version: 10.2.0
- Vue version: 3.x (development environment issue, not app-specific)
- Node version: v23.11.0
- Operating System: macOS (Darwin 24.5.0)
Please show your full configuration:
This is a development tooling issue with npm run new command.
What did you do?
npm run new<rule-name><author>
What did you expect to happen?
The command should complete successfully without errors, providing a smooth experience for new contributors following the developer guide.
What actually happened?
The command generates files successfully but fails at the end when trying to automatically open files in VS Code:
/bin/sh: code: command not foundError: Command failed: code "path/to/generated/file" at genericNodeError (node:internal/errors:983:15) at wrappedFn (node:internal/errors:537:14) at checkExecSyncError (node:child_process:882:11) at Object.execSync (node:child_process:954:15) at /path/to/tools/new-rule.js:143:6
The issue occurs because the script assumes VS Code CLI (code
command) is installed, but many developers use other editors (like Cursor, Vim, etc.) or don't have VS Code command line tools available. This creates a poor first impression for new contributors.
Repository to reproduce this issue
This issue can be reproduced on any system where VS Code command line tools are not installed. The problem is intools/new-rule.js:143-145
where it executescode
command without error handling to open generated files automatically.
Suggested Solution
Add graceful fallback whencode
command is not available:
try{cp.execSync(`code "${ruleFile}"`,{stdio:'ignore'})}catch(err){// Continue silently if VS Code is not availableconsole.log('Files generated successfully')}