How to use grunt-contrib-jshint - 2 common examples

To help you get started, we’ve selected a few grunt-contrib-jshint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oxyc / grunt-lint-inline / tasks / lint-inline.js View on Github external
module.exports = function (grunt) {

  var jshint = require('grunt-contrib-jshint/tasks/lib/jshint').init(grunt)
    , lintinline = require('./lib/lint-inline')
    , path = require('path');

  // Copied from grunt-contrib-jshint
  grunt.registerMultiTask('inlinelint', 'Validate inline JS', function () {
    var done = this.async();

    // Merge task-specific and/or target-specific options with these defaults.
    var options = this.options({
      force: grunt.option.flags().indexOf('--force') >= 0,
      reporterOutput: null,
      patterns: [],
    });

    // Report JSHint errors but dont fail the task
    var force = options.force;
github oxyc / grunt-lint-inline / tasks / lib / lint-inline.js View on Github external
'use strict';

var grunt = require('grunt')
  , jshint = require('grunt-contrib-jshint/tasks/lib/jshint').init(grunt)
  , Tempfile = require('temporary/lib/file')
  , jshintReporter = jshint.reporter;

function removeHTML(src, patterns) {
  var lines = src.split('\n')
    , relevant = false;

  lines.forEach(function (line, i) {
    var starts = (/

grunt-contrib-jshint

Validate files with JSHint

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis

Popular grunt-contrib-jshint functions