我在使用 eslit 的项目上有一个简单的配置
"rules": {
"indent": [2, 2, {"SwitchCase": 1}]
}
根据文档,第二个“2”是用于缩进的空格数(可以设置为 4 或 6 或“制表符”)。
第一个“2”怎么样?
Old documentation此处使用“2”,而 New documentation使用“错误”
"indent": ["error", "tab"]
两人都没有提及此事。这是做什么用的?
最佳答案
参见the general documentation for configuring rules :
- "off" or 0 - turn the rule off
- "warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
- "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
2 与“错误”相同。
关于javascript - eslint "indent"规则的第一个参数是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56836612/