roadhump / SublimeLinter-contrib-eslint_d

This linter plugin for SublimeLinter provides an interface to eslint_d
MIT License
40 stars 13 forks source link

eslint_d makes invalid assumptions about the config file location #4

Open Standard8 opened 9 years ago

Standard8 commented 9 years ago

I'm just trying out the new eslint_d with this package, and its nice to get the speed improvement.

One problem I've noticed that unlike SublimeLinter-contrib-eslint, this one is specifying the config file to default to the location that the file is in:

    config_file = ('--config', '.eslintrc', '~')

when it gets run, I see:

SublimeLinter: chdir not set or invalid, using /Users/mark/loop/gecko-dev/browser/components/loop/content/js 
SublimeLinter: eslint_d: roomViews.jsx ['/usr/local/bin/eslint_d', '--no-ignore', '--format', 'compact', '@', '--config', '/Users/mark/loop/gecko-dev/browser/components/loop/content/js/.eslintrc'] 
SublimeLinter: eslint_d output:

However, for us the config file is two directories above. Although I can specify this in the settings for the project, that isn't enough in our case as we currently have several "top-level" configurations throughout the tree. Whilst this needs correcting on our side, we're a little way away from that yet.

Could we either not set the config file location like the normal eslint package, or make it so that setting it is optional?

Standard8 commented 8 years ago

I've taken a bit of a look around, and this isn't quite as easy as removing the current config setting in the linter.py file.

SublimeLinter-contrib-eslint uses --stdin and --stdin-filename to pipe via stdin and set the filename. However, eslint_d doesn't support those options.

It appears that '@' on the command line is some sort of indication to something that stdin is going to be used. Is that correct, I can't find any documentation on it?

I think we need to get eslint_d to support the stdin options, and then we can change the config setup here to do the same as SublimeLinter-contrib-eslint. Does that analysis sound right?

roadhump commented 8 years ago

@Standard8 Here is documentation about linter attributes and @ http://sublimelinter.readthedocs.org/en/latest/linter_attributes.html#cmd . Yes, it would be great to make eslint_d to support stdin options, it can solve many problems and make plugin work the same way as eslint plugin.