🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

eslint-plugin-jsonc

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jsonc

ESLint plugin for JSON, JSONC and JSON5 files.

2.20.0
Source
npm
Version published
Weekly downloads
661K
-5.88%
Maintainers
2
Weekly downloads
 
Created

What is eslint-plugin-jsonc?

eslint-plugin-jsonc is an ESLint plugin that provides linting rules for JSON and JSONC (JSON with comments) files. It helps ensure consistency and correctness in JSON files by enforcing specific coding standards and best practices.

What are eslint-plugin-jsonc's main functionalities?

Enforce Consistent Indentation

This rule enforces consistent indentation in JSON files. The example configures the rule to use 2 spaces for indentation.

{
  "rules": {
    "jsonc/indent": ["error", 2]
  }
}

Disallow Trailing Commas

This rule disallows trailing commas in JSON files, which can help prevent syntax errors in environments that do not support them.

{
  "rules": {
    "jsonc/no-trailing-comma": "error"
  }
}

Require Property Keys to be in CamelCase

This rule enforces that property keys in JSON files are written in camelCase, promoting a consistent naming convention.

{
  "rules": {
    "jsonc/camelcase": "error"
  }
}

Disallow Comments

This rule disallows comments in JSON files, ensuring that the files remain pure JSON without any additional annotations.

{
  "rules": {
    "jsonc/no-comments": "error"
  }
}

Other packages similar to eslint-plugin-jsonc

Keywords

eslint

FAQs

Package last updated on 25 Mar 2025

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