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.

    Install

    npm i eslint-plugin-yaml

    DownloadsWeekly Downloads

    11,325

    Version

    0.5.0

    License

    MIT

    Unpacked Size

    28.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar