JSON, JSONC and JSON5 parser for use with ESLint plugins.
Installations
npm install jsonc-eslint-parser
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
^12.22.0 || ^14.17.0 || >=16.0.0
Node Version
18.18.2
NPM Version
9.8.1
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (81.64%)
Vue (13.86%)
HTML (2.57%)
JavaScript (1.93%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
ota-meshi
Download Statistics
Total Downloads
145,354,832
Last Day
467,804
Last Week
2,350,600
Last Month
9,698,750
Last Year
91,900,760
GitHub Statistics
MIT License
62 Stars
241 Commits
3 Forks
4 Watchers
11 Branches
4 Contributors
Updated on Jan 03, 2025
Bundle Size
185.88 kB
Minified
54.90 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
2.4.0
Package Id
jsonc-eslint-parser@2.4.0
Unpacked Size
76.01 kB
Size
16.33 kB
File Count
39
NPM Version
9.8.1
Node Version
18.18.2
Published on
Oct 24, 2023
Total Downloads
Cumulative downloads
Total Downloads
145,354,832
Last Day
5.4%
467,804
Compared to previous day
Last Week
6.7%
2,350,600
Compared to previous week
Last Month
57.1%
9,698,750
Compared to previous month
Last Year
119.6%
91,900,760
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Dev Dependencies
31
jsonc-eslint-parser
:name_badge: Introduction
JSON, JSONC and JSON5 parser for use with ESLint plugins.
This parser allows us to lint JSON, JSONC and JSON5 files. This parser and the rules of eslint-plugin-jsonc would catch some of the mistakes and code style violations.
See eslint-plugin-jsonc for details.
:cd: Installation
1npm i --save-dev jsonc-eslint-parser
:book: Usage
In your ESLint configuration file, set the overrides
> parser
property:
1{ 2 // ... 3 // Add the following settings. 4 "overrides": [ 5 { 6 "files": ["*.json", "*.json5"], // Specify the extension or pattern you want to parse as JSON. 7 "parser": "jsonc-eslint-parser", // Set this parser. 8 }, 9 ], 10}
:gear: Configuration
The following additional configuration options are available by specifying them in parserOptions in your ESLint configuration file.
1{ 2 // ... 3 "overrides": [ 4 { 5 "files": ["*.json", "*.json5"], 6 "parser": "jsonc-eslint-parser", 7 // Additional configuration options 8 "parserOptions": { 9 "jsonSyntax": "JSON5" 10 } 11 }, 12 ], 13}
parserOptions.jsonSyntax
Set to "JSON"
, "JSONC"
or "JSON5"
. Select the JSON syntax you are using.
If not specified, all syntaxes that express static values are accepted. For example, template literals without interpolation.
Note : Recommended to loosen the syntax checking by the parser and use check rules of eslint-plugin-jsonc to automatically fix it.
Usage for Custom Rules / Plugins
- AST.md is AST specification.
- Plugins.md describes using this in an ESLint plugin.
- no-template-literals.ts is an example.
- You can see the AST on the Online DEMO.
:traffic_light: Semantic Versioning Policy
jsonc-eslint-parser follows Semantic Versioning.
:couple: Related Packages
- eslint-plugin-jsonc ... ESLint plugin for JSON, JSON with comments (JSONC) and JSON5.
- eslint-plugin-yml ... ESLint plugin for YAML.
- eslint-plugin-toml ... ESLint plugin for TOML.
- eslint-plugin-json-schema-validator ... ESLint plugin that validates data using JSON Schema Validator.
- yaml-eslint-parser ... YAML parser for use with ESLint plugins.
- toml-eslint-parser ... TOML parser for use with ESLint plugins.
:lock: License
See the LICENSE file for license rights and limitations (MIT).

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 1/18 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: topLevel 'contents' permission set to 'read': .github/workflows/GHPages.yml:10
- Warn: no topLevel permission defined: .github/workflows/NodeCI.yml:1
- Warn: topLevel 'contents' permission set to 'write': .github/workflows/Release.yml:9
- Warn: topLevel 'contents' permission set to 'write': .github/workflows/format.yml:7
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/GHPages.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/GHPages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/GHPages.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/GHPages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/GHPages.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/GHPages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/GHPages.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/GHPages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/GHPages.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/GHPages.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/NodeCI.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/NodeCI.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/Release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/Release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/Release.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/Release.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/Release.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/Release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/format.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/format.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/format.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/format.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/ota-meshi/jsonc-eslint-parser/stale.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/GHPages.yml:31
- Warn: npmCommand not pinned by hash: .github/workflows/GHPages.yml:34
- Warn: npmCommand not pinned by hash: .github/workflows/NodeCI.yml:34
- Warn: npmCommand not pinned by hash: .github/workflows/NodeCI.yml:50
- Warn: npmCommand not pinned by hash: .github/workflows/NodeCI.yml:51
- Warn: npmCommand not pinned by hash: .github/workflows/NodeCI.yml:63
- Warn: npmCommand not pinned by hash: .github/workflows/NodeCI.yml:17
- Warn: npmCommand not pinned by hash: .github/workflows/Release.yml:29
- Warn: npmCommand not pinned by hash: .github/workflows/format.yml:20
- Info: 0 out of 18 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 9 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 24 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to jsonc-eslint-parser
eslint-json-compat-utils
A utility that converts rules made for checking the AST of `jsonc-eslint-parser` into rules compatible with `@eslint/json`.
@yomukizrj/eslint-config-json
eslint中的json配置 ## 依赖 - [eslint-plugin-jsonc](https://www.npmjs.com/package/eslint-plugin-jsonc) json,jsonc,json5 解析器 - [jsonc-eslint-parser](https://www.npmjs.com/package/jsonc-eslint-parser) 提供了lint规则