jsonc-eslint-parser
JSON, JSONC and JSON5 parser for use with ESLint plugins
Last updated 3 years ago by ota-meshi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install jsonc-eslint-parser 
SYNC missed versions from official npm registry.

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

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.

{
  // ...
  "overrides": [
    {
      "files": ["*.json", "*.json5"],
      "parser": "jsonc-eslint-parser",
      // 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.

:couple: Related Packages

:lock: License

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

Current Tags

  • 2.4.0                                ...           latest (a year ago)

23 Versions

  • 2.4.0                                ...           a year ago
  • 2.3.0                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.4                                ...           3 years ago
  • 2.0.3                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.4.1                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.1                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.6.2                                ...           4 years ago
  • 0.6.1                                ...           4 years ago
  • 0.6.0                                ...           4 years ago
  • 0.5.2                                ...           4 years ago
  • 0.5.1                                ...           4 years ago
  • 0.5.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE