ESLint rules for the Node.js MongoDB native driver 2.0 syntax and best practices. Designed to catch common errors and deprecated patterns in MongoDB query calls (find, insert, update, remove). This v1.0.0 release is the first stable version. It provides 8 rules covering argument validation, deprecated method detection, and update operation checks. Integrates as an ESLint plugin using shared settings to customize call patterns via regex. Release cadence is low; no recent updates. Key differentiator: focused specifically on Node driver 2.0 API, unlike generic MongoDB linters.
npm install eslint-plugin-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Example .eslintrc configuration enabling all mongodb plugin rules with default settings.
Use 'rules: { "mongodb/no-replace": 2 }' instead of 'rules: { "no-replace": 2 }'Use '\\.' for a literal dot instead of '.'
Customize callPatterns in settings to match driver 3.0 API, or use a different linter
Upgrade to mongodb driver >=3.0 and adjust callPatterns accordingly
Ensure MongoDB connection object is named 'db' or adjust callPatterns in settings
Wrap patterns in quotes: '(\.|^)db\.collection\([^\)]+\)\.(find|findOne|)$'
Use object syntax: 'rules: { "mongodb/no-replace": 0 }'No dependency data recorded yet.