Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-jsonc

Package Overview
Dependencies
Maintainers
0
Versions
55
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.18.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
503K
increased by0.59%
Maintainers
0
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

FAQs

Package last updated on 18 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc