I added ESLint to my chrome extension project. I am using chrome API which starts with chrome.
, but obviously eslint points on it as error.
I suppose it should be something like:
"env": {
"browser": true,
"chrome": true,
"es6": true
},
but apparently it's not.
UPD: I would consider best answer is to add webextensions: true
– as wOxxOm suggested. Because it's a chrome extension - chrome.
API is heavily used here.
Otherwise adding /* global chrome */
as other suggested would work better.
Thanks for answers.
question from:
https://stackoverflow.com/questions/48584556/eslint-chrome-is-not-defined-no-undef 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…