]> git.proxmox.com Git - pve-eslint.git/blame - eslint/docs/rules/space-return-throw-case.md
import 8.3.0 source
[pve-eslint.git] / eslint / docs / rules / space-return-throw-case.md
CommitLineData
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
7Require spaces following `return`, `throw`, and `case`.
8
9## Rule Details
10
11Examples of **incorrect** code for this rule:
12
13```js
14/*eslint space-return-throw-case: "error"*/
15
16throw{a:0}
17
18function f(){ return-a; }
19
20switch(a){ case'a': break; }
21```
22
23Examples of **correct** code for this rule:
24
25```js
26/*eslint space-return-throw-case: "error"*/
27
28throw {a: 0};
29
30function f(){ return -a; }
31
32switch(a){ case 'a': break; }
33```