Skip to content

Commit f7633cd

Browse files
authored
Add demos to readmes (#16)
1 parent 0e5bf1c commit f7633cd

File tree

22 files changed

+152
-248
lines changed

22 files changed

+152
-248
lines changed

packages/eslint-formatter-checkstyle/expected-out

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/eslint-formatter-checkstyle/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
> ESLint's `checkstyle` formatter as a standalone package
44
5-
## Links
5+
## Demo
66

7-
- [Formatter output example](examples)
8-
- [Source code](https://github.com/fregante/eslint-formatters/tree/main/packages/eslint-formatter-checkstyle)
9-
- [npm package contents](https://www.unpkg.com/browse/eslint-formatter-checkstyle/)
7+
```xml
8+
<?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3"><file name="foo.js"><error line="5" column="10" severity="error" message="Unexpected foo. (foo)" source="eslint.rules.foo" /></file><file name="bar.js"><error line="6" column="11" severity="warning" message="Unexpected bar. (bar)" source="eslint.rules.bar" /></file><file name="baz.js"><error line="1" column="1" severity="error" message="Fatal error parsing file." source="" /></file></checkstyle>
9+
```

packages/eslint-formatter-compact/expected-out

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/eslint-formatter-compact/readme.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
> ESLint's `compact` formatter as a standalone package
44
5-
## Links
5+
## Demo
66

7-
- [Formatter output example](examples)
8-
- [Source code](https://github.com/fregante/eslint-formatters/tree/main/packages/eslint-formatter-compact)
9-
- [npm package contents](https://www.unpkg.com/browse/eslint-formatter-compact/)
7+
```
8+
foo.js: line 5, col 10, Error - Unexpected foo. (foo)
9+
bar.js: line 6, col 11, Warning - Unexpected bar. (bar)
10+
baz.js: line 1, col 1, Error - Fatal error parsing file.
11+
12+
3 problems
13+
```

packages/eslint-formatter-jslint-xml/expected-out

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/eslint-formatter-jslint-xml/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
> ESLint's `jslint-xml` formatter as a standalone package
44
5-
## Links
5+
## Demo
66

7-
- [Formatter output example](examples)
8-
- [Source code](https://github.com/fregante/eslint-formatters/tree/main/packages/eslint-formatter-jslint-xml)
9-
- [npm package contents](https://www.unpkg.com/browse/eslint-formatter-jslint-xml/)
7+
```xml
8+
<?xml version="1.0" encoding="utf-8"?><jslint><file name="foo.js"><issue line="5" char="10" evidence="" reason="Unexpected foo. (foo)" /></file><file name="bar.js"><issue line="6" char="11" evidence="" reason="Unexpected bar. (bar)" /></file><file name="baz.js"><issue line="1" char="1" evidence="" reason="Fatal error parsing file." /></file></jslint>
9+
```

packages/eslint-formatter-json-with-metadata/expected-out

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/eslint-formatter-json-with-metadata/readme.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,35 @@
22

33
> ESLint's `json-with-metadata` formatter as a standalone package
44
5-
## Links
5+
## Demo
66

7-
- [Formatter output example](examples)
8-
- [Source code](https://github.com/fregante/eslint-formatters/tree/main/packages/eslint-formatter-json-with-metadata)
9-
- [npm package contents](https://www.unpkg.com/browse/eslint-formatter-json-with-metadata/)
7+
```json
8+
{
9+
"results": [
10+
{
11+
"filePath": "foo.js",
12+
"messages": [{"message": "Unexpected foo.", "severity": 2, "line": 5, "column": 10, "ruleId": "foo"}],
13+
"errorCount": 1,
14+
"warningCount": 0,
15+
"fixableErrorCount": 0,
16+
"fixableWarningCount": 0
17+
},
18+
{
19+
"filePath": "bar.js",
20+
"messages": [{"message": "Unexpected bar.", "severity": 1, "line": 6, "column": 11, "ruleId": "bar"}],
21+
"errorCount": 0,
22+
"warningCount": 1,
23+
"fixableErrorCount": 0,
24+
"fixableWarningCount": 0
25+
},
26+
{
27+
"filePath": "baz.js",
28+
"messages": [{"message": "Fatal error parsing file.", "severity": 2, "fatal": true, "line": 1, "column": 1, "ruleId": null}],
29+
"errorCount": 1,
30+
"warningCount": 0,
31+
"fixableErrorCount": 0,
32+
"fixableWarningCount": 0
33+
}
34+
]
35+
}
36+
```

packages/eslint-formatter-json/expected-out

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/eslint-formatter-json/readme.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,33 @@
22

33
> ESLint's `json` formatter as a standalone package
44
5-
## Links
5+
## Demo
66

7-
- [Formatter output example](examples)
8-
- [Source code](https://github.com/fregante/eslint-formatters/tree/main/packages/eslint-formatter-json)
9-
- [npm package contents](https://www.unpkg.com/browse/eslint-formatter-json/)
7+
```json
8+
[
9+
{
10+
"filePath": "foo.js",
11+
"messages": [{"message": "Unexpected foo.", "severity": 2, "line": 5, "column": 10, "ruleId": "foo"}],
12+
"errorCount": 1,
13+
"warningCount": 0,
14+
"fixableErrorCount": 0,
15+
"fixableWarningCount": 0
16+
},
17+
{
18+
"filePath": "bar.js",
19+
"messages": [{"message": "Unexpected bar.", "severity": 1, "line": 6, "column": 11, "ruleId": "bar"}],
20+
"errorCount": 0,
21+
"warningCount": 1,
22+
"fixableErrorCount": 0,
23+
"fixableWarningCount": 0
24+
},
25+
{
26+
"filePath": "baz.js",
27+
"messages": [{"message": "Fatal error parsing file.", "severity": 2, "fatal": true, "line": 1, "column": 1, "ruleId": null}],
28+
"errorCount": 1,
29+
"warningCount": 0,
30+
"fixableErrorCount": 0,
31+
"fixableWarningCount": 0
32+
}
33+
]
34+
```

0 commit comments

Comments
 (0)