爆红提醒:ESLint: Parsing error: Unexpected token. Did you mean `{‘>‘}` or `>`?

错误情况:=> 会爆红提示:ESLint: Parsing error: Unexpected token. Did you mean {'>'} or >?

typescript 复制代码
function().then((res) => {
    console.log(res.data);
}

解决方法:修改.eslintrc或者.eslintrc.js的配置

typescript 复制代码
module.exports = {
  // 其他配置...
  "parserOptions": {
    // 允许使用较新的 ECMAScript 特性
    "ecmaVersion": 2022,
    // 或者:
    "ecmaFeatures": {
     "jsx": false // 关闭JSX语法支持
   }
  },
};
相关推荐
时间的情敌10 分钟前
WebGIS + OpenLayers + GeoServer + PostGIS #量算 #点聚合
前端·geoserver·openlayers
不可能片场1 小时前
Electron 发布 cookie 库先查明文再写解密
前端·electron
郭小李1 小时前
springmvc 拦截器
java·开发语言·前端
web打印社区1 小时前
Chrome-kiosk-printing能上生产吗
开发语言·前端·javascript·chrome·websocket
白帽攻防录1 小时前
某pc客户端app从xss到rce实战案例
前端·网络安全·黑客·xss·rce·src漏洞·app漏洞
潇小墨1 小时前
我给自己造了一个桌面效率助手:剪贴板、截图提单、全盘文件搜索,全都塞进快捷键里
vue.js
志尊宝1 小时前
AI原生前端开发(041):AI辅助的状态管理(Zustand/Pinia)
前端·javascript·ai-native
修炼的dance1 小时前
pngquant 两档质量后接 oxipng,每步省多少花几秒
前端
费曼学习法1 小时前
无人值守AI内容矩阵实战(10):Windows 无 systemd,进程存活率 99% 怎么做
前端
小兔子2 小时前
Integer 的 == 在 100 时是 true,在 1000 时是 false
前端