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

Change --stdin-filename to relative to check by .eslintignore (fixes #46) #49

Merged
merged 1 commit into from
May 8, 2015

Conversation

roadhump
Copy link
Collaborator

@roadhump roadhump commented May 8, 2015

I suppose that the most common scenario is to have one .eslintignore at the root of project and execute eslint . or eslint folder/file there. That is the behavior I keep in mind to make .eslintignore settings work for plugin. That's why now plugin executes

cat /path/to/projectFolder/projectSubFolder/file | eslint --stdin --stdin-filename projectSubFolder/file

instead of

cat /path/to/projectFolder/projectSubFolder/file | eslint --stdin --stdin-filename /path/tp/projectFolder/projectSubFolder/file

or

cat /path/to/projectFolder/projectSubFolder/file | eslint --stdin --stdin-filename file

It makes to work the default .eslintignore option node_modules/**.

To revert this behavior (if full name of file in --stdin-filename is critical) add

{
    "linters": {
        "eslint": {
            "args": ["--stdin-filename", "@"]
        }
    }
}

to your .sublimelinterrc file

roadhump added a commit that referenced this pull request May 8, 2015
Change --stdin-filename to relative to check by .eslintignore (fixes #46)
@roadhump roadhump merged commit ecac1fc into master May 8, 2015
@roadhump roadhump deleted the ignore branch May 8, 2015 20:39
@tschaub
Copy link
Contributor

tschaub commented May 14, 2015

This is a very nice enhancement. Thanks!

@caub
Copy link

caub commented Dec 12, 2017

How to add this

{
    "linters": {
        "eslint": {
            "args": ["--stdin-filename", "@"]
        }
    }
}

in SublimeLinter.sublime-settings for example, to avoid a .sublimelinterrc file per project

anyway I can't seem to find a way to make eslint-plugin-import work with SublimeLinter (I use SublimeLinter-contrib-eslint_d with it).

Edit: import-js/eslint-plugin-import#540 made it

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

Successfully merging this pull request may close these issues.

3 participants