ESLint "code" vs "whitespace" 可修复值
ESLint "code" vs "whitespace" values for fixable
当 rule is defined to be fixable 时,应指定 fixable
键,它可以具有 code
或 whitespace
值:
fixable
(string) is either "code" or "whitespace" if the --fix
option on the command line automatically fixes problems reported by the rule
这些值之间有什么区别,whitespace
的具体用途是什么?
目前 ESLint 不会将这些值用于任何事情(除了 fixable
属性 下存在的任何值)。这是为了将来使用。例如,在某些时候,ESLint 可能会提供一种仅修复空白规则或仅修复代码的方法。
目前 "whitespace" 应该用于处理间距(缩进、属性之间的间距等)的任何规则,其他所有内容都标记为 "code"。
当 rule is defined to be fixable 时,应指定 fixable
键,它可以具有 code
或 whitespace
值:
fixable
(string) is either "code" or "whitespace" if the--fix
option on the command line automatically fixes problems reported by the rule
这些值之间有什么区别,whitespace
的具体用途是什么?
目前 ESLint 不会将这些值用于任何事情(除了 fixable
属性 下存在的任何值)。这是为了将来使用。例如,在某些时候,ESLint 可能会提供一种仅修复空白规则或仅修复代码的方法。
目前 "whitespace" 应该用于处理间距(缩进、属性之间的间距等)的任何规则,其他所有内容都标记为 "code"。