{"id":25157,"library":"danger-plugin-lint-report","title":"danger-plugin-lint-report","description":"A Danger plugin that reads checkstyle/lint reports and posts issues and violations as inline comments on pull requests. Current version is 1.8.1, released in 2024. It supports multiple report formats (checkstyle, PMD, etc.), customizable violation formatting, deduplication of violations, and configurable project root. Designed for use with Danger JS in CI pipelines. Ships TypeScript definitions.","status":"active","version":"1.8.1","language":"javascript","source_language":"en","source_url":"https://github.com/damian-burke/danger-plugin-lint-report","tags":["javascript","danger","danger-plugin","typescript"],"install":[{"cmd":"npm install danger-plugin-lint-report","lang":"bash","label":"npm"},{"cmd":"yarn add danger-plugin-lint-report","lang":"bash","label":"yarn"},{"cmd":"pnpm add danger-plugin-lint-report","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required to run as a Danger plugin","package":"danger","optional":false}],"imports":[{"note":"ESM import supported if using TypeScript or ES modules. For CJS, use require but note that default export is named export 'lintReport'.","wrong":"const lintReport = require('danger-plugin-lint-report')","symbol":"lintReport","correct":"import { lintReport } from 'danger-plugin-lint-report'"},{"note":"Default import also works since v1. It is equivalent to named import 'lintReport'.","wrong":"import { default as lintReport } from 'danger-plugin-lint-report'","symbol":"default","correct":"import lintReport from 'danger-plugin-lint-report'"},{"note":"TypeScript type export for custom formatter function.","symbol":"ViolationFormatter","correct":"import { ViolationFormatter } from 'danger-plugin-lint-report'"},{"note":"CheckstyleConfig is a TypeScript interface, only import as type to avoid runtime issues.","wrong":"import { CheckstyleConfig } from 'danger-plugin-lint-report'","symbol":"CheckstyleConfig","correct":"import type { CheckstyleConfig } from 'danger-plugin-lint-report'"}],"quickstart":{"code":"// dangerfile.js (CommonJS)\nconst { lintReport } = require('danger-plugin-lint-report');\n\nschedule(lintReport({\n  // Path to your lint report file (checkstyle XML or JSON)\n  reportPath: 'path/to/lint-report.xml',\n  // Optional: remove duplicate violations across files (since v1.8.0)\n  removeDuplicates: true,\n  // Optional: custom violation formatter\n  // ViolationFormatter: (violation) => `- ${violation.file}:${violation.line}: ${violation.message}`\n}));\n\n// dangerfile.ts (ESM)\nimport { lintReport } from 'danger-plugin-lint-report';\n\nschedule(lintReport({\n  reportPath: 'path/to/lint-report.xml',\n  removeDuplicates: true\n}));","lang":"typescript","description":"Shows how to import and use the lintReport function in both CJS and ESM contexts."},"warnings":[{"fix":"Change import to: import { lintReport } from 'danger-plugin-lint-report'","message":"In v1.5.0, the default export changed from the entire module to just the lintReport function. If you were using import * as DangerLintReport from 'danger-plugin-lint-report', you need to switch to named import.","severity":"breaking","affected_versions":"<1.5.0"},{"fix":"Replace failOnWarning with failOnSeverity with appropriate severity level.","message":"The option 'failOnWarning' has been deprecated since v1.3.0; use 'failOnSeverity' instead.","severity":"deprecated","affected_versions":">=1.0.0 <1.7.0"},{"fix":"No fix needed, just understand the deduplication logic.","message":"When using the removeDuplicates option (v1.8.0+), be aware that duplicates are determined by file, line, and message. If your tool produces multiple identical violations on the same line, they are considered duplicates.","severity":"gotcha","affected_versions":">=1.8.0"},{"fix":"Use path.resolve() to ensure absolute path.","message":"The 'projectRoot' option (v1.7.0+) expects an absolute path. Relative paths may cause unexpected behavior.","severity":"gotcha","affected_versions":">=1.7.0"},{"fix":"Update your custom formatter to accept one argument: (violation) => string","message":"In v1.6.0, the signature of ViolationFormatter changed. It now receives a single violation object instead of multiple arguments.","severity":"breaking","affected_versions":"<1.6.0"},{"fix":"Upgrade Node.js to v12 or higher.","message":"Support for Node.js versions below 12 has been dropped as of v1.0.0.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import { lintReport } from 'danger-plugin-lint-report' or use require().","cause":"Using import lintReport from 'danger-plugin-lint-report' in a CommonJS environment without a default export set up.","error":"Error: Module 'danger-plugin-lint-report' does not provide a default export"},{"fix":"Ensure the package is installed: npm install danger-plugin-lint-report","cause":"Import statement imports the module incorrectly, e.g., import { lintReport } from 'danger-plugin-lint-report' but the module is not installed or not resolved.","error":"TypeError: Cannot destructure property 'lintReport' of 'undefined' or 'null'"},{"fix":"Update the formatter to accept a single argument of type Violation.","cause":"Using a custom ViolationFormatter that does not match the expected signature.","error":"Type '{}' is not assignable to type 'Violation'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}