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

Using local eslint, not global #197

Closed
BasixKOR opened this issue Feb 5, 2017 · 6 comments
Closed

Using local eslint, not global #197

BasixKOR opened this issue Feb 5, 2017 · 6 comments
Labels
info-needed Issue requires more information from poster

Comments

@BasixKOR
Copy link

BasixKOR commented Feb 5, 2017

I installed eslint in global and local workspace. but I want to use local eslint in this extension. Is there any options about it?

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Feb 6, 2017
@dbaeumer
Copy link
Member

dbaeumer commented Feb 6, 2017

ESLint always prefers a local installed version over a global installed one. Can you provide a workspace that demonstrate the problem since I am not able to reproduce this locally.

@BasixKOR
Copy link
Author

BasixKOR commented Feb 6, 2017

Well.. It was just my mistake. Sorry!

@BasixKOR BasixKOR closed this as completed Feb 6, 2017
@fedegos
Copy link

fedegos commented Mar 28, 2017

I'm having the same problem. The eslint command in the terminal is running from global location, not local. I'm using vscode version 1.10.2 and eslint extension 1.2.8.

@dbaeumer
Copy link
Member

The eslint command in the terminal is honor your path setting which very likely point to the global one. You can always run the local one using .\node_modules\.bin\eslint

@fedegos
Copy link

fedegos commented Mar 28, 2017

Thanks! That worked.

I defined the following task for running eslint:

{
    "version": "0.1.0",
    "command": "cmd",    
    "isShellCommand": true,
    "args": [ "/C" ],
    "tasks": [
        {
            "taskName": "eslint",
            "suppressTaskName": true,
            "args": [
                "${workspaceRoot}/node_modules/.bin/eslint ."                  
            ],            
            "problemMatcher": [
                "$eslint-stylish"   
            ]
        }
    ]
}

Could you confirm if this is correct? I couldn't find any documentation on creating a task for this extension.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 4, 2017

I updated the doc to provide an example for an eslint task. It looks like this

{
	"version": "0.1.0",
	"windows": {
		"command": ".\\node_modules\\.bin\\eslint"
	},
	"linux": {
		"command": "./node_modules/.bin/eslint"
	},
	"osx": {
		"command": "./node_modules/.bin/eslint"
	},
	"isShellCommand": true,
	"args": ["*.js"],
	"showOutput": "silent",
	"problemMatcher": "$eslint-stylish"
}

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants