MandyJin / MandyJin.github.io

靳莹莹的博客
https://mandyjin.github.io/
1 stars 0 forks source link

ESlint--各种不和谐记录 #9

Open MandyJin opened 6 years ago

MandyJin commented 6 years ago

为了漂亮的代码!!!

MandyJin commented 6 years ago

01、ESlint "window" is not defined, "document" is not defined

第一种:添加到 .eslintrc.js

module.exports = {
"globals": {
"window": true,
"document": true,
},
...
}

第二种:或者添加到 .eslintrc.js

module.exports = {
"env": {
"browser": true,
"node": true,
},
...
}

第三种:或者添加到 package.json:

"eslintConfig": {
"globals": {
"window": true
}
}