@secretlint/formatter
Advanced tools
Comparing version 4.1.3 to 4.2.0
@@ -1,4 +0,3 @@ | ||
import { FormatterOptions } from "../types"; | ||
import { SecretLintCoreResult } from "@secretlint/types"; | ||
declare function formatter(report: SecretLintCoreResult[], options: FormatterOptions): string; | ||
import { SecretLintFormatter } from "@secretlint/types"; | ||
declare const formatter: SecretLintFormatter; | ||
export default formatter; |
@@ -94,3 +94,3 @@ "use strict"; | ||
//------------------------------------------------------------------------------ | ||
function formatter(report, options) { | ||
const formatter = (results, options) => { | ||
var _a; | ||
@@ -101,3 +101,3 @@ const useColor = (_a = options.color) !== null && _a !== void 0 ? _a : true; | ||
let warningCount = 0; | ||
report.forEach((fileReport) => { | ||
results.forEach((fileReport) => { | ||
fileReport.messages.forEach((message) => { | ||
@@ -113,3 +113,3 @@ if (message.severity === "warning") { | ||
if (errorCount || warningCount) { | ||
output = drawReport(report); | ||
output = drawReport(results); | ||
} | ||
@@ -136,4 +136,4 @@ output += | ||
return output; | ||
} | ||
}; | ||
exports.default = formatter; | ||
//# sourceMappingURL=table.js.map |
@@ -108,3 +108,3 @@ // LICENSE : MIT | ||
else { | ||
const pkgPath = (0, try_resolve_1.default)(`secretlint-formatter-${formatterName}`) || (0, try_resolve_1.default)(formatterName); | ||
const pkgPath = (0, try_resolve_1.default)(formatterName) || (0, try_resolve_1.default)(`secretlint-formatter-${formatterName}`); | ||
if (pkgPath) { | ||
@@ -111,0 +111,0 @@ formatterPath = pkgPath; |
@@ -1,7 +0,4 @@ | ||
export interface FormatterConfig { | ||
import { SecretLintFormatterOptions } from "@secretlint/types"; | ||
export declare type FormatterConfig = { | ||
formatterName: string; | ||
color?: boolean; | ||
} | ||
export interface FormatterOptions { | ||
color?: boolean; | ||
} | ||
} & SecretLintFormatterOptions; |
{ | ||
"name": "@secretlint/formatter", | ||
"version": "4.1.3", | ||
"version": "4.2.0", | ||
"description": "A formatter collection for Secretlint.", | ||
@@ -27,3 +27,3 @@ "homepage": "https://github.com/secretlint/secretlint/tree/master/packages/@secretlint/formatter/", | ||
"scripts": { | ||
"build": "cross-env NODE_ENV=production tsc -p .", | ||
"build": "tsc -p .", | ||
"clean": "rimraf lib/", | ||
@@ -42,3 +42,3 @@ "prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"", | ||
"dependencies": { | ||
"@secretlint/types": "^4.1.3", | ||
"@secretlint/types": "^4.2.0", | ||
"@textlint/linter-formatter": "^12.0.2", | ||
@@ -58,3 +58,2 @@ "@textlint/types": "^12.0.2", | ||
"@types/pluralize": "0.0.29", | ||
"cross-env": "^7.0.3", | ||
"escape-string-regexp": "^2.0.0", | ||
@@ -74,3 +73,3 @@ "mocha": "^9.0.1", | ||
}, | ||
"gitHead": "7b0af3675a5a18ccbc19fe923194f5849e82740f" | ||
"gitHead": "7879c01d93ae5932822c2864e9bb51e7a6627f0f" | ||
} |
"use strict"; | ||
import { FormatterOptions } from "../types"; | ||
import { SecretLintCoreResult, SecretLintCoreResultMessage } from "@secretlint/types"; | ||
import { SecretLintCoreResult, SecretLintCoreResultMessage, SecretLintFormatter } from "@secretlint/types"; | ||
@@ -8,3 +7,2 @@ //------------------------------------------------------------------------------ | ||
//------------------------------------------------------------------------------ | ||
import chalk from "chalk"; | ||
@@ -109,3 +107,3 @@ import { table } from "table"; | ||
function formatter(report: SecretLintCoreResult[], options: FormatterOptions) { | ||
const formatter: SecretLintFormatter = (results, options) => { | ||
const useColor = options.color ?? true; | ||
@@ -116,3 +114,3 @@ let output = ""; | ||
report.forEach((fileReport) => { | ||
results.forEach((fileReport) => { | ||
fileReport.messages.forEach((message) => { | ||
@@ -128,3 +126,3 @@ if (message.severity === "warning") { | ||
if (errorCount || warningCount) { | ||
output = drawReport(report); | ||
output = drawReport(results); | ||
} | ||
@@ -156,4 +154,4 @@ | ||
return output; | ||
} | ||
}; | ||
export default formatter; |
@@ -135,3 +135,3 @@ // LICENSE : MIT | ||
} else { | ||
const pkgPath = tryResolve(`secretlint-formatter-${formatterName}`) || tryResolve(formatterName); | ||
const pkgPath = tryResolve(formatterName) || tryResolve(`secretlint-formatter-${formatterName}`); | ||
if (pkgPath) { | ||
@@ -138,0 +138,0 @@ formatterPath = pkgPath; |
@@ -1,8 +0,5 @@ | ||
export interface FormatterConfig { | ||
import { SecretLintFormatterOptions } from "@secretlint/types"; | ||
export type FormatterConfig = { | ||
formatterName: string; | ||
color?: boolean; | ||
} | ||
export interface FormatterOptions { | ||
color?: boolean; | ||
} | ||
} & SecretLintFormatterOptions; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10
34617
620
Updated@secretlint/types@^4.2.0