You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

grunt-npm-package-json-lint

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-npm-package-json-lint

A Grunt wrapper for npm-package-json-lint

4.0.0
latest
Source
npmnpm
Version published
Weekly downloads
20
5.26%
Maintainers
1
Weekly downloads
 
Created
Source

grunt-npm-package-json-lint

A Grunt wrapper for npm-package-json-lint

license npm CircleCI Dependency Status devDependency Status

Getting Started

This plugin requires Grunt >=0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-npm-package-json-lint --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-npm-package-json-lint');

The "npmpackagejsonlint" task

Overview

In your project's Gruntfile, add a section named npmpackagejsonlint to the data object passed into grunt.initConfig().

grunt.initConfig({
  npmpackagejsonlint: {
    options: {
      // Task-specific options go here.
    },
    files: {
      // Target-specific file lists and/or options go here.
    }
  }
});

Options

options.configFile

  • Type: String
  • Default: ``

.npmpackagejsonlintrc file to use for rules config

options.quiet

  • Type: Boolean
  • Default: false

Report errors only.

options.maxWarnings

  • Type: Number
  • Default: -1 (means no limit)

Number of warnings to trigger non-zero exit code.

Usage Examples

Default Options

In this example, the default options are used to lint package.json files.

grunt.initConfig({
  npmpackagejsonlint: {
    options: {
      quiet: false,
      maxWarnings: -1
    },
    files: {
      src: ['./package.json']
    }
  }
});

Custom Options

In this example, the custom options are used to lint package.json files. All warnings will be suppressed.

grunt.initConfig({
  npmpackagejsonlint: {
    options: {
      configFile: '.npmpackagejsonlintrc.json',
      quiet: true
    },
    files: {
      src: ['./package.json']
    }
  }
})

Migrating from v2 to v3

The following options have been removed:

  • ignorewarnings
  • stoponwarning
  • showallerrors

If you were using ignorewarnings, please use quiet instead. If you were using stoponwarning, please use maxWarnings and set the threshold you would like a non-zero exit code to be returned.

Contributing

Please see CONTRIBUTING.md.

Release History

Please see CHANGELOG.md.

License

Copyright (c) 2016-2019 Thomas Lindner. Licensed under the MIT license.

Keywords

gruntplugin

FAQs

Package last updated on 06 Oct 2019

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