I have installed ESLint, but as you know, it cannot check jQuery syntax. So I have npm installed:
.md
However, I cannot find ESLint's .eslintrc
file in order to edit it. According to the readme file, I should be adding this code to it:
{
"extends": "jquery"
}
How is this done?
I have installed ESLint, but as you know, it cannot check jQuery syntax. So I have npm installed:
https://github./jquery/eslint-config-jquery/blob/master/readme.md
However, I cannot find ESLint's .eslintrc
file in order to edit it. According to the readme file, I should be adding this code to it:
{
"extends": "jquery"
}
How is this done?
Share Improve this question asked Mar 21, 2017 at 1:28 WillowWillow 1,0402 gold badges10 silver badges21 bronze badges 8- eslint/docs/user-guide/… – user1106925 Commented Mar 21, 2017 at 1:32
- @squint, yea, I have been trying to make sense of that. That page is packed full. – Willow Commented Mar 21, 2017 at 1:35
-
@Willow Try
CTL-F
"jquery" on the manual page – Nick Zuber Commented Mar 21, 2017 at 1:38 - I cannot find ~/.eslintrc. Does that mean that I have setup global ESLint wrong? – Willow Commented Mar 21, 2017 at 1:39
- @NickZuber, when setting up with eslint --init, it does not allow jquery to be an environment. Only browser or node as radio options. – Willow Commented Mar 21, 2017 at 1:41
2 Answers
Reset to default 8according to latest update of ESLint, all you have to do is to add "jQuery" to your env and set it to True. { "env" : { "jquery": true }, }
I cannot find ESLint's .eslintrc file in order to edit it.
You simply create your own .eslintrc
in the root of your project, then you can add the following code to it:
{
"extends": "jquery"
}
You can read more about ESLint configuration files here.