An ESLint plugin that provides a comprehensive set of linting rules for YAML files, including support for Vue SFC custom blocks and ESLint directive comments. Version 3.3.1 is the latest stable release, with releases occurring every few months. Unlike other YAML linting plugins that use processors without providing AST and source code text to ESLint, eslint-plugin-yml provides full AST support, enabling ESLint directive comments and compatibility with other plugins like eslint-plugin-prettier. Requires Node.js 20+ and ESLint 9.38+.
npm install eslint-plugin-ymlVerified import paths — ran on the pinned version, not inferred.
Configure ESLint to lint YAML files using the plugin's recommended config, then override specific rules.
Update your eslint.config.js to use the new language configuration (language: 'yml/yaml') instead of specifying parser in languageOptions.
Upgrade ESLint to v9.38.0 or later.
Use import syntax or switch to dynamic import() for CommonJS projects if necessary.
Ensure vue-eslint-parser is at version 7.3.0 or higher.
Change require() to import statement: import eslintPluginYml from 'eslint-plugin-yml'
Install @types/eslint-plugin-yml as a dev dependency: npm install --save-dev @types/eslint-plugin-yml
Replace languageOptions.parser with language: 'yml/yaml' in your config.