Find a pattern in files. Error if any match.
This plugin requires Grunt
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-lint-pattern --save-dev
The "lint_pattern" task
In your project's Gruntfile, add a section named
lint_pattern to the data object passed into
An array of "rules" that will be used to test files. Rules have the form:
A RegExp that will be used to test files.
A message that will print when pattern is found.
If present, this function will be called once for each matching file to decide whether to test this rule. Return
true to allow checking this file. Return
false to skip checking this file.
This is particularly useful if you are checking a large list of rules over a large list of files and a small number of files that should be excluded by certain rules. The advantage of filtering out the few exclusions compared to creating multiple targets is that the files need only be read from disk once if there's a single target.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- 0.1.0 Initial release
- 0.1.4 add