]>
Commit | Line | Data |
---|---|---|
eb39fafa DC |
1 | # space-return-throw-case: require spaces after `return`, `throw`, and `case` keywords |
2 | ||
3 | (removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing.md) rule. | |
4 | ||
609c276f | 5 | (fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#--fix) automatically fixed problems reported by this rule. |
eb39fafa DC |
6 | |
7 | Require spaces following `return`, `throw`, and `case`. | |
8 | ||
9 | ## Rule Details | |
10 | ||
11 | Examples of **incorrect** code for this rule: | |
12 | ||
13 | ```js | |
14 | /*eslint space-return-throw-case: "error"*/ | |
15 | ||
16 | throw{a:0} | |
17 | ||
18 | function f(){ return-a; } | |
19 | ||
20 | switch(a){ case'a': break; } | |
21 | ``` | |
22 | ||
23 | Examples of **correct** code for this rule: | |
24 | ||
25 | ```js | |
26 | /*eslint space-return-throw-case: "error"*/ | |
27 | ||
28 | throw {a: 0}; | |
29 | ||
30 | function f(){ return -a; } | |
31 | ||
32 | switch(a){ case 'a': break; } | |
33 | ``` |