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

Cant find eslint_d.js #120

Open
brendonco opened this issue Jan 20, 2020 · 12 comments
Open

Cant find eslint_d.js #120

brendonco opened this issue Jan 20, 2020 · 12 comments

Comments

@brendonco
Copy link

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",
  },

@mantoni
Copy link
Owner

mantoni commented Jan 21, 2020

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

@brendonco
Copy link
Author

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

@mantoni
Copy link
Owner

mantoni commented Jan 22, 2020

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?

@brendonco
Copy link
Author

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

@mantoni
Copy link
Owner

mantoni commented Jan 22, 2020

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

@brendonco
Copy link
Author

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

Yes, eslint_d is not running.

@brendonco
Copy link
Author

try to restart eslint_d doesnt seem to work as well.

@mars-dlx
Copy link

mars-dlx commented Feb 9, 2020

@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
        },

@mantoni
Copy link
Owner

mantoni commented Feb 14, 2020

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

@brendonco
Copy link
Author

@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'

@mars-dlx
Copy link

@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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants