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

eslint-plugin-json-files

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-json-files

ESLint JSON processor and rules

  • 4.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51K
increased by1.15%
Maintainers
0
Weekly downloads
 
Created
Source

eslint-plugin-json-files

npm version

ESLint JSON processor and rules

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-json-files:

$ npm install eslint-plugin-json-files --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-json-files globally.

Usage

Add json-files to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "json-files"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "json-files/rule-name": "error"
    }
}

Don't forget to use the extension option.

eslint . --ext js,json

Supported Rules

Rule IDDescription
json-files/ensure-repository-directoryensure repository/directory in package.json
json-files/ensure-volta-extendsensure volta-extends in package.json
json-files/ensure-workspacesensure workspace globs in package.json resolve to directories
json-files/eol-lastrequire or disallow newline at the end of package.json
json-files/no-branch-in-dependenciesprevent branches in package.json dependencies
json-files/require-enginesrequire the engines field in package.json
json-files/require-licenserequire a license in package.json
json-files/require-unique-dependency-namesprevent duplicate packages in dependencies and devDependencies
json-files/restrict-rangesrestrict the dependency ranges in package.json
json-files/sort-package-jsonenforce package.json sorting
json-files/validate-schemarequire a valid JSON Schema

Footnotes

I wouldn't mind getting this merged into eslint-plugin-node or eslint-plugin-json.

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