Closed godIsAProgrammer closed 4 years ago
当我使用typescript 3.7 新语法,git commit 的时候报错 使用代码如下:setSelectedRows( props.dataSource ?? [] );
错误如下: Commit failed with error 0 files committed, 1 file failed to commit: test husky > pre-commit (node v10.15.3)
> ant-design-pro@2.3.0 lint-staged /home/caoqisen/WorkSpace/VV-MERCHANT-FRONTEND-PC > lint-staged Stashing changes... [started] Stashing changes... [skipped] → No partially staged files found... Running linters... [started] Running tasks for **/*.{js,ts,tsx,json,jsx,less} [started] Running tasks for **/*.{js,jsx} [started] Running tasks for **/*.{js,jsx} [skipped] → No staged files match **/*.{js,jsx} node ./scripts/lint-prettier.js [started] node ./scripts/lint-prettier.js [failed] → Running tasks for **/*.{js,ts,tsx,json,jsx,less} [failed] → Running linters... [failed] ✖ node ./scripts/lint-prettier.js found some errors. Please fix them and try committing again. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ant-design-pro@2.3.0 lint-staged: `lint-staged` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ant-design-pro@2.3.0 lint-staged script. npm ERR! This is probably not a problem... (show balloon)
ant-design-pro: 2.3.0
看样子是 prettier 不支持你的新语法。需要等待社区适配完毕了
https://github.com/prettier/prettier/pull/6863
已经处理了,关注最新prettier 版本
感谢!
🧐 问题描述
当我使用typescript 3.7 新语法,git commit 的时候报错 使用代码如下:setSelectedRows( props.dataSource ?? [] );
错误如下: Commit failed with error 0 files committed, 1 file failed to commit: test husky > pre-commit (node v10.15.3)
🚑 其他信息
ant-design-pro: 2.3.0