]>
Commit | Line | Data |
---|---|---|
8f9d1d4d DC |
1 | --- |
2 | title: space-unary-word-ops | |
3 | layout: doc | |
eb39fafa | 4 | |
8f9d1d4d DC |
5 | --- |
6 | ||
7 | Requires spaces after unary word operators. | |
8 | ||
9 | (removed) This rule was **removed** in ESLint v0.10.0 and **replaced** by the [space-unary-ops](space-unary-ops) rule. | |
eb39fafa DC |
10 | |
11 | Require spaces following unary word operators. | |
12 | ||
13 | ## Rule Details | |
14 | ||
15 | Examples of **incorrect** code for this rule: | |
16 | ||
8f9d1d4d DC |
17 | ::: incorrect |
18 | ||
eb39fafa DC |
19 | ```js |
20 | typeof!a | |
21 | ``` | |
22 | ||
8f9d1d4d DC |
23 | ::: |
24 | ||
25 | ::: incorrect | |
26 | ||
eb39fafa DC |
27 | ```js |
28 | void{a:0} | |
29 | ``` | |
30 | ||
8f9d1d4d DC |
31 | ::: |
32 | ||
33 | ::: incorrect | |
34 | ||
eb39fafa DC |
35 | ```js |
36 | new[a][0] | |
37 | ``` | |
38 | ||
8f9d1d4d DC |
39 | ::: |
40 | ||
41 | ::: incorrect | |
42 | ||
eb39fafa DC |
43 | ```js |
44 | delete(a.b) | |
45 | ``` | |
46 | ||
8f9d1d4d DC |
47 | ::: |
48 | ||
eb39fafa DC |
49 | Examples of **correct** code for this rule: |
50 | ||
8f9d1d4d DC |
51 | ::: correct |
52 | ||
eb39fafa DC |
53 | ```js |
54 | delete a.b | |
55 | ``` | |
56 | ||
8f9d1d4d DC |
57 | ::: |
58 | ||
59 | ::: correct | |
60 | ||
eb39fafa DC |
61 | ```js |
62 | new C | |
63 | ``` | |
64 | ||
8f9d1d4d DC |
65 | ::: |
66 | ||
67 | ::: correct | |
68 | ||
eb39fafa DC |
69 | ```js |
70 | void 0 | |
71 | ``` | |
8f9d1d4d DC |
72 | |
73 | ::: |