Registry / testing / danger-plugin-code-lint

danger-plugin-code-lint

JSON →
library1.4.0jsnpmunverified

A Danger plugin for linting JavaScript/TypeScript and CSS/SCSS files in CI/CD pipelines. Version 1.4.0, stable but low release cadence. Integrates with ESLint and Stylelint to provide inline code review warnings on pull requests, leveraging Danger's message infrastructure. Lightweight alternative to full linting CI steps when combined with Danger.

npm install danger-plugin-code-lint
INSTALL
IMPORT
SIG · DANGER-PLUGIN-CODE
D
danger-plugin-code-lint
testingjavascriptv1.4.0
harness data pending
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.

default
✓ import plugin from 'danger-plugin-code-lint'
✗ const plugin = require('danger-plugin-code-lint')
ESM-only. No default export; must import and call as function.
lint
✓ import { lint } from 'danger-plugin-code-lint'
Named export for the main function.
LintOptions
✓ import type { LintOptions } from 'danger-plugin-code-lint'
✗ import { LintOptions } from 'danger-plugin-code-lint' (will fail at runtime if used as value)
TypeScript only; use type import to avoid runtime errors.

Shows how to import and configure the plugin with ESLint and Stylelint options in a Dangerfile.

import { danger, fail } from 'danger' import lint from 'danger-plugin-code-lint' export default async () => { await lint({ eslint: { extensions: ['js', 'jsx', 'ts', 'tsx'], configFile: '.eslintrc.json', }, stylelint: { extensions: ['css', 'scss'], configFile: '.stylelintrc.json', }, }) }
Debug
Known issues
breakingRequires Danger version 7+
fix
Upgrade Danger to >=7.0.0
affects: <1.0.0
gotchaESLint and Stylelint must be installed separately as peer dependencies
fix
Install eslint and/or stylelint in your project
affects: >=1.0.0
gotchaDefault import is not a function directly; it returns an object with a lint method
fix
Use import lint from 'danger-plugin-code-lint' then call lint(options)
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint'
ESLint not installed as a peer dependency
fix
Run npm install --save-dev eslint
TypeError: lint is not a function
Incorrect import pattern; default export is an object
fix
Use import lint from 'danger-plugin-code-lint' and invoke lint(options)
danger.js: Plugin 'danger-plugin-code-lint' not found
Package not installed in node_modules
fix
Run npm install --save-dev danger-plugin-code-lint
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
dangerrequiredpeer dependency required for Danger runtime
eslintoptionalpeer dependency for JS/TS linting
stylelintoptionalpeer dependency for CSS/SCSS linting
Agent activity
7 hits · last 30 days
node
6
Resources
danger-plugin-code-lint — npm install danger-plugin-code-lint · libregistry