Registry / devops / lint-webpack-plugin

lint-webpack-plugin

JSON →
library0.1.1jsnpmunverified

A webpack plugin that runs custom lint shell commands before or during webpack build/watch. Version 0.1.1 is the latest release (no recent updates). It integrates with webpack's build and watch modes: during build, errors halt the webpack process; during watch, errors are ignored and the process continues. Simpler than alternatives like webpack-shell-plugin, but limited to running shell commands without advanced lifecycle hooks.

npm install lint-webpack-plugin
INSTALL
IMPORT
SIG · LINT-WEBPACK-PLUGI
L
lint-webpack-plugin
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
const LintPlugin = require('lint-webpack-plugin')
import LintPlugin from 'lint-webpack-plugin'
Package only supports CommonJS (no ESM exports).
default
new LintPlugin(['tsc --noEmit'])
new LintPlugin('tsc --noEmit')
Constructor expects an array of command strings, not a single string.
default
const LintPlugin = require('lint-webpack-plugin');
const LintPlugin = require('lint-webpack-plugin').default;
No default export object; require returns the constructor directly.

Shows how to set up lint-webpack-plugin in a webpack config to run ESLint and Prettier checks.

const path = require('path'); const webpack = require('webpack'); const LintPlugin = require('lint-webpack-plugin'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, plugins: [ new LintPlugin([ 'eslint --ext .js,.jsx src/', 'prettier --check "src/**/*.js"' ]) ] };
Debug
Known issues
breakingEmpty array input causes plugin to run no commands but still attaches hooks, potentially causing no-op builds.
fix
Pass at least one command or omit the plugin entirely.
affects: >=0.1.0
deprecatedPackage has not been updated since 2018 and has no ESM support. Webpack 5 may have compatibility issues.
fix
Consider using webpack-shell-plugin or a modern alternative.
affects: >=0.1.0
gotchaCommand failures during watch mode are silently ignored; errors in lint might not be noticed by the developer.
fix
Add explicit console logging or use a plugin that supports error reporting.
affects: >=0.1.0
gotchaThe plugin runs commands via child_process.exec() which can be a security risk if commands include user input.
fix
Sanitize command strings, especially if they contain data from external sources.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: LintPlugin is not a constructor
Incorrect import: using ESM import syntax with a CommonJS module.
fix
Use const LintPlugin = require('lint-webpack-plugin'); instead of import.
Error: spawn ENOENT
The shell command specified does not exist in PATH.
fix
Ensure the linting tool (e.g., eslint) is installed locally or globally and available in PATH.
Module not found: Error: Can't resolve 'lint-webpack-plugin'
Plugin not installed in the project.
fix
Run npm install --save-dev lint-webpack-plugin.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
lint-webpack-plugin — npm install lint-webpack-plugin · libregistry