Index

space-return-throw-case

returnthrowcase 关键字之后需要空格。

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

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

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 中删除。