[英]How to configure Eslint indent rules for 3 space?
我喜歡使用我的 Javascript 文件縮進 3 個空格。 但是 Eslint 不喜歡這種方式,它給了我一些縮進警告。 我應該如何解決它?
當我們與團隊合作時,其他團隊成員可能會以不同的方式配置他們的編輯器和格式化程序。 在這種情況下我應該如何配置 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
評論澄清:
“我不使用更漂亮的”
你可以使用下面的代碼來配置它
"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 spaces
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.