@jamesacarr/eslint-formatter-github-actions
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,3 +0,3 @@ | ||
import { CLIEngine } from 'eslint'; | ||
declare const GitHubActionsReporter: CLIEngine.Formatter; | ||
export = GitHubActionsReporter; | ||
import { ESLint } from 'eslint'; | ||
declare const _default: (results: ESLint.LintResult[], data?: ESLint.LintResultData | undefined) => string; | ||
export = _default; |
"use strict"; | ||
const core_1 = require("@actions/core"); | ||
const command_1 = require("@actions/core/lib/command"); | ||
const GitHubActionsReporter = (results) => { | ||
command_1.issue('group', 'Lint Annotations'); | ||
const errors = results.flatMap((result) => result.messages.map((message) => ({ | ||
message: message.message, | ||
properties: { | ||
file: result.filePath, | ||
line: message.line.toString(), | ||
col: message.column.toString(), | ||
}, | ||
}))); | ||
for (const error of errors) { | ||
const { message, properties } = error; | ||
command_1.issueCommand('error', properties, message); | ||
} | ||
command_1.issue('endgroup'); | ||
return ''; | ||
const GitHubActionsReporter = { | ||
format: (results) => { | ||
core_1.startGroup('Lint Annotations'); | ||
const errors = results.flatMap((result) => result.messages.map((message) => ({ | ||
message: message.message, | ||
properties: { | ||
file: result.filePath, | ||
line: message.line.toString(), | ||
col: message.column.toString(), | ||
}, | ||
}))); | ||
for (const { message, properties } of errors) { | ||
command_1.issueCommand('error', properties, message); | ||
} | ||
core_1.endGroup(); | ||
return ''; | ||
}, | ||
}; | ||
module.exports = GitHubActionsReporter; | ||
module.exports = GitHubActionsReporter.format; |
{ | ||
"name": "@jamesacarr/eslint-formatter-github-actions", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Reporter for Jest that outputs GitHub Actions annotations", | ||
@@ -30,3 +30,3 @@ "author": "James Carr <james@jamescarr.dev>", | ||
"lint:ci": "xo", | ||
"prepublish": "yarn build", | ||
"prepublishOnly": "yarn build", | ||
"typecheck": "tsc --noEmit" | ||
@@ -66,8 +66,8 @@ }, | ||
"devDependencies": { | ||
"@types/eslint": "^6.8.0", | ||
"@types/node": "^13.13.1", | ||
"eslint": "^6.8.0", | ||
"typescript": "^3.8.3", | ||
"xo": "^0.29.1" | ||
"@types/eslint": "^7.2.4", | ||
"@types/node": "^14.14.6", | ||
"eslint": "^7.12.1", | ||
"typescript": "^4.0.5", | ||
"xo": "^0.34.2" | ||
} | ||
} |
# ESLint Reporter for GitHub Actions | ||
[![Test status](https://github.com/jamesacarr/eslint-formatter-github-actions/workflows/tests/badge.svg)](https://github.com/jamesacarr/eslint-formatter-github-actions/actions?query=workflow%3Atests) | ||
[![NPM badge](https://img.shields.io/npm/v/@jamesacarr/eslint-formatter-github-actions.svg)](https://www.npmjs.com/package/@jamesacarr/eslint-formatter-github-actions) | ||
@@ -13,3 +14,3 @@ A custom formatter for ESLint that creates annotations when run via GitHub Actions | ||
Or, event better: | ||
Or, even better: | ||
@@ -16,0 +17,0 @@ ```sh |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4549
25
33