Allen's blog Allen's blog
首页
面经
算法 (opens new window)
分类

Allen

前端CV工程师
首页
面经
算法 (opens new window)
分类
  • Javascript

  • TypeScript

  • CSS

  • Vue

  • React

  • 框架和构建工具

  • 工具库

  • 常见业务场景

  • Bug

    • backgroud-image背景图展示不出来
    • Vue基础组件库引入样式失效
    • 代码规范工具配置各种错误集合
      • 安装依赖提示could not determine executable to run
      • eslint配置了规则没有生效
      • 安装了插件eslint-plugin-vue,但是提示Cannot find module 'eslint-plugin-vue'
      • stylelint插件没有给代码标红
    • yarn link报错
    • mouseover等事件不触发
    • iframe在chrome浏览器无痕模式出错
    • execSync执行命令无效
    • 在nuxt项目中pnpm link加载不了模块
    • 启动web项目提示无端口权限
  • 项目实战

  • 前端
  • Bug
Allen
2023-03-27
目录

代码规范工具配置各种错误集合

# 安装依赖提示could not determine executable to run

$ husky install
'husky' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
1
2
3
4
5

安装了 husky@^7.0.4 就好了,版本太高太低都不好。

# eslint配置了规则没有生效

检查eslint报错:

  1. 按F1
  2. 输入eslint
  3. 选择show output channel

prettier同理,检查报错,首先将报错解决完,如果还是没有效果,就降级,如同husky一样,降级版本,我将eslint降级到^5.16.0后就生效了。

# 安装了插件eslint-plugin-vue,但是提示Cannot find module 'eslint-plugin-vue'

降低eslint版本就好了,^5.16.0就可以

# stylelint插件没有给代码标红

这个是由于stylelint插件不支持13及以上版本的stylelint,这里牵扯到很复杂的版本问题,我就没有折腾了,我使用的是"stylelint": "^12.0.1"、"stylelint-order": "4.0.0"。这两个版本搭配起来可以实现手动修复。

npx stylelint ./test.vue --fix
1
上次更新: 2023/12/16, 09:22:46
Vue基础组件库引入样式失效
yarn link报错

← Vue基础组件库引入样式失效 yarn link报错→

最近更新
01
rollup使用配置文件rollup.config.ts打包
12-08
02
package.json导出类型
12-08
03
关键问题方案
11-17
更多文章>
Theme by Vdoing | Copyright © 2023-2023 Allen | Github
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式