Skip to content

afahim/eslint-plugin-underscore-lodash-compatibility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status NPM version

eslint-plugin-underscore-lodash-compatibility

Ensures your javascript can use underscore or lodash interchangeably as a dependency.

If you maintain a codebase and are thinking of moving over to lodash, this plugin can help. It can ensure your code uses only the subset of underscore that is compatible with lodash. Once you get to that point, you can replace your underscore dependency with lodash and complete the migration.

Note: This plugin is under development, and a few more rules should be coming up (contributions welcome!). Also, due to the limitations of static analysis, this plugin can only do a best effort, and doesn't absolutely guarantee that your code will be fully compatible with both libraries.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-underscore-lodash-compatibility:

$ npm install eslint-plugin-underscore-lodash-compatibility --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-underscore-lodash-compatibility globally.

Usage

Add underscore-lodash-compatibility to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "underscore-lodash-compatibility"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "underscore-lodash-compatibility/rule-name": 2
    }
}

Supported Rules

Contributing

$ git clone https://github.com/afahim/eslint-plugin-underscore-lodash-compatibility.git
$ cd eslint-plugin-underscore-lodash-compatibility
$ npm test

This project follows the ESLint contribution guidelines.

License and Copyright

Copyright 2016 Afnan Fahim. All rights reserved.

MIT License

About

Make sure your code can use underscore and lodash interchangeably.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published