eslint-plugin-lint
Load arbitrary ESLint rules from any number of directories, and use them under the lint/
namespace.
Install
$ npm install eslint-plugin-lint --save-dev
Usage
Consider a project with an .eslintrc.js
at the root, and two directories with rules files:
my-project
├── .eslintrc.js
├─┬ my-rules
│ ├── no-foo.js
│ └── no-bar.js
└─┬ their-rules
├── no-baz.js
└── no-qux.js
To make them available to ESLint, in the .eslintrc.js
add:
const path = require('path');
require('eslint-plugin-lint').load(
path.join(__dirname, 'my-rules'),
path.join(__dirname, 'their-rules')
);
module.exports {
plugins: [
'lint'
],
rules: {
'lint/no-foo': 1,
'lint/no-bar': 1,
'lint/no-baz': 1,
'lint/no-qux': 1
}
};
Now the rules are available like any other as lint/no-foo
, lint/no-ba
, and so on.
Prior Art