Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4
JSON, JSONC and JSON5 parser for use with ESLint plugins.
License
ota-meshi/jsonc-eslint-parser
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
npm i --save-dev jsonc-eslint-parser
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.}},];
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.},],}
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"}},],}
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.
- 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 theOnline DEMO.
jsonc-eslint-parser followsSemantic Versioning.
- 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.
See theLICENSE file for license rights and limitations (MIT).
About
JSON, JSONC and JSON5 parser for use with ESLint plugins.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Contributors6
Uh oh!
There was an error while loading.Please reload this page.