ESlint是一个用于javascript框架的可插拔的linter工具
它用于提高代码质量和代码一致性,减少代码中的错误
在本教程中,学习如何在以下情况下禁用它
1.代码行 -- 屏蔽语法规范检查
/* eslint-disable-next-line no-async-promise-executor */
/* eslint-disable-next-line no-undef */
/* eslint-disable-next-line no-async-promise-executor no-undef */
或者
/* eslint-disable-next-line */
如下,
//地图点击事件、定位图标拖拽移动事件
getClickInfo(e) {
const that = this
this.center.lng = e.point.lng
this.center.lat = e.point.lat
// eslint-disable-next-line no-undef
var geoc = new BMap.Geocoder()
geoc.getLocation(e.point, function(rs) {
var addComp = rs.addressComponents
const addr = addComp.provin