fab variant 将被移除
报错或提示:
1 | Warning: Failed prop type: The `fab` variant will be removed in the next major release. The `<Fab>` component is equivalent and should be used instead. |
通常出现在头部组件里,例如 app/components/Header/Header.js。
原写法:
1 | import Button from '@material-ui/core/Button' |
替换为:
1 | import Fab from '@material-ui/core/Fab' |
DLL manifest 缺失
报错:
1 | The DLL manifest is missing. Please run `npm run build:dll`. |
处理方式:
1 | npm run build:dll |
如果是安装依赖后出现,也要确认依赖是否安装在正确项目里。历史处理里曾经用过全局安装,例如:
1 | npm i -g @fortawesome/react-fontawesome |
不过更推荐优先把依赖写入当前项目的 package.json。
文件末尾缺少空行
报错:
1 | Module Error (from ./node_modules/eslint-loader/index.js): |
处理方式:
在提示文件末尾补一个空行,保存后重新运行检查。
CRLF 和 LF 换行不一致
报错:
1 | error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style |
处理方式:
在 .eslintrc.js 的 rules 中调整换行规则:
1 | module.exports = { |
如果团队成员同时使用 Windows 和 macOS,更建议配合 .editorconfig 统一换行。
本文早期发布于个人 CSDN 博客:查看原文