我喜欢使用我的Javascript文件缩进到3个空格。但埃斯林特不喜欢这种方式,它给了我一些缩进警告。我该怎么修呢?
当我们与团队一起工作时,其他团队成员可能会以不同的方式配置他们的编辑器和格式化程序。在这种情况下,我应该如何配置Eslint?如果我不希望Eslit给我任何缩进错误怎么办。
error Expected indentation of 2 spaces but found 3
warning Expected indentation of 2 spaces but found 3 spaces
warning Expected indentation of 4 spaces but found 6 spaces
warning Expected indentation of 4 spaces but found 6 spaces
warning Expected indentation of 2 spaces but found 3 spaces评论中作出的澄清:
“我不会用更漂亮的”
发布于 2021-12-30 11:31:57
您可以使用下面的代码来配置它
"indent": ["error", 4] // Indent with 4 spaces
"react/jsx-indent": ["error", 4] // Indent JSX with 4 spaces
"react/jsx-indent-props": ["error", 4] // Indent props with 4 spaceshttps://stackoverflow.com/questions/70530897
复制相似问题