【发布时间】:2018-10-10 18:20:44
【问题描述】:
https://github.com/openlayers/eslint-config-openlayers
按照此处的说明,我执行了以下操作。
在终端中我发出了这个命令:
npm install eslint eslint-config-openlayers --save-dev
然后我编辑了 .eslintrc.json 文件:
{
"extends": [
"openlayers",
"airbnb-base"
],
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
}
}
然而,我仍然收到来自 ESLint 的与 OpenLayers 相关的错误。例如,
'ol' is not defined. (no-undef)
【问题讨论】:
-
在哪里?你能显示文件吗?
-
并尝试在 airbnb-base 之后导入 openlayers,以便以 openlayers 设置为准。
-
是 TypeScript 吗?还是你在使用 webpack?如果其中之一,您是否导入/需要“ol”?
标签: visual-studio-code openlayers eslint