eslint-yaml
v0.1.0
Published
YAML capabilities for ESLint
Readme
ESLint YAML Language Plugin
This package contains a language plugin for ESLint which allows you to natively lint YAML files.
Install
npm i -D eslint-yamlUsage
The following languages are exported:
yaml/yaml
You can use it in your ESLint configuration like this:
import { defineConfig } from 'eslint/config';
import { yaml } from 'eslint-yaml';
export default defineConfig([
{
plugins: {
yaml
},
language: 'yaml/yaml',
files: ['*.yaml', '*.yml'],
extends: [
'yaml/recommended'
],
},
]);Rules
| Rule Name | Description | Recommended | | -- | -- | -- | | no-empty-mapping-value | Disallow empty mapping values | ✅ |
Configuration Comments
You can use ESLint configuration comments and disable directives in YAML files.
For example:
foo: 303
# eslint-disable-next-line no-empty-mapping-value
bar:
baz: 808 # eslint-disable-lineLicense
MIT
