小编spb*_*ile的帖子

ESLint美元($)未定义.(无为undef)

$("#ID").hide();
Run Code Online (Sandbox Code Playgroud)

我将ESLint添加到我的项目中.

一切都很好,除了符号$.

我收到错误: [eslint] '$' is not defined. (no-undef)

我的.eslintrc.json:

{
"env": {
    "browser": true,
    "commonjs": true,
    "es6": true
},
"extends": [
    "eslint:recommended"
],
"parserOptions": {
    "sourceType": "module"
},
"plugins": [
    "dollar-sign",
    "jquery"
],
"rules": {       
    "indent": [
        "error" ,
        "tab"
    ],
    "linebreak-style": [
        "error",
        "windows"
    ],
    "quotes": [
        "error",
        "double"
    ],
    "semi": [
        "error",
        "always"
    ],
    "jquery/no-ajax": 2,
    "jquery/no-animate": 2,
    "jquery/no-attr": 2,
    "jquery/no-bind": 2,
    "jquery/no-class": 2,
    "jquery/no-clone": 2,
    "jquery/no-closest": 2,
    "jquery/no-css": 2,
    "jquery/no-data": 2, …
Run Code Online (Sandbox Code Playgroud)

jquery eslint

73
推荐指数
4
解决办法
5万
查看次数

标签 统计

eslint ×1

jquery ×1