Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-yaml

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-yaml

Lint YAML files

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37K
decreased by-11.34%
Maintainers
0
Weekly downloads
 
Created
Source

eslint-plugin-yaml

Lint YAML files

Installation

You'll first need to install ESLint:

Next, install eslint-plugin-yaml:

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

Usage

Eslint 9 and above

Add the following to eslint.config.cjs:

const pluginYaml = require("eslint-plugin-yaml").default

module.exports = [pluginYaml.configs.recommended]

or to eslint.config.mjs:

import pluginYaml from "eslint-plugin-yaml"

export default [pluginYaml.configs.recommended]

Eslint 8 and below

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

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

and run it for all the files:

eslint .

or:

eslint example.yaml

See spec folder for an example of eslint config file.

Eslint 8 and below (alternative)

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

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

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

Keywords

FAQs

Package last updated on 30 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc