/eslint-plugin-thehelp

Random rules I think are useful. :0)

Primary LanguageJavaScriptMIT LicenseMIT

@scottnonnenberg/eslint-plugin-thehelp

A collection of rules with no other good place.

Blog post announcing this project: https://blog.scottnonnenberg.com/eslint-part-2-contribution/

Install

npm install @scottnonnenberg/eslint-plugin-thehelp --save-dev

In your eslint configuration:

{
  "plugins": ["@scottnonnenberg/thehelp"],
  "rules": {
    "@scottnonnenberg/thehelp/absolute-or-current-dir": "error"
  }
}

And that's it! Details for each rule below.

Rules:

  • absolute-or-current-dir - all require() or import calls must either refer to absolute paths or the current directory ('./peer'). Goodbye ../../../!
  • no-mutation - prevents mutation of object values, pushing you to a more functional style. exceptions configuration allows CommonJS compatibility.
  • no-array-mutation - looks for object calls (obj.call()) with function names taken from the list of mutating array methods.

Contributing

This project uses standard-version to release new versions, automatically updating the version number and changelog based on commit messages in standard format. ghooks and validate-commit-msg are used to ensure all commit messages match the expected format (see package.json for the configuration details).

It takes some getting used to, but this configuration is absolutely worthwhile. A changelog is way easier to understand than the chaos of a raw commit stream, especially with standard-version providing direct links to bugs, commits and commit ranges.

License

(The MIT license)

Copyright (c) 2016 Scott Nonnenberg scott@nonnenberg.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.