简体   繁体   中英

How to setup jQuery within ESLint?

I have installed ESLint, but as you know, it cannot check jQuery syntax. So I have npm installed:

https://github.com/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?

according 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM