@darksheep/eslint-formatter-github 2.2.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 CHANGED
@@ -1,5 +1,12 @@
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
+
3
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)
4
11
 
5
12
 
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
- npm install --save-dev eslint @darksheep/eslint-formatter-github
5
- npx eslint . --format @darksheep/github
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.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "ESLint + Github actions",
5
5
  "license": "UNLICENCED",
6
6
  "type": "commonjs",
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 {import('@darksheep/github-actions').LineAnnotation} */
80
+ /** @type {LineAnnotation} */
77
81
  const context = {
78
82
  file: filePath,
79
83
  line: result.line,