Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
'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 = (/