1
1
-- -
2
2
source : crates / rome_js_analyze / tests / spec_tests .rs
3
+ assertion_line : 89
3
4
expression : noImplicitBoolean .jsx
4
5
-- -
5
6
# Input
@@ -10,6 +11,8 @@ expression: noImplicitBoolean.jsx
10
11
<input disabled = { 0 } />;
11
12
<input disabled = { undefined } />;
12
13
<input disabled = " false" />;
14
+ // https://github.com/rome/tools/issues/2944
15
+ <div className = { asdf asdf } />;
13
16
14
17
//invalid
15
18
<input disabled />;
@@ -21,57 +24,57 @@ expression: noImplicitBoolean.jsx
21
24
# Diagnostics
22
25
` ` `
23
26
warning[jsx/noImplicitBoolean]: Use explicit boolean values for boolean JSX props.
24
- ┌─ noImplicitBoolean.jsx:9 :8
25
- │
26
- 9 │ <input disabled />;
27
- │ --------
27
+ ┌─ noImplicitBoolean.jsx:11 :8
28
+ │
29
+ 11 │ <input disabled />;
30
+ │ --------
28
31
29
32
Safe fix: Add explicit ` true ` literal for this attribute
30
- | @@ -6 ,6 +6 ,6 @@
31
- 5 5 | <input disabled = " false " />;
32
- 6 6 |
33
- 7 7 | //invalid
34
- 8 | - <input disabled />;
35
- 8 | + <input disabled = { true } />;
36
- 9 9 | <input accept /** some comment */ />;
37
- 10 10 | <input /** some comment */ accept />;
33
+ | @@ -8 ,6 +8 ,6 @@
34
+ 7 7 | <div className = { asdf asdf } />;
35
+ 8 8 |
36
+ 9 9 | //invalid
37
+ 10 | - <input disabled />;
38
+ 10 | + <input disabled = { true } />;
39
+ 11 11 | <input accept /** some comment */ />;
40
+ 12 12 | <input /** some comment */ accept />;
38
41
39
42
40
43
` ` `
41
44
42
45
` ` `
43
46
warning[jsx/noImplicitBoolean]: Use explicit boolean values for boolean JSX props.
44
- ┌─ noImplicitBoolean.jsx:10 :8
47
+ ┌─ noImplicitBoolean.jsx:12 :8
45
48
│
46
- 10 │ <input accept /** some comment */ />;
49
+ 12 │ <input accept /** some comment */ />;
47
50
│ ------
48
51
49
52
Safe fix: Add explicit ` true ` literal for this attribute
50
- | @@ -7 ,5 +7 ,5 @@
51
- 6 6 |
52
- 7 7 | //invalid
53
- 8 8 | <input disabled />;
54
- 9 | - <input accept /** some comment */ />;
55
- 9 | + <input accept = { true } /** some comment */ />;
56
- 10 10 | <input /** some comment */ accept />;
53
+ | @@ -9 ,5 +9 ,5 @@
54
+ 8 8 |
55
+ 9 9 | //invalid
56
+ 10 10 | <input disabled />;
57
+ 11 | - <input accept /** some comment */ />;
58
+ 11 | + <input accept = { true } /** some comment */ />;
59
+ 12 12 | <input /** some comment */ accept />;
57
60
58
61
59
62
` ` `
60
63
61
64
` ` `
62
65
warning[jsx/noImplicitBoolean]: Use explicit boolean values for boolean JSX props.
63
- ┌─ noImplicitBoolean.jsx:11 :28
66
+ ┌─ noImplicitBoolean.jsx:13 :28
64
67
│
65
- 11 │ <input /** some comment */ accept />;
68
+ 13 │ <input /** some comment */ accept />;
66
69
│ ------
67
70
68
71
Safe fix: Add explicit ` true ` literal for this attribute
69
- | @@ -8 ,4 +8 ,4 @@
70
- 7 7 | //invalid
71
- 8 8 | <input disabled />;
72
- 9 9 | <input accept /** some comment */ />;
73
- 10 | - <input /** some comment */ accept />;
74
- 10 | + <input /** some comment */ accept = { true } />;
72
+ | @@ -10 ,4 +10 ,4 @@
73
+ 9 9 | //invalid
74
+ 10 10 | <input disabled />;
75
+ 11 11 | <input accept /** some comment */ />;
76
+ 12 | - <input /** some comment */ accept />;
77
+ 12 | + <input /** some comment */ accept = { true } />;
75
78
76
79
77
80
` ` `
0 commit comments