lint-webpack-plugin

0.1.1 • Public • Published

lint-webpack-plugin

npm Travis code style: prettier

A webpack plugin to run custom lint shell command

What's this?

lint-webpack-plugin is a simple script to run custom lint commands.

If it's build (webpack), it will run the commands before the webpack build starts. If there is any error occuring in the commands, the webpack process will stop.

If it's watch (webpack --watch), it will run the commands with the webpack build. Although there is any error, it will be ignored and the webpack process will continue to work.

Install

npm i --save-dev lint-webpack-plugin

How to use

An example webpack.config.js with TypeScript and Prettier:

const LintPlugin = require('lint-webpack-plugin');
 
module.exports = {
  ...
 
  plugins: [
    new LintPlugin([
      'tsc --noEmit',
      "prettier -l --parser=babylon \'src/**/*'"
    ])
  ]
};

Demo

Build

build

Watch

watch

Similar works

webpack-shell-plugin

If you want to run shell commands at more specific timings, please use webpack-shell-plugin.

License

MIT

Package Sidebar

Install

npm i lint-webpack-plugin

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

4.84 kB

Total Files

5

Last publish

Collaborators

  • utatti