【发布时间】:2020-08-27 15:18:18
【问题描述】:
我正在尝试对 React 应用程序进行一些更改,但我正在编译失败并给我这些错误
Expected indentation of 2 spaces but found 4 indent
Line 7:1: Expected indentation of 2 spaces but found 4 indent
Line 8:9: Expected indentation of 6 space characters but found 8 react/jsx-indent
Line 9:13: Expected indentation of 10 space characters but found 12 react/jsx-indent
Line 11:1: Expected indentation of 2 spaces but found 4 indent
如果我添加额外的空间,我什至会收到错误,请分享我如何删除这些限制。
【问题讨论】:
-
你要么改变 ESLINT 规则,要么改变你的编辑器设置 :)
-
@Eddy 尝试使用
npm run lint -- --fix修复您遇到的所有 ESLint 错误。