@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

    Install

    npm i @intelrug/pug-lint-loader

    DownloadsWeekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    4.02 kB

    Total Files

    3

    Last publish

    Collaborators

    • intelrug