yaml-lint-loader
v1.0.0
Published
YAML linter module for Webpack
Downloads
2,619
Maintainers
Readme
yaml-lint-loader
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
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.