Skip to content

dbashford/mimosa-require-lint

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
src
 
 
 
 
 
 
 
 
 
 

mimosa-require-lint

Overview

This module will scan your JavaScript files for unused AMD dependencies. Someday it may do more. If you've got any ideas, fire up an issue!

For more information regarding Mimosa, see http://mimosa.io.

Usage

Add 'require-lint' to your list of modules. That's all! Mimosa will install the module for you when you start up.

Functionality

Unused Dependencies

Vanilla AMD

define(['backbone','underscore'], function(Backbone, _) {
  var view = new Backbone.View()
  return view;
})

For the above totally worthless piece of code, this module will provide the following warning:

Dependency [[ underscore ]] declared but not used in [[ /path/to/lame/file.js ]]

CommonJS Wrapper

It will also work for the AMD CommonJS wrapper

define(function(require, exports, module){
    var Backbone = require('backbone'),
    var _ = require('underscore');

    var view = new Backbone.View()
    module.exports = view;
});

And the warning:

Dependency [[ underscore ]] declared but not used in [[ /path/to/lame/file.js ]]

Default Config

requireLint: {
  exclude:[]
}
  • exclude: array of strings or regexes that match files to not jshint, strings are paths that can be relative to the watch.sourceDir or absolute.

About

RequireJS/AMD linting module for Mimosa

Resources

Stars

Watchers

Forks

Packages

No packages published