简体   繁体   中英

Eslint Error while working with Trails js

I am using Eslint to lint the code of my Trails.js project before testing it. Tails.js comes with existing pre-configurations eslint-config-trails . However, when I am testing my code eslint throws a Definition for rule 'no-global-assign' was not found error, for every .js file in my codebase.

Manually adding the rule:

"rules": {
  "no-global-assign": ["error", {"exceptions": ["Object"]}]
}

Doesn't fix the error. Setting the rule to "warn" makes me at least run the tests, but outputs a warning for every .js file.

The no-global-assign rule was added in ESLint 3.3.0 .

You need to use that version or later, if you want to use that rule.

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