Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Request: use env npm_execpath in alias init #18396

Open
1 task done
RodrigoDornelles opened this issue Apr 25, 2024 · 1 comment
Open
1 task done

Change Request: use env npm_execpath in alias init #18396

RodrigoDornelles opened this issue Apr 25, 2024 · 1 comment
Labels
core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint needs design Important details about this change need to be discussed

Comments

@RodrigoDornelles
Copy link

RodrigoDornelles commented Apr 25, 2024

ESLint version

v8.56.0

What problem do you want to solve?

compatibility with other runtimes such as bun and deno.

What do you think is the correct solution?

in file bin/eslint.js

replace

const spawn = require("cross-spawn");

spawn.sync("npm", ["init", "@eslint/config"], { encoding: "utf8", stdio: "inherit" });

to

const spawn = require("cross-spawn");
const npm = process.env.npm_execpath || "npm";

spawn.sync(npm, ["init", "@eslint/config"], { encoding: "utf8", stdio: "inherit" });

Participation

  • I am willing to submit a pull request for this change.

Additional comments

I created a PR, but it was rejected because it needed an RFC as per the comment. #18178 (comment)

need create an RFC documenting it in the eslint/rfcs repository, after that maybe re-opening my contribution;

related: oven-sh/bun#6728

@RodrigoDornelles RodrigoDornelles added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint labels Apr 25, 2024
@nzakas
Copy link
Member

nzakas commented Apr 25, 2024

Happy have an RFC submitted for this. 👍

@mdjermanovic mdjermanovic added the needs design Important details about this change need to be discussed label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint needs design Important details about this change need to be discussed
Projects
Status: Waiting for RFC
Development

No branches or pull requests

3 participants