You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

jsonc-eslint-parser

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonc-eslint-parser

JSON, JSONC and JSON5 parser for use with ESLint plugins

Source
npmnpm
Version
3.0.0
Version published
Maintainers
2
Created
Source

jsonc-eslint-parser

NPM license NPM version NPM downloads NPM downloads Build Status Coverage Status

: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

npm i --save-dev jsonc-eslint-parser

:book: Usage (Flat Config)

In your ESLint configuration file, set the parser property:

import * as jsoncParser from "jsonc-eslint-parser";

export default [
  {
    // ...
    // Add the following settings.
    files: ["**/*.json", "**/*.json5"], // Specify the extension or pattern you want to parse as JSON.
    languageOptions: {
      parser: jsoncParser, // Set this parser.
    }
  },
];

:book: Usage (Legacy Config)

In your ESLint configuration file, set the overrides > parser property:

{
  // ...
  // Add the following settings.
  "overrides": [
    {
      "files": ["*.json", "*.json5"], // Specify the extension or pattern you want to parse as JSON.
      "parser": "jsonc-eslint-parser", // Set this parser.
    },
  ],
}

:gear: Configuration

The following additional configuration options are available by specifying them in parserOptions in your ESLint configuration file.

{
  // Additional configuration options
  "parserOptions": {
    "jsonSyntax": "JSON5"
  }
}

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

:traffic_light: Semantic Versioning Policy

jsonc-eslint-parser follows Semantic Versioning.

:lock: License

See the LICENSE file for license rights and limitations (MIT).

Keywords

eslint

FAQs

Package last updated on 19 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts