1.0.0 • Published 6 years ago

yaml-lint-loader v1.0.0

Weekly downloads
1,578
License
MIT
Repository
github
Last release
6 years ago

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.