Skip to content

eslint忽略全局变量的方法 #56

Open

Description

@artdong

eslint忽略全局变量的方法

Activity

  1. artdong commented on Apr 27, 2020

    @artdong
    CollaboratorAuthor
    1. 找到.eslintrc.js,添加
    "globals": {
      "你的全局变量": true
    }
    
    1. 直接粗暴的方式注释法(不推荐)
    /* global 你的全局变量 */
    
    1. 特殊的,如jest、mocha
     "env": {
            "es6": true,
            "node": true,
            "mocha": true,
            "jest": true
        },
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions