Package Exports
- mimosa-jshint
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mimosa-jshint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mimosa-jshint
This is Mimosa's JavaScript hinting module. It is soon to be a Mimosa default module but can be used in any scenario.
- For more information regarding Mimosa, see http://mimosa.io
- For more info about jshint, check out http://www.jshint.com/
Usage
Add 'jshint' to your list of modules. That's all! Mimosa will install the module for you when you start mimosa watch or mimosa build.
Functionality
When mimosa watch or mimosa build are executed this module will run jshint over your project's JavaScript files. This includes both regular .css as well as the output of transpilers like CoffeeScript or Esperanto. jshint can be run on vendor files, but that is by default turned off.
Default Config
jshint: {
exclude:[],
compiled: true,
copied: true,
vendor: false,
rules: {},
jshintrc: ".jshintrc"
}jshint.exclude array of string/regex
Files to exclude from linting. This setting is an array and can be comprised of strings or regexes. Strings are paths that can be relative to the watch.compiledDir or absolute. String paths must include the file name.
jshint.compiled boolean
When this property is set to true, compiled JavaScript (i.e. CoffeeScript/LiveScript) will be jshinted.
jshint.copied boolean
When this property is set to true, copied JS will be jshinted.
jshint.vendor boolean
When this property is set to true, vendor JS will be jshinted. What files are vendor is determined by Mimosa core. Mimosa has a vendor setting which indicates where vendor files are located.
jshint.rules object
If you disagree with any of the jshint settings, or want to turn some of the rules off, add overrides as key/value pairs underneath this property.
jshint.jshintrc string
Location of a .jshintrc file if one exists. Mimosa will look up the file structure in an attempt to find this file, eventually stopping at the file system root.
Default rules for CoffeeScript and Iced CoffeeScript
Both CoffeeScript and Iced CoffeeScript compile to JavaScript that fail several JS hint validations. There is no way around the compiled code triggering the jshint validations. Because of this, this module automatically sets the following rules when validating Coffee/Iced files.
{
boss: true,
eqnull: true,
shadow: true,
expr: true
}