git提交时由于eslint的检测机制报错:npm run lint-staged:js found some errors
git提交时报了两条错误:
1、stylelint --syntax less found some errors. Please fix them and try committing again
2、npm run lint-staged:js found some errors. Please fix them and try committing again.
husky > pre-commit (node v10.15.3)> ant-design-pro@1.0.0 lint-staged:js E:\wanghx\react-antd-pro
> eslint --ext .js,.jsx,.ts,.tsx "E:/wanghx/react-antd-pro/config/config.js" "E:/wanghx/react-antd-pro/config/router.config.js" "E:/wanghx/react-antd-pro/src/locales/zh-CN/menu.js" "E:/wanghx/react-antd-pro/src/pages/Table/TableEditRow/index.jsx" "E:/wanghx/react-antd-pro/src/pages/Table/TablePagination/components/Table1/index.jsx" "E:/wanghx/react-antd-pro/src/pages/Table/TablePagination/components/Table2/index.jsx" "E:/wanghx/react-antd-pro/src/pages/Table/TablePagination/index.jsx"E:\wanghx\react-antd-pro\config\config.js
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to overrideE:\wanghx\react-antd-pro\config\router.config.js
0:0 warning File ignored because of a matching ignore pattern. Use "--no-ignore" to overrideE:\wanghx\react-antd-pro\src\pages\Table\TablePagination\index.jsx4:10 warning 'FormattedMessage' is defined but never used @typescript-eslint/no-unused-vars8:28 error Curly braces are unnecessary here react/jsx-curly-brace-presence9:17 error Curly braces are unnecessary here react/jsx-curly-brace-presence
19:17 error Curly braces are unnecessary here react/jsx-curly-brace-presence6 problems (3 errors, 3 warnings)
3 errors and 0 warnings potentially fixable with the `--fix` option.npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ant-design-pro@1.0.0 lint-staged:js: `eslint --ext .js,.jsx,.ts,.tsx "E:/wanghx/react-antd-pro/config/config.js" "E:/wanghx/react-antd-pro/config/router.config.js" "E:/wanghx/react-antd-pro/src/locales/zh-CN/menu.js" "E:/wanghx/react-antd-pro/src/pages/Table/TableEditRow/index.jsx" "E:/wanghx/react-antd-pro/src/pages/Table/TablePagination/components/Table1/index.jsx" "E:/wanghx/react-antd-pro/src/pages/Table/TablePagination/components/Table2/index.jsx" "E:/wanghx/react-antd-pro/src/pages/Table/TablePagination/index.jsx"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ant-design-pro@1.0.0 lint-staged:js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\wanghongxuan\AppData\Roaming
pm-cache\_logs\2019-09-19T01_11_04_263Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ant-design-pro@1.0.0 lint-staged: `lint-staged`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ant-design-pro@1.0.0 lint-staged script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\wanghongxuan\AppData\Roaming\npm-cache\_logs\2019-09-19T01_11_04_311Z-debug.log
husky > pre-commit hook failed (add --no-verify to bypass)
这两个错误都是由一个原因引起的,那便是git提交时的检测代码规范机制,详情请点击以下链接:
git commit前检测husky与pre-commit
第一种解决方案,在提交时加入 --no-verify参数,用来跳过检测机制,输入以下命令:
git commit --no-verify -m "提交时的注释"
另一种解决方案:
找到根目录中的.eslintignore文件,将src放入其中,以便git提交时跳过src目录中所有文件的eslint检测机制。如下
build/*.js
public
dist
src
git提交时由于eslint的检测机制报错:npm run lint-staged:js found some errors相关推荐
- 安装WebDriverAgent时,执行bootstrap.sh脚本报错提示:ERROR in ./js/app.js的解决方法
在安装WebDriverAgent时,执行bootstrap.sh脚本阶段报错,报错信息如图: 解决步骤如下: 1.修改WebDriverAgent目录下的Inspector目录中的webpack.c ...
- vue3项目的创建和git提交规范,eslint ,cz,hooks
ESLint Commitizen Git Hooks (--forece 强制安装)` vue create (项目文件名) 选择 'Manually celect features' //手动配置 ...
- Git提交时提示‘The file will have its original line endings in your working directory’
Git提交时提示'The file will have its original line endings in your working directory' Git出现错误 git add -A ...
- 【Git/GitHub/VSCode】Git提交时使用EMOJI表情、在VS Code中使用emoji commit
文章目录 1. 为什么要使用emoji 2. emoji来源.用法和个人统一规范 3. VS Code中提交时使用emoji 这篇文章属于本人参考诸多博客.教程.文档等资料,所撰写的「玩转Git/Gi ...
- Git - 提交时没有权限解决方法
Git - 提交时提示"Please make sure you have the correct access rights and the repository exists." ...
- eclipse中使用git提交时忽略不必要的文件
@ eclipse中使用git提交时忽略不必要的文件 我们在eclipse中使用git提交代码时,如果没有添加任何过滤条件,那么会把所有文件都提交.但是实际上有些文件/目录并不需要提交,比如targe ...
- git提交时windows验证凭据
git提交时,弹出windows凭据验证,输入账号密码无论对错,验证弹窗不再显示 修改,控制面板=>用户账户=>凭据管理器=>windows凭据
- eslint 验证vue文件 报错 unexpected token =解决方法
eslint 验证vue文件 报错 unexpected token =解决方法 参考文章: (1)eslint 验证vue文件 报错 unexpected token =解决方法 (2)https: ...
- 在win10中,映射共享文件时,输入网络凭据总是报错
在win10中,映射共享文件时,输入网络凭据总是报错 在配置好 linux samba 服务后, window10 访问samba文件共享服务失败 win + r 输入 \\192.168.8.111 ...
最新文章
- java 中线程的状态
- app每次更新版本时调用js代码提示用户下载更新
- 中兴c600olt数据配置_中兴天机Axon 10 Pro再掀波澜,4G版3199元起,5G版还有悬念?...
- 【HDU - 5094】 Maze (状态压缩+bfs)
- linux 系统错误表 和对应的数值
- recv函数返回0_函数VLOOKUP与LOOKUP的PK,大战一触即发 Excel神技能!
- 04-02 接口协议分析工具
- java docker 持续集成_最佳实战Docker持续集成图文详解
- fat linux 链接,FAT格式磁盘镜像制作方法
- 【读书笔记《Android游戏编程之从零开始》】9.游戏开发基础(如何快速的进入 Android 游戏开发)
- 计算机类和鼠标类是什么关系,什么是机械鼠标和光学鼠标?两者有什么区别?...
- python把英语句子成分字母_英语句子成分
- 可自定义存储数据总空间的的类int_128函数库
- 沪深股票接口如何获取所有股票代码?
- 使用Prometheus+Grafana监控MySQL
- 疑似苹果平板电脑规格表曝光
- 对HANA的认识与相关测试案例
- Lab: Password reset poisoning via middleware:通过中间件使密码重置中毒靶场复盘
- 游戏用户隐私协议《贪吃鱼进化》
- mac外接显示器 竖屏 黑苹果_借人气问一个黑苹果外接显示器的问题
热门文章
- 从0到1,从优秀到卓越,再到基业长青
- No registered route was found to handle ‘/login‘
- word调整页脚距离 顶端和低端的距离(叫页边距)
- 观黄梅戏《打猪草》有感
- 读计算机专业广东那间学校好,读计算机专业广东省中职3+2学校那个好
- 海信电视云账号连不上服务器,海信云账号如何使用?图文教程详解
- 高清壁纸软件 FreshBackMac for Mac 1.9.2免费版
- QMediaPlayer多媒体播放操作事项
- 爆破专栏丨Spring系列教程解决Spring Security环境中的跨域问题
- 微信无法打开网页下载链接的解决方案,微信跳转外部浏览器