Registry / testing / eslint-plugin-disallow-methods

eslint-plugin-disallow-methods

JSON →
library0.1.0jsnpmunverified

An ESLint plugin that disallows specified method calls on given objects. Current version 0.1.0, released as an early prototype with unstable API (under active development). Key differentiator: allows custom configuration of blocked methods per object via ESLint rules, targeting method calls like `foo.bar()` rather than generic function calls. Alternative to no-restricted-syntax with a more declarative approach. Development appears stalled; no updates since initial release.

npm install eslint-plugin-disallow-methods
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-DISA
E
eslint-plugin-disallow-methods
testingjavascriptv0.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

plugin
plugins: ['disallow-methods']
require('eslint-plugin-disallow-methods') in .eslintrc
Plugin is used via string name in .eslintrc plugins array, not require()
disallow-methods rule
"disallow-methods/disallow-methods": [2, [{"object": "x", "method": "y"}]]
"disallow-methods": [2, []]
Rule name is scoped to the plugin: 'disallow-methods/disallow-methods'
ESLint config export
module.exports = { plugins: ['disallow-methods'], rules: { 'disallow-methods/disallow-methods': [2, []] } }
import { 'disallow-methods' } from 'eslint-plugin-disallow-methods'
No JS import; config is JSON or CommonJS export

Shows basic ESLint configuration to disallow console.log and any method on eval.

{ "plugins": ["disallow-methods"], "rules": { "disallow-methods/disallow-methods": ["error", [ { "object": "console", "method": "log" }, { "object": "eval", "method": "*" } ]] } }
Debug
Known issues
breakingAPI may change at any time; do not rely on stable configuration.
fix
Lock version to exact 0.1.0 or consider alternative plugins.
affects: 0.x
gotchaRule name is 'disallow-methods/disallow-methods', not 'disallow-methods'.
fix
Use full scoped rule name in rules configuration.
affects: >=0.0.0
gotchaMethod wildcard '*' disallows all methods on the object.
fix
Use '*' as method value to block all method calls on that object.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-disallow-methods'
Plugin not installed or ESLint cannot resolve it.
fix
Run 'npm install eslint-plugin-disallow-methods --save-dev' and ensure node_modules is correct.
Configuration for rule "disallow-methods" is invalid: Definition for rule 'disallow-methods' was not found.
Using wrong rule name without plugin scope prefix.
fix
Change rule name to 'disallow-methods/disallow-methods'.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for plugin to function
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-disallow-methods — npm install eslint-plugin-disallow-methods · libregistry