85 lines (63 sloc) 3.4 KB

🚧 Notice 🚧

Pardon the mess. The master branch is in flux while we work on Lodash v5. This means things like npm scripts, which we encourage using for contributions, may not be working. Thank you for your patience.

Contributing to Lodash

Contributions are always welcome. Before contributing please read the code of conduct & search the issue tracker; your issue may have already been discussed or fixed in master. To contribute, fork Lodash, commit your changes, & send a pull request.

Feature Requests

Feature requests should be submitted in the issue tracker, with a description of the expected behavior & use case, where they’ll remain closed until sufficient interest, e.g. 👍 reactions, has been shown by the community. Before submitting a request, please search for similar ones in the closed issues.

Pull Requests

For additions or bug fixes you should only need to modify lodash.js. Include updated unit tests in the test directory as part of your pull request. Don’t worry about regenerating the dist/ or doc/ files.

Before running the unit tests you’ll need to install, npm i, development dependencies. Run unit tests from the command-line via npm test, or open test/index.html & test/fp.html in a web browser. The Backbone & Underscore test suites are included as well.

Contributor License Agreement

Lodash is a member of the JS Foundation. As such, we request that all contributors sign the JS Foundation contributor license agreement (CLA).

For more information about CLAs, please check out Alex Russell’s excellent post, “Why Do I Need to Sign This?”.

Coding Guidelines

In addition to the following guidelines, please follow the conventions already established in the code.

  • Spacing:
    Use two spaces for indentation. No tabs.

  • Naming:
    Keep variable & method names concise & descriptive.
    Variable names index, array, & iteratee are preferable to i, arr, & fn.

  • Quotes:
    Single-quoted strings are preferred to double-quoted strings; however, please use a double-quoted string if the value contains a single-quote character to avoid unnecessary escaping.

  • Comments:
    Please use single-line comments to annotate significant additions, & JSDoc-style comments for functions.

Guidelines are enforced using ESLint:

$ npm run style


You can opt-in to a pre-push git hook by adding an .opt-in file to the root of the project containing:


With that, when you git push, the pre-push git hook will trigger and execute npm run validate.