space-return-throw-case

returnthrowcase 关键字后需要空格。

¥Requires spaces after return, throw, and case keywords.

(可修复)命令行 上的 --fix 选项自动修复了此规则报告的问题。

¥(fixable) The --fix option on the command line automatically fixed problems reported by this rule.

returnthrowcase 后面需要空格。

¥Require spaces following return, throw, and case.

规则详情

¥Rule Details

此规则的错误代码示例:

¥Examples of incorrect code for this rule:

/*eslint space-return-throw-case: "error"*/

throw{a:0}

function f(){ return-a; }

switch(a){ case'a': break; }

此规则的正确代码示例:

¥Examples of correct code for this rule:

/*eslint space-return-throw-case: "error"*/

throw {a: 0};

function f(){ return -a; }

switch(a){ case 'a': break; }

版本

此规则是在 ESLint v0.1.4 中引入,并在 v2.0.0-beta.3 中删除。