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

Setup ESLint with Deno runtime instead of node #1907

Open
Mqxx opened this issue Jul 22, 2024 · 4 comments
Open

Setup ESLint with Deno runtime instead of node #1907

Mqxx opened this issue Jul 22, 2024 · 4 comments
Labels
feature-request Request for new features or functionality
Milestone

Comments

@Mqxx
Copy link

Mqxx commented Jul 22, 2024

Hey, I am currently setting um ESLint for my Deno projekt. ESLint in the CLI works without a problem, but the VS-Code extension requires a package.json file in the root of my projekt because I am using ES6 import syntax inside my eslint.config.js. The only content in my package.json is this:

package.json

{
  "type": "module"
}

I dont't use the package.json. I use the deno.json config file and I also have no commonjs in my project, everything is esm (standard).
I don't want to use the .mjs extension, because it's outdated. Is there also a way to specify where ESLint looks up the node_modules folder? Since i don't use node there is no reason to have a node_modules folder except for ESLint (requires that to work)

Here you can finde a simple ESLint example setup with Deno: github.com/DenoPlayground/eslint-example

Maybe someone can help me out.

Thanks 👍

@dbaeumer dbaeumer added the feature-request Request for new features or functionality label Jul 30, 2024
@dbaeumer
Copy link
Member

The ESLint server can currently not been run under Deno.

@dbaeumer dbaeumer added this to the Backlog milestone Jul 30, 2024
@Mqxx
Copy link
Author

Mqxx commented Jul 31, 2024

The ESLint server can currently not been run under Deno.

Okay. Thanks for the response.

@alexgleason
Copy link

alexgleason commented Oct 12, 2024

@dbaeumer Why doesn't passing "eslint.runtime": "/usr/bin/deno" work? Under the hood is it just passing CLI flags deno doesn't support?

EDIT: I see this:

[Info  - 6:22:08 PM] ESLint server is starting.
�[0m�[1m�[31merror�[0m: Uncaught (in promise) ReferenceError: require is not defined
    at �[0m�[1m�[3mObject.6928�[0m (�[0m�[36mfile:///home/alex/.vscode-oss/extensions/dbaeumer.vscode-eslint-3.0.10-universal/server/out/eslintServer.js�[0m:�[0m�[33m1�[0m:�[0m�[33m189359�[0m)
    at �[0m�[1m�[3mn�[0m (�[0m�[36mfile:///home/alex/.vscode-oss/extensions/dbaeumer.vscode-eslint-3.0.10-universal/server/out/eslintServer.js�[0m:�[0m�[33m1�[0m:�[0m�[33m230569�[0m)
    at �[0m�[36mfile:///home/alex/.vscode-oss/extensions/dbaeumer.vscode-eslint-3.0.10-universal/server/out/eslintServer.js�[0m:�[0m�[33m1�[0m:�[0m�[33m231023�[0m
    at �[0m�[36mfile:///home/alex/.vscode-oss/extensions/dbaeumer.vscode-eslint-3.0.10-universal/server/out/eslintServer.js�[0m:�[0m�[33m1�[0m:�[0m�[33m244726�[0m
    at �[0m�[36mfile:///home/alex/.vscode-oss/extensions/dbaeumer.vscode-eslint-3.0.10-universal/server/out/eslintServer.js�[0m:�[0m�[33m1�[0m:�[0m�[33m244832�[0m
[Error - 6:22:08 PM] Server process exited with code 1.
[Error - 6:22:08 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 6:22:08 PM] Connection to server got closed. Server will restart.
true
[Info  - 6:22:08 PM] ESLint server stopped.

EDIT: Wait is it actually execute code against the runtime? 😮

@dbaeumer
Copy link
Member

This looks more like a problem with the code the eslint server has to see whether it is running in a webpacked environment or a NodeJs commonjs one. See https://github.com/microsoft/vscode-eslint/blob/main/server/src/eslintServer.ts#L61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants