Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

hatashiro/lint-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/**/*'"
    ])
  ]
};

Please note that the current ./node_modules/.bin will be added to PATH, so local package binaries can be used directly.

Demo

Build

build

Watch

watch

Similar works

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

License

MIT

Releases

No releases published

Packages

No packages published