{"id":19989,"library":"eslint-plugin-yml","title":"eslint-plugin-yml","description":"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+.","status":"active","version":"3.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/ota-meshi/eslint-plugin-yml","tags":["javascript","eslint","eslintplugin","eslint-plugin","yaml","yml","lint"],"install":[{"cmd":"npm install eslint-plugin-yml","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-yml","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-yml","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires ESLint >=9.38.0 to function properly.","package":"eslint","optional":false}],"imports":[{"note":"This plugin is ESM-only; CommonJS require is not supported.","wrong":"const eslintPluginYml = require('eslint-plugin-yml')","symbol":"default","correct":"import eslintPluginYml from 'eslint-plugin-yml'"},{"note":"Named export for accessing configs like configs.recommended.","wrong":"const { configs } = require('eslint-plugin-yml')","symbol":"configs","correct":"import { configs } from 'eslint-plugin-yml'"},{"note":"Named export for accessing individual rules if needed.","wrong":"","symbol":"rules","correct":"import { rules } from 'eslint-plugin-yml'"}],"quickstart":{"code":"import eslintPluginYml from 'eslint-plugin-yml';\n\nexport default [\n  ...eslintPluginYml.configs.recommended,\n  {\n    rules: {\n      'yml/block-mapping': 'error',\n      'yml/no-empty-key': 'error',\n    },\n  },\n];","lang":"javascript","description":"Configure ESLint to lint YAML files using the plugin's recommended config, then override specific rules."},"warnings":[{"fix":"Update your eslint.config.js to use the new language configuration (language: 'yml/yaml') instead of specifying parser in languageOptions.","message":"v3.0.0 changed shareable configs to use ESLint v9 language config API (language: 'yml/yaml') instead of legacy parser approach. Existing configs using languageOptions.parser will no longer work.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade ESLint to v9.38.0 or later.","message":"The plugin only supports ESLint v8 or earlier with v1.x; from v2.0.0 onwards, it requires ESLint v9.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Use import syntax or switch to dynamic import() for CommonJS projects if necessary.","message":"The plugin is ESM-only. Using require() will throw an error.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure vue-eslint-parser is at version 7.3.0 or higher.","message":"When used with Vue SFC, vue-eslint-parser v7.3.0+ is required. Older versions are incompatible.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change require() to import statement: import eslintPluginYml from 'eslint-plugin-yml'","cause":"Using CommonJS require() to import an ESM-only module.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-plugin-yml/dist/index.mjs from /path/to/eslint.config.js not supported."},{"fix":"Install @types/eslint-plugin-yml as a dev dependency: npm install --save-dev @types/eslint-plugin-yml","cause":"The package does not include TypeScript definitions by default; you may need @types/eslint-plugin-yml.","error":"Cannot find module 'eslint-plugin-yml' or its corresponding type declarations."},{"fix":"Replace languageOptions.parser with language: 'yml/yaml' in your config.","cause":"Using deprecated languageOptions.parser in v3.0.0+.","error":"ConfigError: Config (flat): Key 'languageOptions' is not allowed for config at index 1. Use 'language' instead."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}