Registry / devops / eslint-plugin-lint

eslint-plugin-lint

JSON →
library1.0.0jsnpmunverified

Load arbitrary ESLint rules from multiple directories into a single namespace (lint/). Version 1.0.0 is the current stable release; the package is quite stable with no frequent releases. It differentiates from alternatives like eslint-plugin-rulesdir by supporting multiple rule directories simultaneously, and from eslint-plugin-local-rules by offering a simple API and not requiring a specific configuration structure. It works with Node.js >=4 and is intended for use in ESLint configurations to merge custom rules from various sources into one plugin namespace.

npm install eslint-plugin-lint
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-LINT
E
eslint-plugin-lint
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const plugin = require('eslint-plugin-lint');
The package exports a function `load` but no named exports. Must use require() or import the default with `import plugin from 'eslint-plugin-lint'`.
load
require('eslint-plugin-lint').load(...)
const { load } = require('eslint-plugin-lint'); // exports are not an object; load is a property of the default export
load is a method on the default export. In CJS, you must require the module and call .load directly. In ESM, use 'import plugin from ...; plugin.load(...)'.

Shows how to configure ESLint to load custom rules from two directories and reference them under the lint/ namespace.

// In your .eslintrc.js 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': 'warn', 'lint/no-bar': 'error' } };
Debug
Known issues
gotchaPaths passed to load() must be absolute to avoid resolution issues with cwd.
fix
Use path.join(__dirname, 'relative/path') to resolve to an absolute path.
affects: >=1.0.0
gotchaRule files must have a .js extension and export a valid ESLint rule object.
fix
Ensure each rule file exports an object with meta and create properties.
affects: >=1.0.0
gotchaPlugin name is fixed as 'lint'; you cannot rename the namespace.
fix
Always reference rules as 'lint/rule-name' and add 'lint' to plugins array.
affects: >=1.0.0
gotchaload() must be called before ESLint config is evaluated; it modifies global state.
fix
Call load() at the top level of your .eslintrc.js or config file.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-lint'
Package not installed or not in node_modules.
fix
Run 'npm install eslint-plugin-lint --save-dev' from the project root.
ESLint couldn't find the plugin "eslint-plugin-lint".
Missing 'lint' in plugins array of ESLint config.
fix
Add 'lint' to the plugins array in your ESLint configuration.
Definition for rule 'lint/no-foo' was not found.
Rule file not in the loaded directories or filename mismatch.
fix
Ensure 'no-foo.js' exists in one of the directories passed to load() and the rule name uses the filename without extension.
Failed to load rule 'lint/no-bar': Rule is not a function.
Rule file does not export a valid ESLint rule (object with create).
fix
Export an object with 'meta' and 'create' from the rule file.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-lint — npm install eslint-plugin-lint · libregistry