]> git.proxmox.com Git - pve-eslint.git/blame - eslint/docs/src/rules/space-return-throw-case.md
import 8.41.0 source
[pve-eslint.git] / eslint / docs / src / rules / space-return-throw-case.md
CommitLineData
8f9d1d4d
DC
1---
2title: space-return-throw-case
eb39fafa 3
8f9d1d4d
DC
4---
5
6Requires spaces after `return`, `throw`, and `case` keywords.
7
8(removed) This rule was **removed** in ESLint v2.0 and **replaced** by the [keyword-spacing](keyword-spacing) rule.
eb39fafa 9
f2a92ac6 10(fixable) The `--fix` option on the [command line](../use/command-line-interface#--fix) automatically fixed problems reported by this rule.
eb39fafa
DC
11
12Require spaces following `return`, `throw`, and `case`.
13
14## Rule Details
15
16Examples of **incorrect** code for this rule:
17
8f9d1d4d
DC
18::: incorrect
19
eb39fafa
DC
20```js
21/*eslint space-return-throw-case: "error"*/
22
23throw{a:0}
24
25function f(){ return-a; }
26
27switch(a){ case'a': break; }
28```
29
8f9d1d4d
DC
30:::
31
eb39fafa
DC
32Examples of **correct** code for this rule:
33
8f9d1d4d
DC
34::: correct
35
eb39fafa
DC
36```js
37/*eslint space-return-throw-case: "error"*/
38
39throw {a: 0};
40
41function f(){ return -a; }
42
43switch(a){ case 'a': break; }
44```
8f9d1d4d
DC
45
46:::