sveltejs / eslint-plugin-svelte

ESLint plugin for Svelte using AST
https://sveltejs.github.io/eslint-plugin-svelte/
MIT License
298 stars 36 forks source link

`pnpm run new` tries to run unknown command `code` #607

Open marekdedic opened 11 months ago

marekdedic commented 11 months ago

Before You File a Bug Report Please Confirm You Have Done The Following...

What version of ESLint are you using?

-

What version of eslint-plugin-svelte are you using?

master

What did you do?

$ pnpm install
$ pnpm run new my-rule

What did you expect to happen?

New rule files generated

What actually happened?

> eslint-plugin-svelte@2.34.1 new /home/marekdedic/eslint-plugin-svelte
> pnpm run ts ./tools/new-rule.ts "my-rule"

> eslint-plugin-svelte@2.34.1 ts /home/marekdedic/eslint-plugin-svelte
> node -r esbuild-register "./tools/new-rule.ts" "my-rule"

/bin/sh: 1: code: not found
node:internal/errors:865
  const err = new Error(message);
              ^

Error: Command failed: code "/home/marekdedic/eslint-plugin-svelte/src/rules/my-rule.ts"
/bin/sh: 1: code: not found

    at __node_internal_genericNodeError (node:internal/errors:865:15)
    at checkExecSyncError (node:child_process:887:11)
    at Object.execSync (node:child_process:959:15)
    at <anonymous> (/home/marekdedic/eslint-plugin-svelte/tools/new-rule.ts:133:5) {
  status: 127,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(28) [Uint8Array] [
       47,  98, 105, 110,  47, 115, 104,
       58,  32,  49,  58,  32,  99, 111,
      100, 101,  58,  32, 110, 111, 116,
       32, 102, 111, 117, 110, 100,  10
    ]
  ],
  pid: 23635,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(28) [Uint8Array] [
     47,  98, 105, 110,  47, 115, 104,
     58,  32,  49,  58,  32,  99, 111,
    100, 101,  58,  32, 110, 111, 116,
     32, 102, 111, 117, 110, 100,  10
  ]
}

Node.js v20.5.1
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Seems like it tries to run the command code, which I don't have and honestly don't know what that is... Maybe VS Code? If that's the case, please don't assume everybody uses your favorite editor...

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/sveltejs/eslint-plugin-svelte

Additional comments

No response

ota-meshi commented 11 months ago

Thank you for posting the issue! We need to remove that code command.