eslint_d.js icon indicating copy to clipboard operation
eslint_d.js copied to clipboard

Cant find eslint_d.js

Open brendonco opened this issue 5 years ago • 12 comments

Sublime eslint formatter always used eslint instead of eslint_d after I upgrade eslint to latest. Below is my config. Any idea?

"local_eslint_path": {
    "windows": "node_modules/eslint_d/bin/eslint_d.js"
  },
   // The location of the globally installed eslint package to use as a fallback
  "eslint_path": {
    "windows": "%APPDATA%/npm/node_modules/eslint/bin/eslint",
  },

brendonco avatar Jan 20 '20 12:01 brendonco

Are you using https://github.com/roadhump/SublimeLinter-contrib-eslint_d? The readme there also has some guidance for configuring Sublime correctly.

mantoni avatar Jan 21 '20 12:01 mantoni

No, this is outdated. Previous version of eslint and sublimelinter seems to work,

brendonco avatar Jan 22 '20 03:01 brendonco

If it’s outdated, it should probably be removed from the readme.

Can you specify which versions of Sublime and eslint used to work and which ones are breaking? Also, which OS and node versions are you using?

mantoni avatar Jan 22 '20 06:01 mantoni

sublime linter eslint_d is not searchable in sublime package control.

windows 10
node: v12.13.1
eslint: v6.8.0
Sublime: 3.2.2 build 3211

Working on:

node: v8.9.1
eslint: v5.3.0
Sublime: 3.2.2 build 3211

brendonco avatar Jan 22 '20 07:01 brendonco

I guess you already tried eslint_d stop and made sure the process is gone?

mantoni avatar Jan 22 '20 17:01 mantoni

I guess you already tried eslint_d stop and made sure the process is gone?

Yes, eslint_d is not running.

brendonco avatar Jan 23 '20 01:01 brendonco

try to restart eslint_d doesnt seem to work as well.

brendonco avatar Jan 30 '20 01:01 brendonco

@brendonco This is my configuration for SublimeLinter-eslint. I spent a lot of time getting this. I hope it will help you.

        // https://github.com/SublimeLinter/SublimeLinter-eslint
        "eslint":
        {
            "disable": false,
            "args": [
                "--config",
                "${packages}/User/.eslintrc.json",
                "--cache"
            ],
            "executable": ["node", "${packages}/User/node_lib/node_modules/eslint_d/bin/eslint_d.js"],
            "excludes": [],
            "lint_mode": "background",
            "syntax": ["javascript"],
            "styles": [
            {
                "codes": [""]
            }],
            "disable_if_not_dependency": false
        },

mars-dlx avatar Feb 09 '20 08:02 mars-dlx

@brendonco Does the config provided by @Mar-Ser solve your issue? Should be put this in the readme?

mantoni avatar Feb 14 '20 08:02 mantoni

@mantoni @Mar-Ser almost there.

Here's my config:

"eslint": {
          "disable": false,
          "args": [
                "--config",
                "${project_path}/.eslintrc",
                "--cache"
            ],
            "executable": ["node", "${project_path}/node_modules/eslint_d/bin/eslint_d.js"],
            "excludes": [],
            "lint_mode": "background",
            "syntax": ["javascript"],
            "styles": [
            {
                "codes": [""]
            }],
            "disable_if_not_dependency": false
        },

got an error:

SublimeLinter: #1 eslint index.js ERROR:
========================================

JSON Decode error: We expected JSON from 'eslint', but instead got this:
Error: Failed to load plugin 'jest' declared in '--config': Cannot find module 'eslint-plugin-jest'

brendonco avatar Feb 17 '20 03:02 brendonco

@mantoni It can be solved with --resolve-plugins-relative-to. But right now you can't use it, because eslint_d doesn't know it. I open PR #121 to fix that.

mars-dlx avatar Feb 17 '20 20:02 mars-dlx

But it looks like you don't need this option. Perhaps you forgot to install plugins for eslint. It must be installed in the same folder where installed eslint and eslin_d. In your case, it is project_path.

mars-dlx avatar Feb 17 '20 21:02 mars-dlx