2***@qq.com
2***@qq.com
  • 发布:2022-07-22 11:30
  • 更新:2022-07-22 11:30
  • 阅读:644

#插件需求# 希望支持插件eslint-plugin-prettier,目前hbx里会报错找不到这个模块

分类:招聘与外包

安装了prettier,eslint-plugin-vue,eslint,这三个插件,vue项目开启了实时校验eslint,一保存就报错:

Error: Failed to load plugin 'prettier' declared in 'e:\vvan\project\ht_agent_mobile\.eslintrc.js': Cannot find module 'eslint-plugin-prettier'
// eslint配置  
module.exports = {  
  root: true,  
  env: {  
    node: true,  
  },  
  globals: {  
    $api: true,  
    $config: true,  
    $utils: true,  
  },  
  extends: [  
    "plugin:vue/essential",  
    "eslint:recommended",  
    "plugin:prettier/recommended",  
  ],  
  parserOptions: {  
    parser: "@babel/eslint-parser",  
    // 允许任意位置导入导出  
    // allowImportExportEverywhere: true,  
  },  
  // off 0 warn 1 error 2 - always never  
  rules: {  
    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",  
    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",  
    "no-unused-vars": "warn", // 未使用的变量,显示警告  
    semi: [2, "never"],  
    "prettier/prettier": [  
      "error",  
      {  
        semi: false,  
        // 忽略git的自动追加的CR 换行符号  
        endOfLine: "auto",  
        // 使结束标签不换行  
        htmlWhitespaceSensitivity: "ignore",  
      },  
    ],  
  },  
}  
2022-07-22 11:30 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复