文档首页> 编译构建 CodeArts Build> 常见问题> Npm构建> eslint: error 'CLODOP' is not defined
更新时间:2022-04-29 GMT+08:00
分享

eslint: error 'CLODOP' is not defined

问题现象

执行Npm构建任务时,日志报如下异常信息:

Module Error (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):

***//public/LodopFuncs.js
  79:25  error  'getCLodop' is not defined  no-undef
  80:27  error  Empty block statement       no-empty
  89:21  error  'CLODOP' is not defined     no-undef

原因分析

如上异常报LodopFuncs.js文件中函数未声明is not defined,可先排查文件;文件正常则可能是不符合eslint规范导致报错。

处理方法

  1. 检查LodopFuncs.js文件中getCLodop函数是否已定义。
  2. 如果文件正常,可以在eslint检查不通过的文件头部添加如下命令行忽略eslint的检查。
    /* eslint-disable */
分享:

Npm构建 所有常见问题

more