Registry / devops / yaml-config-lint

yaml-config-lint

JSON →
library1.0.1jsnpmunverified

This package (v1.0.1) is a CLI tool for linting multiline JSON configuration embedded inside YAML files. It allows you to specify YAML keys containing JSON strings and validates them using jsonlint. The tool is built with oclif and requires Node.js >=12.0.0. It ships TypeScript type declarations. There is no known release cadence; the project appears to be a single-version release. Key differentiators include simple CLI usage with glob support for files and dot-notation for nested keys, making it easy to validate inline JSON in Kubernetes ConfigMaps or similar YAML structures.

npm install yaml-config-lint
INSTALL
IMPORT
SIG · YAML-CONFIG-LINT
Y
yaml-config-lint
devopsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ycl
npx ycl -f <file> -k <key>
ycl -f <file> -k <key>
If installed globally, use 'ycl'. If not, use npx to run the CLI.
runYamlConfigLint
import { runYamlConfigLint } from 'yaml-config-lint'
const runYamlConfigLint = require('yaml-config-lint')
The package is ESM-only (exports from package.json), so CommonJS require will fail.
YamlConfigLintOptions
import type { YamlConfigLintOptions } from 'yaml-config-lint'
TypeScript type available for options object.

Shows basic usage: create a YAML file with a JSON string under a nested key, then run the CLI to validate it.

// Create a sample YAML file with embedded JSON echo 'data: pokemon: | { "ability": { "name": "imposter", "url": "https://pokeapi.co/api/v2/ability/150/" }, "is_hidden": true, "slot": 3 }' > sample.yaml // Run the linter npx yaml-config-lint -f sample.yaml -k data.pokemon
yaml-config-lint --version
Debug
Known issues
breakingThe package may have breaking changes in future versions; current version is 1.0.1 with no changelog.
fix
Pin version in package.json if using programmatic API.
affects: all
gotchaThe CLI requires both -f and -k flags; missing one will cause a usage error.
fix
Always provide both --files and --keys options.
affects: all
gotchaThe package only validates JSON inside YAML, not the YAML structure itself.
fix
Use a separate YAML linter (e.g., yamllint) for YAML syntax validation.
affects: all
deprecatedNode.js 12 is EOL; the engine requirement may cause issues on newer Node versions.
fix
Use Node.js 14 or newer, but verify compatibility.
affects: >=12.0.0
Errors
Common errors & fixes
Parse error on line 2: {...}
Invalid JSON inside the YAML value.
fix
Fix the JSON syntax in the YAML file (e.g., missing commas, brackets).
'-k' is required
Missing the --keys option when running the CLI.
fix
Add -k <key> to the command, e.g., -k data.pokemon
Cannot find module 'yaml-config-lint'
Package not installed or CommonJS require used incorrectly.
fix
Install the package and use ESM import, or run via npx.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
@oclif/corerequiredCLI framework used by yaml-config-lint
jsonlintrequiredJSON validation engine used for linting
Agent activity
39 hits · last 30 days
node
34
Amazon
1
OpenAI (training)
1
Resources
yaml-config-lint — npm install yaml-config-lint · libregistry