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

grunt-contrib-jshint

Package Overview
Dependencies
Maintainers
6
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-jshint

Validate files with JSHint

  • 3.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
127K
decreased by-6.96%
Maintainers
6
Weekly downloads
 
Created

What is grunt-contrib-jshint?

grunt-contrib-jshint is a Grunt plugin for running JSHint, a tool that helps to detect errors and potential problems in JavaScript code. It allows you to integrate JSHint into your Grunt build process, enabling automated code quality checks.

What are grunt-contrib-jshint's main functionalities?

Basic JSHint Task

This feature allows you to define a basic JSHint task in your Gruntfile. It specifies the files to be linted and sets JSHint options, such as ECMAScript version.

{
  "grunt.initConfig": {
    "jshint": {
      "files": ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      "options": {
        "esversion": 6
      }
    }
  },
  "grunt.loadNpmTasks": "grunt-contrib-jshint",
  "grunt.registerTask": ["default", ["jshint"]]
}

Custom JSHint Reporter

This feature allows you to use a custom reporter for JSHint, such as 'jshint-stylish', to format the output of linting results in a more readable manner.

{
  "grunt.initConfig": {
    "jshint": {
      "files": ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      "options": {
        "reporter": require('jshint-stylish')
      }
    }
  },
  "grunt.loadNpmTasks": "grunt-contrib-jshint",
  "grunt.registerTask": ["default", ["jshint"]]
}

JSHint with Custom Configuration File

This feature allows you to specify a custom JSHint configuration file (.jshintrc) to define your linting rules and options.

{
  "grunt.initConfig": {
    "jshint": {
      "files": ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      "options": {
        "jshintrc": '.jshintrc'
      }
    }
  },
  "grunt.loadNpmTasks": "grunt-contrib-jshint",
  "grunt.registerTask": ["default", ["jshint"]]
}

Other packages similar to grunt-contrib-jshint

Keywords

FAQs

Package last updated on 18 Feb 2022

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