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相关推荐

  1. 安装WebDriverAgent时,执行bootstrap.sh脚本报错提示:ERROR in ./js/app.js的解决方法

    在安装WebDriverAgent时,执行bootstrap.sh脚本阶段报错,报错信息如图: 解决步骤如下: 1.修改WebDriverAgent目录下的Inspector目录中的webpack.c ...

  2. vue3项目的创建和git提交规范,eslint ,cz,hooks

    ESLint Commitizen Git Hooks (--forece 强制安装)` vue create (项目文件名) 选择 'Manually celect features' //手动配置 ...

  3. 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 ...

  4. 【Git/GitHub/VSCode】Git提交时使用EMOJI表情、在VS Code中使用emoji commit

    文章目录 1. 为什么要使用emoji 2. emoji来源.用法和个人统一规范 3. VS Code中提交时使用emoji 这篇文章属于本人参考诸多博客.教程.文档等资料,所撰写的「玩转Git/Gi ...

  5. Git - 提交时没有权限解决方法

    Git - 提交时提示"Please make sure you have the correct access rights and the repository exists." ...

  6. eclipse中使用git提交时忽略不必要的文件

    @ eclipse中使用git提交时忽略不必要的文件 我们在eclipse中使用git提交代码时,如果没有添加任何过滤条件,那么会把所有文件都提交.但是实际上有些文件/目录并不需要提交,比如targe ...

  7. git提交时windows验证凭据

    git提交时,弹出windows凭据验证,输入账号密码无论对错,验证弹窗不再显示 修改,控制面板=>用户账户=>凭据管理器=>windows凭据

  8. eslint 验证vue文件 报错 unexpected token =解决方法

    eslint 验证vue文件 报错 unexpected token =解决方法 参考文章: (1)eslint 验证vue文件 报错 unexpected token =解决方法 (2)https: ...

  9. 在win10中,映射共享文件时,输入网络凭据总是报错

    在win10中,映射共享文件时,输入网络凭据总是报错 在配置好 linux samba 服务后, window10 访问samba文件共享服务失败 win + r 输入 \\192.168.8.111 ...

最新文章

  1. java 中线程的状态
  2. app每次更新版本时调用js代码提示用户下载更新
  3. 中兴c600olt数据配置_中兴天机Axon 10 Pro再掀波澜,4G版3199元起,5G版还有悬念?...
  4. 【HDU - 5094】 Maze (状态压缩+bfs)
  5. linux 系统错误表 和对应的数值
  6. recv函数返回0_函数VLOOKUP与LOOKUP的PK,大战一触即发 Excel神技能!
  7. 04-02 接口协议分析工具
  8. java docker 持续集成_最佳实战Docker持续集成图文详解
  9. fat linux 链接,FAT格式磁盘镜像制作方法
  10. 【读书笔记《Android游戏编程之从零开始》】9.游戏开发基础(如何快速的进入 Android 游戏开发)
  11. 计算机类和鼠标类是什么关系,什么是机械鼠标和光学鼠标?两者有什么区别?...
  12. python把英语句子成分字母_英语句子成分
  13. 可自定义存储数据总空间的的类int_128函数库
  14. 沪深股票接口如何获取所有股票代码?
  15. 使用Prometheus+Grafana监控MySQL
  16. 疑似苹果平板电脑规格表曝光
  17. 对HANA的认识与相关测试案例
  18. Lab: Password reset poisoning via middleware:通过中间件使密码重置中毒靶场复盘
  19. 游戏用户隐私协议《贪吃鱼进化》
  20. mac外接显示器 竖屏 黑苹果_借人气问一个黑苹果外接显示器的问题

热门文章

  1. 从0到1,从优秀到卓越,再到基业长青
  2. No registered route was found to handle ‘/login‘
  3. word调整页脚距离 顶端和低端的距离(叫页边距)
  4. 观黄梅戏《打猪草》有感
  5. 读计算机专业广东那间学校好,读计算机专业广东省中职3+2学校那个好
  6. 海信电视云账号连不上服务器,海信云账号如何使用?图文教程详解
  7. 高清壁纸软件 FreshBackMac for Mac 1.9.2免费版
  8. QMediaPlayer多媒体播放操作事项
  9. 爆破专栏丨Spring系列教程解决Spring Security环境中的跨域问题
  10. 微信无法打开网页下载链接的解决方案,微信跳转外部浏览器