@mizdra/eslint-interactive
Advanced tools
Comparing version 4.0.1 to 5.0.0
@@ -9,6 +9,6 @@ "use strict"; | ||
const cli_table_1 = __importDefault(require("cli-table")); | ||
const terminal_link_1 = __importDefault(require("terminal-link")); | ||
// import terminalLink from 'terminal-link'; | ||
const colors_1 = require("./colors"); | ||
const take_rule_statistics_1 = require("./take-rule-statistics"); | ||
const formatByRules = (results, data) => { | ||
const formatByRules = (results, _data) => { | ||
const ruleStatistics = take_rule_statistics_1.takeRuleStatistics(results); | ||
@@ -19,6 +19,8 @@ const table = new cli_table_1.default({ | ||
ruleStatistics.forEach((ruleStatistic) => { | ||
var _a; | ||
const { ruleId, errorCount, warningCount, fixableErrorCount, fixableWarningCount, suggestApplicableErrorCount, suggestApplicableWarningCount, } = ruleStatistic; | ||
const ruleMetaData = data === null || data === void 0 ? void 0 : data.rulesMeta[ruleId]; | ||
const ruleCell = ((_a = ruleMetaData === null || ruleMetaData === void 0 ? void 0 : ruleMetaData.docs) === null || _a === void 0 ? void 0 : _a.url) ? terminal_link_1.default(ruleId, ruleMetaData === null || ruleMetaData === void 0 ? void 0 : ruleMetaData.docs.url) : ruleId; | ||
// NOTE: Disable documentation links temporarily due to problems with cli-table. | ||
// ref: https://github.com/mizdra/eslint-interactive/issues/81 | ||
// const ruleMetaData = data?.rulesMeta[ruleId]; | ||
// const ruleCell = ruleMetaData?.docs?.url ? terminalLink(ruleId, ruleMetaData?.docs.url) : ruleId; | ||
const ruleCell = ruleId; | ||
let errorCell = `${errorCount} (${fixableErrorCount}/${suggestApplicableErrorCount})`; | ||
@@ -25,0 +27,0 @@ if (errorCount > 0) |
{ | ||
"name": "@mizdra/eslint-interactive", | ||
"description": "The CLI tool to run `eslint --fix` for each rule", | ||
"version": "4.0.1", | ||
"version": "5.0.0", | ||
"repository": "https://github.com/mizdra/eslint-interactive.git", | ||
@@ -6,0 +6,0 @@ "author": "mizdra <pp.mizdra@gmail.com>", |
import chalk from 'chalk'; | ||
import Table from 'cli-table'; | ||
import { ESLint } from 'eslint'; | ||
import terminalLink from 'terminal-link'; | ||
// import terminalLink from 'terminal-link'; | ||
import { ERROR_COLOR, WARNING_COLOR } from './colors'; | ||
import { takeRuleStatistics } from './take-rule-statistics'; | ||
export const formatByRules: ESLint.Formatter['format'] = (results, data) => { | ||
export const formatByRules: ESLint.Formatter['format'] = (results, _data) => { | ||
const ruleStatistics = takeRuleStatistics(results); | ||
@@ -24,5 +24,8 @@ const table = new Table({ | ||
} = ruleStatistic; | ||
const ruleMetaData = data?.rulesMeta[ruleId]; | ||
const ruleCell = ruleMetaData?.docs?.url ? terminalLink(ruleId, ruleMetaData?.docs.url) : ruleId; | ||
// NOTE: Disable documentation links temporarily due to problems with cli-table. | ||
// ref: https://github.com/mizdra/eslint-interactive/issues/81 | ||
// const ruleMetaData = data?.rulesMeta[ruleId]; | ||
// const ruleCell = ruleMetaData?.docs?.url ? terminalLink(ruleId, ruleMetaData?.docs.url) : ruleId; | ||
const ruleCell = ruleId; | ||
let errorCell = `${errorCount} (${fixableErrorCount}/${suggestApplicableErrorCount})`; | ||
@@ -29,0 +32,0 @@ if (errorCount > 0) errorCell = chalk[ERROR_COLOR].bold(errorCell); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
3045
269737