{"_id":"@131/yaml-eslint-parser","name":"@131/yaml-eslint-parser","dist-tags":{"latest":"1.2.5"},"versions":{"1.2.5":{"name":"@131/yaml-eslint-parser","version":"1.2.5","description":"A YAML parser that produces output compatible with ESLint","main":"lib/index.js","engines":{"node":"^14.17.0 || >=16.0.0"},"scripts":{"prebuild":"npm run -s clean","build":"npm run build:meta && npm run build:tsc","build:meta":"ts-node --transpile-only ./tools/update-meta.ts","build:tsc":"tsc --project ./tsconfig.build.json","clean":"rimraf .nyc_output lib coverage","lint":"eslint .","eslint-fix":"npm run lint -- --fix","test":"mocha --require ts-node/register \"tests/src/**/*.ts\" --reporter dot --timeout 60000","cover":"nyc --reporter=lcov npm run test","debug":"mocha --require ts-node/register/transpile-only \"tests/src/**/*.ts\" --reporter dot","preversion":"npm run lint && npm test","update-fixtures":"ts-node ./tools/update-fixtures.ts","benchmark":"ts-node --transpile-only benchmark/index.ts","prerelease":"npm run clean && npm run build","release":"changeset publish","version:ci":"env-cmd -e version-ci npm run build:meta && changeset version","strict-type-check":"tsc --project ./tsconfig.build.json --noEmit --module esnext --moduleResolution bundler"},"repository":{"type":"git","url":"git+https://github.com/ota-meshi/yaml-eslint-parser.git"},"keywords":["yaml","eslint","parser"],"author":{"name":"Yosuke Ota"},"funding":"https://github.com/sponsors/ota-meshi","license":"MIT","bugs":{"url":"https://github.com/ota-meshi/yaml-eslint-parser/issues"},"homepage":"https://github.com/ota-meshi/yaml-eslint-parser#readme","dependencies":{"eslint-visitor-keys":"^3.0.0","lodash":"^4.17.21","yaml":"^2.0.0"},"devDependencies":{"@changesets/changelog-github":"^0.5.0","@changesets/cli":"^2.24.2","@eslint-community/eslint-plugin-eslint-comments":"^4.4.1","@ota-meshi/eslint-plugin":"^0.17.5","@types/benchmark":"^2.1.1","@types/eslint":"^9.0.0","@types/eslint-visitor-keys":"^3.0.0","@types/lodash":"^4.14.167","@types/mocha":"^10.0.0","@types/node":"^22.0.0","@types/semver":"^7.3.10","@typescript-eslint/eslint-plugin":"^8.16.0","@typescript-eslint/parser":"^8.16.0","benchmark":"^2.1.4","env-cmd":"^10.1.0","eslint":"^9.15.0","eslint-config-prettier":"^10.0.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-jsdoc":"^50.6.0","eslint-plugin-json-schema-validator":"^5.0.0","eslint-plugin-jsonc":"^2.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-node-dependencies":"^0.12.0","eslint-plugin-prettier":"^5.0.0","eslint-plugin-regexp":"^2.0.0","eslint-plugin-vue":"^9.0.0","mocha":"^11.0.0","nyc":"^17.0.0","prettier":"^3.0.0","semver":"^7.3.7","ts-node":"^10.0.0","typescript":"^5.0.0","typescript-eslint":"^8.16.0","vue-eslint-parser":"^9.0.0"},"publishConfig":{"access":"public"},"_id":"@131/yaml-eslint-parser@1.2.5","gitHead":"b5f3937c768395c2f6e80d13897e903baf2ab4d9","types":"./lib/index.d.ts","_nodeVersion":"20.18.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-a7MpJo9BCWjZXEkrvREpUCG072pUjaNXALB8iCpsBa8pKf0i1C+rOMZuauNK2S+Im+h4lmftKEctk4td5Jkpwg==","shasum":"2bea5a794fd5f4013c4c90554f2c131c2e3db33e","tarball":"https://registry.npmjs.org/@131/yaml-eslint-parser/-/yaml-eslint-parser-1.2.5.tgz","fileCount":39,"unpackedSize":89584,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFcn3esx/O7itVm/kYDoEPGz6zKRyjZIwoGnYwrrrIj6AiAJ3UCaiIoRXiSjm5RZ8e9AGnGEsT364FDDvEQ5ROSuDA=="}]},"_npmUser":{"name":"131","email":"131.code@leurent.email"},"directories":{},"maintainers":[{"name":"131","email":"131.code@leurent.email"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yaml-eslint-parser_1.2.5_1738277587199_0.28635407607835295"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-30T22:53:07.084Z","1.2.5":"2025-01-30T22:53:07.400Z","modified":"2025-01-30T22:53:07.681Z"},"maintainers":[{"name":"131","email":"131.code@leurent.email"}],"description":"A YAML parser that produces output compatible with ESLint","homepage":"https://github.com/ota-meshi/yaml-eslint-parser#readme","keywords":["yaml","eslint","parser"],"repository":{"type":"git","url":"git+https://github.com/ota-meshi/yaml-eslint-parser.git"},"author":{"name":"Yosuke Ota"},"bugs":{"url":"https://github.com/ota-meshi/yaml-eslint-parser/issues"},"license":"MIT","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 `.eslintrc.*` file to configure parser. See also: [https://eslint.org/docs/user-guide/configuring](https://eslint.org/docs/user-guide/configuring).\n\nExample **.eslintrc.js**:\n\n```js\nmodule.exports = {\n  overrides: [\n    {\n      files: [\"*.yaml\", \"*.yml\"],\n      parser: \"yaml-eslint-parser\",\n    },\n  ],\n};\n```\n\n### Advanced Configuration\n\nThe following additional configuration options are available by specifying them in [parserOptions](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options) in your ESLint configuration file.\n\nExample **.eslintrc.js**:\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#### `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","readmeFilename":"README.md"}