eslint-plugin-yaml
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

eslint-plugin-yaml

Lint YAML files

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-yaml:

$ npm install eslint-plugin-yaml --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-yaml globally.

Usage - method 1

Add the following to the overrides section of .eslintrc for yaml files:

"overrides" : [
    {
      "files": ["*.yaml", "*.yml"],
      "plugins": ["yaml"],
      "extends": ["plugin:yaml/recommended"]
    }
]

and run it for all the files:

eslint .

or:

eslint example.yaml

See spec folder for an example of eslint config file.

Usage - method 2

or add yaml to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["yaml"],
  "extends": ["plugin:yaml/recommended"]
}

You can run ESLint on individual YAML files or you can use the --ext flag to add YAML files to the list.

eslint . --ext .yaml --ext .js
eslint example.yaml

By default, this plugin lints .github folder as well.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.5.0
    34,992
    • latest

Version History

Package Sidebar

Install

npm i eslint-plugin-yaml

Weekly Downloads

40,978

Version

0.5.0

License

MIT

Unpacked Size

28.3 kB

Total Files

7

Last publish

Collaborators

  • aminya