Registry / devops / danger-plugin-eslint

danger-plugin-eslint

JSON →
library0.1.1jsnpmunverified

A Danger plugin to run ESLint on changed files in PRs. Current stable version is 1.0.0, released in December 2017. This plugin automatically runs ESLint on modified files using the project's ESLint config and reports linting errors as Danger messages. It integrates with Danger's PR workflow to enforce code quality. The plugin is ESM-only and requires Danger JS. It is a niche tool for teams using Danger and ESLint in CI. Differentiators: simple setup, zero-config use of project's own ESLint config. Note: no longer actively maintained; last release was 2017.

npm install danger-plugin-eslint
INSTALL
IMPORT
SIG · DANGER-PLUGIN-ESLI
D
danger-plugin-eslint
devopsjavascriptv0.1.1
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 eslint from 'danger-plugin-eslint'
const eslint = require('danger-plugin-eslint')
Package is ESM-only; CommonJS require will fail.
eslint
import eslint from 'danger-plugin-eslint' eslint({ extensions: ['.js', '.ts'], configFile: '.eslintrc.json' })
import { eslint } from 'danger-plugin-eslint'
Default export is a function; named import does not exist.
eslint()
import eslint from 'danger-plugin-eslint' eslint()
new eslint()
The default export is a function, not a class. Do not use 'new'.

Shows minimal usage of the eslint() function with optional configuration.

// dangerfile.js import { danger, warn, fail, markdown } from 'danger' import eslint from 'danger-plugin-eslint' eslint({ extensions: ['.js', '.jsx'], configFile: '.eslintrc.json', basePath: process.cwd() })
Debug
Known issues
breakingNode 6 support removed in v1.0.0
fix
Upgrade Node to >=8.0.0
affects: >=1.0.0
deprecatedPackage is no longer actively maintained; last release was 2017.
fix
Consider using danger-plugin-eslint-files or implementing custom ESLint integration.
affects: >=0.0.0
gotchaFunction expects ESLint config file to be present; otherwise it fails silently.
fix
Ensure an ESLint config file exists in the project root.
affects: >=0.0.0
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
Package is ESM-only but used in CommonJS project without 'type:module' in package.json.
fix
Add 'type':'module' to package.json or use .mjs extension for dangerfile.
eslint is not a function
Using default import as an object and then trying to call eslint as method.
fix
Use 'import eslint from "danger-plugin-eslint"' and then call eslint() directly.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
dangerrequiredpeer dependency required for Danger plugin integration
eslintrequiredpeer dependency for running ESLint analysis
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
danger-plugin-eslint — npm install danger-plugin-eslint · libregistry