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.
ð¿ Installationnpm i --save-dev jsonc-eslint-parserð 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. }, ], }âï¸ 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 / Pluginsjsonc-eslint-parser follows Semantic Versioning.
See the LICENSE file for license rights and limitations (MIT).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4