yaml-lint-loader

1.0.0 • Public • Published

yaml-lint-loader

Dependency Status Dev Dependency Status Version Month Download License

YAML lint loader module for webpack.

Loader verifies the syntax of YAML files using yaml-lint.

It is recommended to use it together with yaml-loader and json-loader to get the JSON objects.

Installation

npm install --save yaml-lint-loader

Usage

Documentation: Using loaders

Simplest case would be:

var json = require("json-loader!yaml-loader!yaml-lint-loader./file.yml");
// => returns file.yml as javascript object

Example webpack configuration for handling .yaml and .yml files may look like:

// webpack.config.js
module: {
  rules: [
    {
      test: /\.ya?ml$/,
      use: [
        { loader: 'json-loader' },
        { loader: 'yaml-loader' },
        { loader: 'yaml-lint-loader' },
      ],
    },
  ]
}

Configuration

It is possible to configure the behaviour of yaml-lint module which is used for linting YAML files with creating the .yaml-lint.json file in the current working directory with following example configuration:

{
  "schema": "CORE_SCHEMA",
  "ignore": "dir/*.yaml"
}

Available options for schema and ignore properties are described in yaml-lint README.

License

Copyright (c) 2018 Jakub Chrzanowski Licensed under the MIT license.

Package Sidebar

Install

npm i yaml-lint-loader

Weekly Downloads

821

Version

1.0.0

License

MIT

Unpacked Size

4.35 kB

Total Files

4

Last publish

Collaborators

  • hsz