@darksheep/eslint-formatter-github 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +40 -2
- package/package.json +4 -4
- package/src/index.js +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.2.1](https://github.com/DarkSheepSoftware/node-packages/compare/eslint-formatter-github-v2.2.0...eslint-formatter-github-v2.2.1) (2026-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 📚 Documentation
|
|
7
|
+
|
|
8
|
+
* Update the READMEs ([#824](https://github.com/DarkSheepSoftware/node-packages/issues/824)) ([9d282b7](https://github.com/DarkSheepSoftware/node-packages/commit/9d282b724fe056ec275578088bf495985e22c25f))
|
|
9
|
+
|
|
10
|
+
## [2.2.0](https://github.com/DarkSheepSoftware/node-packages/compare/eslint-formatter-github-v2.1.0...eslint-formatter-github-v2.2.0) (2025-10-09)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🌟 Features
|
|
14
|
+
|
|
15
|
+
* Support node 24 ([#761](https://github.com/DarkSheepSoftware/node-packages/issues/761)) ([f13caae](https://github.com/DarkSheepSoftware/node-packages/commit/f13caaef978c7a657e4599f775e0a62d1738f475))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Dependencies
|
|
19
|
+
|
|
20
|
+
* The following workspace dependencies were updated
|
|
21
|
+
* dependencies
|
|
22
|
+
* @darksheep/github-actions bumped from 2.0.9 to 2.1.0
|
|
23
|
+
* @darksheep/package.json bumped from 3.0.1 to 3.1.0
|
|
24
|
+
|
|
3
25
|
## [2.1.0](https://github.com/DarkSheepSoftware/node-packages/compare/eslint-formatter-github-v2.0.10...eslint-formatter-github-v2.1.0) (2025-01-11)
|
|
4
26
|
|
|
5
27
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
# @darksheep/eslint-formatter-github
|
|
2
|
+
An ESLint formatter that outputs [GitHub Actions workflow commands](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-a-warning-message), turning lint results into inline annotations on pull requests.
|
|
2
3
|
|
|
4
|
+
Severity is mapped as follows:
|
|
5
|
+
- `0` (off) → `notice`
|
|
6
|
+
- `1` (warn) → `warning`
|
|
7
|
+
- `2` (error) → `error`
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
```sh
|
|
11
|
+
yarn add --dev @darksheep/eslint-formatter-github
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Pass it to ESLint via the `--format` flag:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx eslint . --format @darksheep/eslint-formatter-github
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or add it to your ESLint config:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"scripts": {
|
|
27
|
+
"lint": "eslint . --format @darksheep/eslint-formatter-github"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
3
30
|
```
|
|
4
|
-
|
|
5
|
-
|
|
31
|
+
|
|
32
|
+
This is most useful in a GitHub Actions workflow:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
- name: Lint
|
|
36
|
+
run: yarn lint
|
|
6
37
|
```
|
|
38
|
+
|
|
39
|
+
When run in Actions, errors and warnings will appear as annotations directly on the relevant lines of the PR diff.
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
- Outside of GitHub Actions, the output still works but the annotations won't render as inline comments
|
|
43
|
+
- The formatter uses the nearest `package.json` to label the group heading in the Actions log
|
|
44
|
+
- Exit code is incremented by the number of errors, so your CI step will fail on lint errors as expected
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darksheep/eslint-formatter-github",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "ESLint + Github actions",
|
|
5
5
|
"license": "UNLICENCED",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"prepack": "tsc"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@darksheep/github-actions": "2.0
|
|
19
|
-
"@darksheep/package.json": "3.0
|
|
18
|
+
"@darksheep/github-actions": "2.1.0",
|
|
19
|
+
"@darksheep/package.json": "3.1.0"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": "^20.13.1 ||
|
|
22
|
+
"node": "^20.13.1 || >=22.2.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import { LineAnnotation } from '@darksheep/github-actions';
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const path = require('node:path');
|
|
2
6
|
const { setNotice, setWarning, setError, startGroup, endGroup } = require('@darksheep/github-actions');
|
|
3
7
|
const { getPackageJson } = require('@darksheep/package.json/sync');
|
|
@@ -73,7 +77,7 @@ function formatFileResult(fileResult) {
|
|
|
73
77
|
? `[${result.ruleId}] ${result.message}`
|
|
74
78
|
: result.message;
|
|
75
79
|
|
|
76
|
-
/** @type {
|
|
80
|
+
/** @type {LineAnnotation} */
|
|
77
81
|
const context = {
|
|
78
82
|
file: filePath,
|
|
79
83
|
line: result.line,
|