Skip to content

About

Flint’s YML plugin supports linting .yaml/.yml source code. It comes provided with the flint npm package.

Flint’s YML plugin provides the following presets:

PresetRecommendedDescription
logical✅ AlwaysCommon rules for finding bugs and enforcing good logical practices in YML files.
logicalStrict☑️ When ReadyAdditional rules for finding bugs and enforcing good logical practices in YML files.
stylistic✅ AlwaysCommon rules for consistent styling and best stylistic practices in YML files.
stylisticStrict☑️ When ReadyAdditional rules for consistent styling and best stylistic practices in YML files.

If you are just getting started with linting, Flint recommends using the logical and stylistic presets:

flint.config.ts
import { defineConfig, yml } from "flint";
export default defineConfig({
use: [
{
files: yml.files.all,
rules: [yml.presets.logical, yml.presets.stylistic],
},
],
});

If you are experienced with both YML and linting, Flint recommends using the logicalStrict and stylisticStrict presets:

flint.config.ts
import { defineConfig, yml } from "flint";
export default defineConfig({
use: [
{
files: yml.files.all,
rules: [yml.presets.logicalStrict, yml.presets.stylisticStrict],
},
],
});

Rules that find bugs and enforce good YML practices for most-to-all YML files.

flint.config.ts
import { defineConfig, yml } from "flint";
export default defineConfig({
use: [
{
files: yml.files.all,
rules: yml.presets.logical,
},
],
});

Additional logical rules that enforce best practices which are not always straightforward to implement. These rules are recommended for projects where a majority of developers are experienced with both YML and using a linter.

flint.config.ts
import { defineConfig, yml } from "flint";
export default defineConfig({
use: [
{
files: yml.files.all,
rules: yml.presets.logicalStrict,
},
],
});

This preset’s rules are a superset of those in logical.

Rules that enforce consistent styling and best stylistic practices for most-to-all YML files.

flint.config.ts
import { defineConfig, yml } from "flint";
export default defineConfig({
use: [
{
files: yml.files.all,
rules: yml.presets.stylistic,
},
],
});

Additional stylistic rules that enforce best practices which are not always straightforward to implement. These rules are recommended for projects where a majority of developers are experienced with both YML and using a linter.

flint.config.ts
import { defineConfig, yml } from "flint";
export default defineConfig({
use: [
{
files: yml.files.all,
rules: yml.presets.stylisticStrict,
},
],
});

This preset’s rules are a superset of those in stylistic.

Implemented: 1 of 11 (9%)
Flint NamePresetBiome Rule(s)Deno Lint Rule(s)ESLint Rule(s)Oxlint Rule(s)
emptyDocumentsLogicalyml/no-empty-document
emptyMappingKeysLogicalyml/no-empty-key
emptyMappingValuesLogicalyml/no-empty-mapping-value
emptySequenceEntriesLogicalyml/no-empty-sequence-entry
stringMappingKeysLogical (Strict)yml/require-string-key
blockMappingsStylisticyml/block-mapping
blockSequencesStylisticyml/block-sequence
irregularWhitespaceStylisticyml/no-irregular-whitespace
fileExtensionsStylistic (Strict)yml/file-extension
numericTrailingZerosStylistic (Strict)yml/no-trailing-zeros
plainScalarsStylistic (Strict)yml/plain-scalar

Flint’s YAML plugin provides the following file selector:

  • all: **/*.{yaml,yml}
Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.