Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JSON, JSONC and JSON5 parser for use with ESLint plugins.

License

NotificationsYou must be signed in to change notification settings

ota-meshi/jsonc-eslint-parser

Repository files navigation

NPM licenseNPM versionNPM downloadsNPM downloadsBuild StatusCoverage Status

📛 Introduction

JSON,JSONC andJSON5 parser for use withESLint plugins.

This parser allows us to lintJSON,JSONC andJSON5 files.This parser and the rules ofeslint-plugin-jsonc would catch some of the mistakes and code style violations.

Seeeslint-plugin-jsonc for details.

💿 Installation

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

📖 Usage (Flat Config)

In your ESLint configuration file, set theparser property:

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

📖 Usage (Legacy Config)

In your ESLint configuration file, set theoverrides >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.},],}

⚙️ Configuration

The following additional configuration options are available by specifying them inparserOptions 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 ofeslint-plugin-jsonc to automatically fix it.

Usage for Custom Rules / Plugins

🚥 Semantic Versioning Policy

jsonc-eslint-parser followsSemantic Versioning.

👫 Related Packages

🔒 License

See theLICENSE file for license rights and limitations (MIT).

About

JSON, JSONC and JSON5 parser for use with ESLint plugins.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp