Skip to content

Commit 452c299

Browse files
authored
Improve the style for showing fail/pass examples (#2529)
1 parent 1cbc561 commit 452c299

File tree

3 files changed

+34
-35
lines changed

3 files changed

+34
-35
lines changed

.github/ISSUE_TEMPLATE/rule_change.yml

+8-14
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,25 @@ body:
2121
validations:
2222
required: true
2323
attributes:
24-
label: Fail
25-
description: Specify examples of code that should be detected.
24+
label: Examples
25+
description: Provide examples of code to detect and the acceptable alternatives.
2626
value: |
2727
```js
28+
// ❌
2829
var replace = 'me';
30+
31+
// ✅
32+
const replace = 'me';
2933
```
3034
3135
```js
36+
// ❌
3237
function foo() {
3338
var replace = 'me';
3439
return replace;
3540
}
36-
```
37-
- type: textarea
38-
validations:
39-
required: true
40-
attributes:
41-
label: Pass
42-
description: Specify examples of code that would be accepted in its place.
43-
value: |
44-
```js
45-
const replace = 'me';
46-
```
4741
48-
```js
42+
// ✅
4943
function foo() {
5044
return 'me';
5145
}

.github/ISSUE_TEMPLATE/rule_proposal.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,27 @@ body:
2020
validations:
2121
required: true
2222
attributes:
23-
label: Fail
24-
description: Specify examples of code that should be detected
23+
label: Examples
24+
description: Provide examples of code to detect and the acceptable alternatives.
2525
value: |
2626
```js
27+
// ❌
2728
var replace = 'me';
29+
30+
// ✅
31+
const replace = 'me';
2832
```
2933
3034
```js
35+
// ❌
3136
function foo() {
32-
var replace = 'me';
33-
return replace;
37+
var replace = 'me';
38+
return replace;
3439
}
35-
```
36-
- type: textarea
37-
validations:
38-
required: true
39-
attributes:
40-
label: Pass
41-
description: Specify examples of code that would be accepted in its place
42-
value: |
43-
```js
44-
const replace = 'me';
45-
```
4640
47-
```js
41+
// ✅
4842
function foo() {
49-
return 'me';
43+
return 'me';
5044
}
5145
```
5246
- type: input

scripts/template/documentation.md.jst

+15-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33

44
<!-- Remove this comment, add more detailed description. -->
55

6-
## Fail
6+
## Examples
77

88
```js
9+
// ❌
910
const foo = 'unicorn';
10-
```
1111

12-
## Pass
12+
// ✅
13+
const foo = '🦄';
14+
```
1315

1416
```js
15-
const foo = '🦄';
17+
// ❌
18+
function foo() {
19+
var replace = 'me';
20+
return replace;
21+
}
22+
23+
// ✅
24+
function foo() {
25+
return 'me';
26+
}
1627
```

0 commit comments

Comments
 (0)