Registry /
devops / danger-plugin-lint-report
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
lintReport
✓ import { lintReport } from 'danger-plugin-lint-report'
✗ const lintReport = require('danger-plugin-lint-report')
ESM import supported if using TypeScript or ES modules. For CJS, use require but note that default export is named export 'lintReport'.
default
✓ import lintReport from 'danger-plugin-lint-report'
✗ import { default as lintReport } from 'danger-plugin-lint-report'
Default import also works since v1. It is equivalent to named import 'lintReport'.
ViolationFormatter
✓ import { ViolationFormatter } from 'danger-plugin-lint-report'
TypeScript type export for custom formatter function.
CheckstyleConfig
✓ import type { CheckstyleConfig } from 'danger-plugin-lint-report'
✗ import { CheckstyleConfig } from 'danger-plugin-lint-report'
CheckstyleConfig is a TypeScript interface, only import as type to avoid runtime issues.
Shows how to import and use the lintReport function in both CJS and ESM contexts.
// dangerfile.js (CommonJS)
const { lintReport } = require('danger-plugin-lint-report');
schedule(lintReport({
// Path to your lint report file (checkstyle XML or JSON)
reportPath: 'path/to/lint-report.xml',
// Optional: remove duplicate violations across files (since v1.8.0)
removeDuplicates: true,
// Optional: custom violation formatter
// ViolationFormatter: (violation) => `- ${violation.file}:${violation.line}: ${violation.message}`
}));
// dangerfile.ts (ESM)
import { lintReport } from 'danger-plugin-lint-report';
schedule(lintReport({
reportPath: 'path/to/lint-report.xml',
removeDuplicates: true
}));
Errors
Common errors & fixes
Error: Module 'danger-plugin-lint-report' does not provide a default export
Using import lintReport from 'danger-plugin-lint-report' in a CommonJS environment without a default export set up.
fixChange to import { lintReport } from 'danger-plugin-lint-report' or use require(). TypeError: Cannot destructure property 'lintReport' of 'undefined' or 'null'
Import statement imports the module incorrectly, e.g., import { lintReport } from 'danger-plugin-lint-report' but the module is not installed or not resolved.
fixEnsure the package is installed: npm install danger-plugin-lint-report
Type '{}' is not assignable to type 'Violation'
Using a custom ViolationFormatter that does not match the expected signature.
fixUpdate the formatter to accept a single argument of type Violation.
Audit
Dependencies
dangerrequiredpeer dependency: required to run as a Danger plugin