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

Add eslint.js for WebStorm compat #24

Merged
merged 1 commit into from
Dec 8, 2015
Merged

Add eslint.js for WebStorm compat #24

merged 1 commit into from
Dec 8, 2015

Conversation

zurawiki
Copy link

@zurawiki zurawiki commented Dec 4, 2015

By adding a symlink, we can take advantage of the eslint_d inside of the WebStorm IDE

This does not add eslint to the npm bin, but just make sure eslint.js exists for tools and plugins that look for it.

Add eslint_d to WebStorm's ESLint config
WebStorm ESLint Config

Without this patch, we get the following error.
WebStorm Error Message

With the patch, the linter is faster than ever!

@zurawiki zurawiki changed the title Add symlink to eslint.js for WebStorm compat Add eslint.js for WebStorm compat Dec 4, 2015
@mantoni
Copy link
Owner

mantoni commented Dec 4, 2015

Thanks for the pull request. This means that WebStorm is doing the wrong thing. They shouldn't make assumptions about the internal structure of the ESLint package. But the workaround is easy enough, so yeah, we can add this.

Two minor things though: If you want to add a screenshot, please make it part of the PR and link to it with a relative URL to the image instead of some hash. Alternatively, a text description would also do. Secondly, please replace the compatibility note with something like "You need at least eslint_d 2.4.0 for WebStorm support." instead of linking to your fork - that branch in your fork will most likely not receive future patches ;-)

Thanks!

'use strict';

var client = require('../lib/client');
var useStdIn = (process.argv.indexOf('--stdin') > -1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stdin option is already supported. This file could simply require('./eslint_d.js');.

Update README to include WebStorm setup
@zurawiki
Copy link
Author

zurawiki commented Dec 7, 2015

I updated the PR and simplified the readme. I am not sure what version you will publish so if you want to add a reference to the version number, I will give you the liberty to do so.

mantoni added a commit that referenced this pull request Dec 8, 2015
Add eslint.js for WebStorm compat
@mantoni mantoni merged commit 101111c into mantoni:master Dec 8, 2015
@mantoni
Copy link
Owner

mantoni commented Dec 8, 2015

Thanks! Released in 2.4.0. 🚢

@zurawiki zurawiki deleted the webstorm-compat branch December 9, 2015 23:46
@SimenB
Copy link
Contributor

SimenB commented Apr 17, 2017

This is broken again in newer IntelliJs.

ESLint error:: Initialization error (ESLint). Cannot find module '/Users/simen/Development/add-asset-html-webpack-plugin/node_modules/eslint_d/lib/cli.js'

@mantoni
Copy link
Owner

mantoni commented Apr 17, 2017

@SimenB D'oh! Do you know how to solve it?

@SimenB
Copy link
Contributor

SimenB commented Apr 17, 2017

I don't think it's possible, but the newer intellij uses the api more directly out of the box, so not as needed as before, maybe?

https://blog.jetbrains.com/webstorm/2017/02/webstorm-2017-1-eap-171-3224/

I still use eslint_d for auto-fix on save, though 😄

@mantoni
Copy link
Owner

mantoni commented Apr 17, 2017

Atom always did it this way and it absolutely makes sense for IDEs. I think we don't have to open a new issue then. Would you care to put a note into the Readme stating the version range where eslint_d works?

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

Successfully merging this pull request may close these issues.

3 participants