UNPKG

eslint-plugin-lob

Version:

Custom ESLint rules for Lob repositories

79 lines (53 loc) 1.8 kB
# eslint-plugin-lob [![Coverage Status](https://coveralls.io/repos/github/lob/eslint-plugin-lob/badge.svg?branch=master)](https://coveralls.io/github/lob/eslint-plugin-lob?branch=master) Custom ESLint rules for Lob repositories ## Installation **Requirements:** Node.js `>=24.15.0`, ESLint `>=10.0.0`. You'll first need to install [ESLint](http://eslint.org): ``` $ npm i eslint -D ``` Next, install `eslint-plugin-lob`: ``` $ npm install eslint-plugin-lob -D ``` **Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-lob` globally. ## Usage Add `lob` to the plugins in your `eslint.config.js` (flat config). You can omit the `eslint-plugin-` prefix: ```js import pluginLob from 'eslint-plugin-lob'; export default [ { plugins: { lob: pluginLob }, rules: { 'lob/rule-name': 'error' } } ]; ``` For CommonJS projects: ```js const pluginLob = require('eslint-plugin-lob'); module.exports = [ { plugins: { lob: pluginLob }, rules: { 'lob/rule-name': 'error' } } ]; ``` ## Supported Rules * `align-equals` - equal signs of variable declarations involving `require`, `Factory.build` (including named factories like `UserFactory.build`), `Bluebird.promisify`, or `Bluebird.promisifyAll` must be aligned * `newline-after-mocha` - new lines must be between mocha blocks (`describe`, `it`, `beforeEach`, etc) * `padded-describes` - `describe` blocks must be padded by blank lines ## Testing To run the test suite, just clone the repository and run the following: ```bash $ npm i $ npm test ``` ## Contributing To contribute, please see the [CONTRIBUTING.md](CONTRIBUTING.md) file. ## License This project is released under the MIT license, which can be found in [`LICENSE.txt`](LICENSE.txt).