eslint-config-lob
v7.0.0
Published
Shareable ESLint config for Lob repositories
Maintainers
Readme
eslint-config-lob
Shareable ESLint configuration for Lob repositories
Usage
Requirements: Node.js >= 24.15.0, npm >= 11.12.1, ESLint >= 10.0.0
This package uses ESLint flat config format (array-based). ESLint 10+ is required.
- Install
eslintand this module:
npm i eslint eslint-config-lob --save-dev- Create an
eslint.config.jsfile in the root of your project:
const lob = require('eslint-config-lob');
module.exports = [...lob];For the migrations ruleset:
const migrations = require('eslint-config-lob/migrations');
module.exports = [...migrations];For the browser ruleset:
const browser = require('eslint-config-lob/browser');
module.exports = [...browser];For the ES5 ruleset:
const es5 = require('eslint-config-lob/es5');
module.exports = [...es5];- Add an
ignoresentry in your flat config to exclude files or directories:
module.exports = [
...lob,
{ ignores: ['node_modules/**', 'dist/**'] }
];- Modify or create the npm
lintscript inpackage.json:
{
"scripts": {
"lint": "eslint ."
}
}- Clean up any legacy
.eslintrc*or.eslintignorefiles from your project — flat config replaces them.
Verification
npm install
npm run lint
npm auditTarget: zero lint errors, zero lint warnings, zero npm audit moderate/high findings.
Contributing
Modifying or adding rules.
- To add to the main rules, modify the
index.jsfile. - To use most of the main rules but override some of them, create a new file in the root of this module, spread from
index.jsand add your overrides. Seemigrations.jsfor an example. If you're creating a file like this, its rules should be reusable and not a one-off. For example, you could create a file for angular rules. To make a one-off change, do so in your project'seslint.config.js.
