Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Jack-Works/pug-lint-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pug-lint-loader

Pug lint loader for webpack

Install

$ npm install pug-lint-loader --save-dev

Usage

In your webpack configuration

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.(pug|jade)$/,
        exclude: /node_modules/,
        loader: "pug-lint-loader",
        options: require('./.pug-lintrc.js'),
        enforce: "pre"
      },
    ],
  },
  // ...
}

To be safe, you should use enforce: "pre" section to check source files, not modified by other loaders (like pug-loader)

Options

You can pass puglint options using standard webpack loader options.

Errors or Warning?

You can still force this behavior by using emitError:

emitError (default: true)

Loader will always return errors if this option is set to true.

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.(pug|jade)$/,
        exclude: /node_modules/,
        loader: "pug-lint-loader",
        options: Object.assign({
          emitError: true,
        }, require('./.pug-lintrc.js'))
      },
    ],
  },
}

License

MIT License

About

Unoffical pug-lint loader for Webpack

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published