yaml-lint-loader

YAML linter module for Webpack

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
yaml-lint-loader
201.0.04 years ago4 years agoMinified + gzip package size for yaml-lint-loader in KB

Readme

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.