@kendallgassner/eslint-plugin-package-json

Rules for valid, consistent, and readable package.json files

Usage no npm install needed!

<script type="module">
  import kendallgassnerEslintPluginPackageJson from 'https://cdn.skypack.dev/@kendallgassner/eslint-plugin-package-json';
</script>

README

This repo is forked off of eslint-plugin-package-json and is temporarily being used while https://github.com/zetlen/eslint-plugin-package-json/pull/11 is in the review process. The purpose of this published version is to have access to the local-dependency rule as it is being reviewed.

@kendallgassner/eslint-plugin-package-json

Rules for valid, consistent, and readable package.json files

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install @kendallgassner/eslint-plugin-package-json:

$ npm install @kendallgassner/eslint-plugin-package-json --save-dev

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

Usage

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

{
    "plugins": ["@kendallgassner/eslint-plugin-package-json"]
}
{
    "rules": {
        "@kendallgassner/package-json/local-dependency": 2
    }
}

Supported Rules

These rules only run on package.json files; they will ignore all other files being linted. They lint package.json files at project root, and in any subfolder of the project, making this plugin great for monorepos.