{"id":25537,"library":"eslint-plugin-yaml","title":"eslint-plugin-yaml","description":"An ESLint plugin that provides linting for YAML files (`.yaml`, `.yml`). Current stable version is 1.1.3, released March 2025. It uses an ESLint-based YAML parser (not js-yaml) since v1.1.0, enabling integration with ESLint's rule system. Supports both ESLint 9 flat config (ESM/CJS) and legacy ESLint 8 configs. Ships TypeScript types. Differentiators: first-class ESLint compatibility with YAML-specific rules, support for multiple YAML documents, and active maintenance with recent dependency updates.","status":"active","version":"1.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/aminya/eslint-plugin-yaml","tags":["javascript","eslint","eslintplugin","eslint-plugin","yaml","yml","eslint-plugin-yaml","eslint-plugin-yml","typescript"],"install":[{"cmd":"npm install eslint-plugin-yaml","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-yaml","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-yaml","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - required to run the plugin","package":"eslint","optional":false}],"imports":[{"note":"Default export is the plugin object. For CommonJS, use require('eslint-plugin-yaml').default.","wrong":"const pluginYaml = require('eslint-plugin-yaml')","symbol":"pluginYaml","correct":"import pluginYaml from 'eslint-plugin-yaml'"},{"note":"For flat config (ESLint 9+), use default import and access .configs.recommended. Legacy config uses plugin:yaml/legacy.","wrong":"require('eslint-plugin-yaml').configs.recommended","symbol":"configs.recommended","correct":"import pluginYaml from 'eslint-plugin-yaml'; pluginYaml.configs.recommended"},{"note":"Rules are available as a map on the plugin object.","wrong":"require('eslint-plugin-yaml').rules","symbol":"rules","correct":"import pluginYaml from 'eslint-plugin-yaml'; pluginYaml.rules"}],"quickstart":{"code":"// eslint.config.mjs (ESLint 9+)\nimport pluginYaml from 'eslint-plugin-yaml';\n\nexport default [\n  pluginYaml.configs.recommended,\n  {\n    rules: {\n      'yaml/no-empty-key': 'error',\n      'yaml/no-empty-value': 'error',\n    }\n  }\n];\n\n// Then lint: npx eslint .","lang":"typescript","description":"Shows how to use eslint-plugin-yaml with ESLint 9 flat config, importing the plugin and applying its recommended config plus custom rules."},"warnings":[{"fix":"Review rule configurations; update custom parser settings if any.","message":"v1.1.0 rewrote the parser from js-yaml to an ESLint-based parser; rules and behavior may differ.","severity":"breaking","affected_versions":">=1.1.0 <1.2.0"},{"fix":"Use ESLint 9+ and migrate to eslint.config.js/flat config.","message":"v1.0.0 dropped support for ESLint 8 and flat config is required.","severity":"breaking","affected_versions":">=1.0.0 <1.1.0"},{"fix":"Use Node >=12.","message":"v0.5.0 dropped Node 10 support.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Migrate to flat config with pluginYaml.configs.recommended.","message":"Legacy .eslintrc config (plugin:yaml/legacy) is deprecated in favor of flat config.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use .default for CommonJS, or use ESM import.","message":"CommonJS require must use .default: const pluginYaml = require('eslint-plugin-yaml').default","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.3':20 '2025':23 '8':55 '9':48 'activ':77 'base':29 'class':63 'compat':65 'config':50,56 'current':16 'depend':81 'differenti':60 'document':75 'enabl':38 'eslint':2,6,28,41,47,54,64,84,87,92,96 'eslint-bas':27 'eslint-plugin':86 'eslint-plugin-yaml':1,91 'eslint-plugin-yml':95 'eslintplugin':85 'esm/cjs':51 'file':13 'first':62 'first-class':61 'flat':49 'integr':39 'javascript':83 'js':34 'js-yaml':33 'legaci':53 'lint':10 'mainten':78 'march':22 'multipl':73 'parser':31 'plugin':3,7,88,93,97 'provid':9 'recent':80 'releas':21 'rule':43,70 'ship':57 'sinc':36 'specif':69 'stabl':17 'support':45,71 'system':44 'type':59 'typescript':58,99 'updat':82 'use':25 'v1.1.0':37 'version':18 'yaml':4,12,14,30,35,68,74,89,94 'yaml-specif':67 'yml':15,90,98","created_at":"2026-05-01T13:45:17.054779+00:00","updated_at":"2026-05-01T13:45:17.054779+00:00","problems":[{"fix":"Run npm install eslint-plugin-yaml --save-dev.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'eslint-plugin-yaml'"},{"fix":"Ensure only one version is installed and remove duplicate overrides.","cause":"Multiple versions or duplicate plugin registrations.","error":"Error: Plugin 'yaml' was conflicted between 'eslint-plugin-yaml' and ..."},{"fix":"Use require('eslint-plugin-yaml').default instead of require('eslint-plugin-yaml').","cause":"Using CommonJS require without .default to access default export.","error":"TypeError: Cannot read properties of undefined (reading 'configs')"},{"fix":"Use flat config with pluginYaml.configs.recommended.","cause":"Using legacy config string with ESLint 9 or plugin version 1.0+.","error":"ESLint couldn't find the config 'plugin:yaml/legacy'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/aminya/eslint-plugin-yaml","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-yaml","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}