question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support running the ESLint server in the WSL under Windows.

See original GitHub issue

This is the error I get in the output pane of Vscode. There is no log in the developer tools console.

[Info  - 9:16:38 PM] ESLint server is running.
(node:11580) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token .

I can lint the file fine if I start eslint in the console (Bash for Windows).

I do use Vscode in Windows 10, and eslint (and nodejs) is installed inside Bash for Windows (Linux subsystem). My Windows build is 15063.296. Node.js version is v8.1.0, eslint is v3.19.0. So I start the Windows version of Vscode but I point to eslint inside Linux with "eslint.nodePath".

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
lifensteincommented, Sep 4, 2018

Found a more reliable way to use WSL-installed node & eslint, using the wsl wrapper command that is part of WSL.

  1. Create a batch file with the following content and save it as node.bat:
    @echo off
    wsl node %*
    
  2. Make another with node replaced by eslint (Can repeat this for whatever other commands you need to be made available).
  3. Set eslint.nodePath to C:\\path\\to\\batch\\file\\node.bat (note the double backslashes)
  4. Restart Code if needed.
1reaction
dbaeumercommented, May 6, 2019

Will close the issue since there is nothing to do in the ESLint extension 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint while on linux subsystem (WSL)? : r/vscode - Reddit
I've been migrating projects from Ubuntu dev machine to using Windows for dev with VSC and WSL. So far, most things are running...
Read more >
Set up Node.js on WSL 2 - Windows - Microsoft Learn
A guide to help you get your Node.js development environment set up on Windows Subsystem for Linux (WSL).
Read more >
Eslint not working on VSCode when using WSL Debian
I've installed the eslint extension on vscode and installed it as a dev dependency on WSL Debian and can run npx eslint just...
Read more >
November 2022 (version 1.74) - Visual Studio Code
JavaScript debugging. Support for console.profile. The JavaScript debugger now supports console.profile. When running under the debugger, a CPU profile will be ...
Read more >
ESLint | WebStorm Documentation - JetBrains
Configure ESLint manually · In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Languages & Frameworks | JavaScript | Code Quality Tools | ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found