Registry / database / eslint-plugin-mongo

eslint-plugin-mongo

JSON →
library1.0.5jsnpmunverified

ESLint plugin providing environments for MongoDB server-side scripts (mapReduce, eval, $where) and MongoDB shell scripts. Version 1.0.5 is the latest and only release. It defines global variables specific to MongoDB contexts to prevent false positives in ESLint. Limited to environment definitions; does not include custom rules. Requires ESLint as a peer dependency. Last updated in 2018; no active development.

npm install eslint-plugin-mongo
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-MONG
E
eslint-plugin-mongo
databasejavascriptv1.0.5
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

eslint-plugin-mongo
✓ // In .eslintrc: { "plugins": ["mongo"] }
✗ { "plugins": ["eslint-plugin-mongo"] }
Plugin name prefix 'eslint-plugin-' should be omitted in ESLint config.
mongo/server-side
✓ // In .eslintrc: { "env": { "mongo/server-side": true } }
✗ { "env": { "mongo-server-side": true } }
Environment name uses slash, not hyphen.
mongo/shell
✓ // In .eslintrc: { "env": { "mongo/shell": true } }
✗ { "env": { "mongo-shell": true } }
Environment name uses slash, not hyphen.

Quick setup to enable MongoDB shell environment in ESLint: install packages and configure plugin and environment.

// Install: npm install eslint eslint-plugin-mongo --save-dev // .eslintrc.json { "plugins": ["mongo"], "env": { "mongo/shell": true } }
Debug
Known issues
deprecatedPackage is unmaintained since 2018.
fix
Consider using eslint-plugin-mongodb or writing custom globals.
affects: >=1.0.0
gotchaPlugin only defines environments, no rules. May not meet all linting needs.
fix
Combine with other plugins or define custom rules.
affects: >=1.0.0
gotchaEnvironments may not include all MongoDB globals (e.g., ObjectId, ISODate).
fix
Manually add globals in ESLint config.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'mongo' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-mongo'
Plugin not installed or ESLint cannot resolve it.
fix
Run 'npm install eslint-plugin-mongo --save-dev' and ensure node_modules is accessible.
Parsing error: The keyword 'db' is not defined.
MongoDB shell globals like 'db' are not recognized by ESLint.
fix
Enable the 'mongo/shell' environment in your ESLint config.
Definition for rule 'mongo/rule-name' was not found.
Plugin does not provide custom rules.
fix
Check plugin documentation; only environments are provided.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies
eslintrequiredpeer dependency: plugin only works within ESLint
Agent activity
7 hits · last 30 days
node
6
Resources
eslint-plugin-mongo — npm install eslint-plugin-mongo · libregistry