{"name":"yaml-eslint-parser","version":"1.3.1","keywords":["yaml","eslint","parser"],"author":{"name":"Yosuke Ota"},"license":"MIT","_id":"yaml-eslint-parser@1.3.1","maintainers":[{"name":"ota-meshi","email":"otameshiyo23@gmail.com"}],"homepage":"https://github.com/ota-meshi/yaml-eslint-parser#readme","bugs":{"url":"https://github.com/ota-meshi/yaml-eslint-parser/issues"},"dist":{"shasum":"ca8e90b74380db68d5cf7424683f4fbd6b28a381","tarball":"http://registry-npm.ywwl.com/yaml-eslint-parser/download/yaml-eslint-parser-1.3.1.tgz","fileCount":39,"integrity":"sha512-MdSgP9YA9QjtAO2+lt4O7V2bnH22LPnfeVLiQqjY3cOyn8dy/Ief8otjIe6SPPTK03nM7O3Yl0LTfWuF7l+9yw==","signatures":[{"sig":"MEUCIQDU+AvE+i4lemCtVDimU/ataj7Snp3Dp+QRM4349DtQ6AIgCzlcCZmXUHmZx+M+6NCYMU10J/+gMVIkV71uN1Q6Aug=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/yaml-eslint-parser@1.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":92593,"size":19942,"noattachment":false,"key":"/yaml-eslint-parser/-/yaml-eslint-parser-1.3.1.tgz"},"main":"lib/index.js","types":"./lib/index.d.ts","engines":{"node":"^14.17.0 || >=16.0.0"},"funding":"https://github.com/sponsors/ota-meshi","gitHead":"08e45612a87160968af5e5aa48ad7bf2049be26d","scripts":{"lint":"eslint .","test":"mocha --require ts-node/register \"tests/src/**/*.ts\" --reporter dot --timeout 60000","build":"npm run build:meta && npm run build:tsc","clean":"rimraf .nyc_output lib coverage","cover":"nyc --reporter=lcov npm run test","debug":"mocha --require ts-node/register/transpile-only \"tests/src/**/*.ts\" --reporter dot","release":"changeset publish","prebuild":"npm run -s clean","benchmark":"ts-node --transpile-only benchmark/index.ts","build:tsc":"tsc --project ./tsconfig.build.json","build:meta":"ts-node --transpile-only ./tools/update-meta.ts","eslint-fix":"npm run lint -- --fix","prerelease":"npm run clean && npm run build","preversion":"npm run lint && npm test","version:ci":"env-cmd -e version-ci npm run build:meta && changeset version","update-fixtures":"ts-node ./tools/update-fixtures.ts","strict-type-check":"tsc --project ./tsconfig.build.json --noEmit --module esnext --moduleResolution bundler"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:642808a8-7c89-4ab6-b33f-740f4db9695c"}},"repository":{"url":"git+https://github.com/ota-meshi/yaml-eslint-parser.git","type":"git"},"_npmVersion":"11.6.2","description":"A YAML parser that produces output compatible with ESLint","directories":{},"_nodeVersion":"24.11.1","dependencies":{"yaml":"^2.0.0","eslint-visitor-keys":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.0.0","mocha":"^11.0.0","eslint":"^9.15.0","semver":"^7.3.7","env-cmd":"^10.1.0","ts-node":"^10.0.0","prettier":"^3.0.0","benchmark":"^2.1.4","typescript":"^5.0.0","@types/node":"^22.0.0","@types/mocha":"^10.0.0","@types/eslint":"^9.0.0","@types/semver":"^7.3.10","@changesets/cli":"^2.24.2","eslint-plugin-n":"^17.0.0","yaml-test-suite":"^0.0.2","@types/benchmark":"^2.1.1","eslint-plugin-vue":"^10.0.0","typescript-eslint":"^8.16.0","vue-eslint-parser":"^10.0.0","eslint-plugin-jsdoc":"^50.6.0","eslint-plugin-jsonc":"^2.0.0","eslint-plugin-regexp":"^2.0.0","eslint-config-prettier":"^10.0.0","eslint-plugin-prettier":"^5.0.0","@ota-meshi/eslint-plugin":"^0.18.0","@typescript-eslint/parser":"^8.16.0","@types/eslint-visitor-keys":"^3.0.0","@changesets/changelog-github":"^0.5.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-node-dependencies":"^0.13.0","@typescript-eslint/eslint-plugin":"^8.16.0","eslint-plugin-json-schema-validator":"^5.0.0","@eslint-community/eslint-plugin-eslint-comments":"^4.4.1"},"_npmOperationalInternal":{"tmp":"tmp/yaml-eslint-parser_1.3.1_1764038238821_0.6423618809909204","host":"s3://npm-registry-packages-npm-production"},"readme":"# yaml-eslint-parser\n\nA YAML parser that produces output [compatible with ESLint](https://eslint.org/docs/developer-guide/working-with-custom-parsers#all-nodes).\n\n_This parser is backed by excellent [yaml](https://github.com/eemeli/yaml) package and it is heavily inspired by [yaml-unist-parser](https://github.com/ikatyang/yaml-unist-parser) package._\n\n[![NPM license](https://img.shields.io/npm/l/yaml-eslint-parser.svg)](https://www.npmjs.com/package/yaml-eslint-parser)\n[![NPM version](https://img.shields.io/npm/v/yaml-eslint-parser.svg)](https://www.npmjs.com/package/yaml-eslint-parser)\n[![NPM downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&colorB=green&suffix=/day&query=$.downloads&uri=https://api.npmjs.org//downloads/point/last-day/yaml-eslint-parser&maxAge=3600)](http://www.npmtrends.com/yaml-eslint-parser)\n[![NPM downloads](https://img.shields.io/npm/dw/yaml-eslint-parser.svg)](http://www.npmtrends.com/yaml-eslint-parser)\n[![NPM downloads](https://img.shields.io/npm/dm/yaml-eslint-parser.svg)](http://www.npmtrends.com/yaml-eslint-parser)\n[![NPM downloads](https://img.shields.io/npm/dy/yaml-eslint-parser.svg)](http://www.npmtrends.com/yaml-eslint-parser)\n[![NPM downloads](https://img.shields.io/npm/dt/yaml-eslint-parser.svg)](http://www.npmtrends.com/yaml-eslint-parser)\n[![Build Status](https://github.com/ota-meshi/yaml-eslint-parser/workflows/CI/badge.svg?branch=master)](https://github.com/ota-meshi/yaml-eslint-parser/actions?query=workflow%3ACI)\n[![Coverage Status](https://coveralls.io/repos/github/ota-meshi/yaml-eslint-parser/badge.svg?branch=master)](https://coveralls.io/github/ota-meshi/yaml-eslint-parser?branch=master)\n\n## Installation\n\n```bash\nnpm install --save-dev yaml-eslint-parser\n```\n\n## Usage\n\n### Configuration\n\nUse `eslint.config.js` file to configure parser (ESLint v9+). See also: [https://eslint.org/docs/latest/use/configure/](https://eslint.org/docs/latest/use/configure/).\n\nExample **eslint.config.js**:\n\n```js\nimport * as yamlParser from \"yaml-eslint-parser\";\n\nexport default [\n  {\n    files: [\"*.yaml\", \"*.yml\"],\n    languageOptions: {\n      parser: yamlParser,\n    },\n  },\n];\n```\n\n<details>\n<summary>For ESLint v8 and earlier (.eslintrc.js)</summary>\n\n```js\nmodule.exports = {\n  overrides: [\n    {\n      files: [\"*.yaml\", \"*.yml\"],\n      parser: \"yaml-eslint-parser\",\n    },\n  ],\n};\n```\n\n</details>\n\n### Advanced Configuration\n\nThe following additional configuration options are available by specifying them in [parserOptions](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options) in your ESLint configuration file.\n\nExample **eslint.config.js**:\n\n```js\nimport * as yamlParser from \"yaml-eslint-parser\";\n\nexport default [\n  {\n    files: [\"*.yaml\", \"*.yml\"],\n    languageOptions: {\n      parser: yamlParser,\n      // Additional configuration options\n      parserOptions: {\n        defaultYAMLVersion: \"1.2\",\n      },\n    },\n  },\n];\n```\n\n<details>\n<summary>For ESLint v8 and earlier (.eslintrc.js)</summary>\n\n```js\nmodule.exports = {\n  overrides: [\n    {\n      files: [\"*.yaml\", \"*.yml\"],\n      parser: \"yaml-eslint-parser\",\n      // Additional configuration options\n      parserOptions: {\n        defaultYAMLVersion: \"1.2\",\n      },\n    },\n  ],\n};\n```\n\n</details>\n\n#### `parserOptions.defaultYAMLVersion`\n\nSet to `\"1.2\"` or `\"1.1\"`. Select the YAML version used by documents without a `%YAML` directive.  \nIf not specified, the [yaml](https://eemeli.org/yaml/)'s default `version` option (`\"1.2\"`) is used.  \nSee <https://eemeli.org/yaml/#document-options> for details.\n\n## Usage for Custom Rules / Plugins\n\n- [AST.md](./docs/AST.md) is AST specification.\n- [block-mapping.ts](https://github.com/ota-meshi/eslint-plugin-yml/blob/master/src/rules/block-mapping.ts) is an example.\n- You can see the AST on the [Online DEMO](https://ota-meshi.github.io/yaml-eslint-parser/).\n\n## Usage for Directly\n\nExample:\n\n```ts\nimport type { AST } from \"yaml-eslint-parser\";\nimport { parseYAML, getStaticYAMLValue } from \"yaml-eslint-parser\";\n\nconst code = `\namerican:\n  - Boston Red Sox\n  - Detroit Tigers\n  - New York Yankees\nnational:\n  - New York Mets\n  - Chicago Cubs\n  - Atlanta Braves\n`;\n\nconst ast: AST.YAMLProgram = parseYAML(code);\nconsole.log(ast);\n\nconst value = getStaticYAMLValue(ast);\nconsole.log(value);\n```\n\n## Related Packages\n\n- [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc) ... ESLint plugin for JSON, JSON with comments (JSONC) and JSON5.\n- [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) ... ESLint plugin for YAML.\n- [eslint-plugin-toml](https://github.com/ota-meshi/eslint-plugin-toml) ... ESLint plugin for TOML.\n- [eslint-plugin-json-schema-validator](https://github.com/ota-meshi/eslint-plugin-json-schema-validator) ... ESLint plugin that validates data using JSON Schema Validator.\n- [jsonc-eslint-parser](https://github.com/ota-meshi/jsonc-eslint-parser) ... JSON, JSONC and JSON5 parser for use with ESLint plugins.\n- [toml-eslint-parser](https://github.com/ota-meshi/toml-eslint-parser) ... TOML parser for use with ESLint plugins.\n","publish_time":1764038239051,"_cnpm_publish_time":1764038239051,"dist-tags":{"latest":"2.1.0","next":"1.0.0"}}