@intelrug/pug-lint-loader

1.0.1 • Public • Published

@intelrug/pug-lint-loader

Pug-lint loader for webpack

Install

Install @intelrug/pug-lint-loader package

$ yarn add -D @intelrug/pug-lint-loader

Usage

In your webpack configuration

module.exports = {
  // ...
  module: {
    rules: [
      {
        enforce: 'pre',
        test: /\.pug$/,
        loader: '@intelrug/pug-lint-loader'
      }
    ]
  }
  // ...
}

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 pug-lint options in config property. By default the loader will search for the pug-lint config in the root directory of your project.

module.exports = {
  // ...
  module: {
    rules: [
      {
        enforce: 'pre',
        test: /\.pug$/,
        loader: '@intelrug/pug-lint-loader',
        options: {
          config: {
            requireLowerCaseTags: true
          }
        }
      }
    ]
  }
  // ...
}

Errors or Warning?

You can still force this behavior by using emitError:

emitError (default: false)

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

module.exports = {
  // ...
  module: {
    rules: [
      {
        enforce: 'pre',
        test: /\.pug$/,
        loader: '@intelrug/pug-lint-loader',
        options: {
          emitError: true
        }
      }
    ]
  }
  // ...
}

License

MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @intelrug/pug-lint-loader

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

4.02 kB

Total Files

3

Last publish

Collaborators

  • intelrug