{"id":15118337,"url":"https://github.com/ota-meshi/jsonc-eslint-parser","last_synced_at":"2025-04-09T04:05:30.714Z","repository":{"id":40246246,"uuid":"287420137","full_name":"ota-meshi/jsonc-eslint-parser","owner":"ota-meshi","description":"JSON, JSONC and JSON5 parser for use with ESLint plugins.","archived":false,"fork":false,"pushed_at":"2024-10-08T22:04:34.000Z","size":276,"stargazers_count":59,"open_issues_count":11,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T01:37:34.535Z","etag":null,"topics":["eslint-custom-parser","eslint-parser","json","json5","jsonc","parser"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ota-meshi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ota-meshi","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-08-14T01:59:07.000Z","updated_at":"2024-09-15T14:10:34.000Z","dependencies_parsed_at":"2023-11-16T00:34:15.498Z","dependency_job_id":"5395c2d3-54cf-44c7-b353-3be02ff7e802","html_url":"https://github.com/ota-meshi/jsonc-eslint-parser","commit_stats":{"total_commits":241,"total_committers":5,"mean_commits":48.2,"dds":0.4813278008298755,"last_synced_commit":"1fe0d2e4eb18e9b4a987db40986f34c6b7bc399c"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Fjsonc-eslint-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Fjsonc-eslint-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Fjsonc-eslint-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ota-meshi%2Fjsonc-eslint-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ota-meshi","download_url":"https://codeload.github.com/ota-meshi/jsonc-eslint-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953032,"owners_count":21023947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint-custom-parser","eslint-parser","json","json5","jsonc","parser"],"created_at":"2024-09-26T01:46:13.658Z","updated_at":"2025-04-09T04:05:30.651Z","avatar_url":"https://github.com/ota-meshi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ota-meshi"],"categories":["TypeScript"],"sub_categories":[],"readme":"# jsonc-eslint-parser\n\n[![NPM license](https://img.shields.io/npm/l/jsonc-eslint-parser.svg)](https://www.npmjs.com/package/jsonc-eslint-parser)\n[![NPM version](https://img.shields.io/npm/v/jsonc-eslint-parser.svg)](https://www.npmjs.com/package/jsonc-eslint-parser)\n[![NPM downloads](https://img.shields.io/npm/dw/jsonc-eslint-parser.svg)](http://www.npmtrends.com/jsonc-eslint-parser)\n[![NPM downloads](https://img.shields.io/npm/dm/jsonc-eslint-parser.svg)](http://www.npmtrends.com/jsonc-eslint-parser)\n[![Build Status](https://github.com/ota-meshi/jsonc-eslint-parser/workflows/CI/badge.svg?branch=master)](https://github.com/ota-meshi/jsonc-eslint-parser/actions?query=workflow%3ACI)\n[![Coverage Status](https://coveralls.io/repos/github/ota-meshi/jsonc-eslint-parser/badge.svg?branch=master)](https://coveralls.io/github/ota-meshi/jsonc-eslint-parser?branch=master)\n\n## :name_badge: Introduction\n\n[JSON], [JSONC] and [JSON5] parser for use with [ESLint] plugins.\n\nThis parser allows us to lint [JSON], [JSONC] and [JSON5] files.\nThis parser and the rules of [eslint-plugin-jsonc] would catch some of the mistakes and code style violations.\n\nSee [eslint-plugin-jsonc] for details.\n\n## :cd: Installation\n\n```bash\nnpm i --save-dev jsonc-eslint-parser\n```\n\n## :book: Usage (Flat Config)\n\nIn your ESLint configuration file, set the `parser` property:\n\n```js\nimport jsoncParser from \"jsonc-eslint-parser\";\n\nexport default [\n  {\n    // ...\n    // Add the following settings.\n    files: [\"*.json\", \"*.json5\"], // Specify the extension or pattern you want to parse as JSON.\n    languageOptions: {\n      parser: jsoncParser, // Set this parser.\n    }\n  },\n];\n```\n\n## :book: Usage (Legacy Config)\n\nIn your ESLint configuration file, set the `overrides` \u003e `parser` property:\n\n```json5\n{\n  // ...\n  // Add the following settings.\n  \"overrides\": [\n    {\n      \"files\": [\"*.json\", \"*.json5\"], // Specify the extension or pattern you want to parse as JSON.\n      \"parser\": \"jsonc-eslint-parser\", // Set this parser.\n    },\n  ],\n}\n```\n\n## :gear: Configuration\n\nThe following additional configuration options are available by specifying them in [parserOptions](https://eslint.org/docs/user-guide/configuring#specifying-parser-options-1) in your ESLint configuration file.\n\n```json5\n{\n  // ...\n  \"overrides\": [\n    {\n      \"files\": [\"*.json\", \"*.json5\"],\n      \"parser\": \"jsonc-eslint-parser\",\n      // Additional configuration options\n      \"parserOptions\": {\n        \"jsonSyntax\": \"JSON5\"\n      }\n    },\n  ],\n}\n```\n\n### `parserOptions.jsonSyntax`\n\nSet to `\"JSON\"`, `\"JSONC\"` or `\"JSON5\"`. Select the JSON syntax you are using.  \nIf not specified, all syntaxes that express static values ​​are accepted. For example, template literals without interpolation.  \n\n**Note** : Recommended to loosen the syntax checking by the parser and use check rules of [eslint-plugin-jsonc] to automatically fix it.\n\n## Usage for Custom Rules / Plugins\n\n- [AST.md](./docs/AST.md) is AST specification.\n- [Plugins.md](./docs/Plugins.md) describes using this in an ESLint plugin.\n- [no-template-literals.ts](https://github.com/ota-meshi/eslint-plugin-jsonc/blob/master/lib/rules/no-template-literals.ts) is an example.\n- You can see the AST on the [Online DEMO](https://ota-meshi.github.io/jsonc-eslint-parser/).\n\n## :traffic_light: Semantic Versioning Policy\n\n**jsonc-eslint-parser** follows [Semantic Versioning](http://semver.org/).\n\n## :couple: 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- [yaml-eslint-parser](https://github.com/ota-meshi/yaml-eslint-parser) ... YAML 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\n## :lock: License\n\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).\n\n[JSON]: https://json.org/\n[JSONC]: https://github.com/microsoft/node-jsonc-parser\n[JSON5]: https://json5.org/\n[ESLint]: https://eslint.org/\n[eslint-plugin-jsonc]: https://www.npmjs.com/package/eslint-plugin-jsonc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fota-meshi%2Fjsonc-eslint-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fota-meshi%2Fjsonc-eslint-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fota-meshi%2Fjsonc-eslint-parser/lists"}