【工具】——【插件安装】—— 【升级】——【安装成功】
【工具】——【设置】——【插件配置】——勾选【启用时校验】——【打开文件.eslintrc.js进行配置】——添加校验规则——'quotes': [2, 'single'] , // 单引号
- 发布:2022-04-26 18:08
- 更新:2022-04-26 18:08
- 阅读:2786
产品分类: HbuilderX
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 11
HBuilderX版本号: 3.2.9
操作步骤:
预期结果:
页面定义变量
let city="北京"
从双引号变成单引号
页面定义变量
let city="北京"
从双引号变成单引号
实际结果:
Error: Failed to load plugin 'vue' declared in 'BaseConfig': Cannot find module 'eslint-plugin-vue'
Error: Failed to load plugin 'vue' declared in 'BaseConfig': Cannot find module 'eslint-plugin-vue'
bug描述:
把eslint-plugin-vue升级到1.1.5版本后启用校验报错:
[eslint-vue] 17:53:22.909 Error: Failed to load plugin 'vue' declared in 'BaseConfig': Cannot find module 'eslint-plugin-vue'
[eslint-vue] 17:53:22.914 Require stack:
[eslint-vue] 17:53:22.923 - D:\HBuilderX\HBuilderX\bin__placeholder__.js
[eslint-vue] 17:53:22.932 Referenced from: BaseConfig
[eslint-vue] 17:53:22.935 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
[eslint-vue] 17:53:22.936 at Function.resolve (internal/modules/cjs/helpers.js:80:19)
[eslint-vue] 17:53:22.937 at Object.resolve (D:\HBuilderX\HBuilderX\plugins\eslint-vue\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2325:46)
[eslint-vue] 17:53:22.940 at ConfigArrayFactory._loadPlugin (D:\HBuilderX\HBuilderX\plugins\eslint-vue\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3376:33)
[eslint-vue] 17:53:22.940 at ConfigArrayFactory._loadExtendedPluginConfig (D:\HBuilderX\HBuilderX\plugins\eslint-vue\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3196:29)
[eslint-vue] 17:53:22.941 at ConfigArrayFactory._loadExtends (D:\HBuilderX\HBuilderX\plugins\eslint-vue\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3117:29)
[eslint-vue] 17:53:22.943 at ConfigArrayFactory._normalizeObjectConfigDataBody (D:\HBuilderX\HBuilderX\plugins\eslint-vue\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3058:25)
[eslint-vue] 17:53:22.945 at _normalizeObjectConfigDataBody.next (<anonymous>)
[eslint-vue] 17:53:22.947 at ConfigArrayFactory._normalizeObjectConfigData (D:\HBuilderX\HBuilderX\plugins\eslint-vue\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3003:20)
[eslint-vue] 17:53:22.949 at _normalizeObjectConfigData.next (<anonymous>)
而且升级后在开发工具的【外部命令配置】里面缺少了【eslint-plugin-vue】和【eslint-js】