eslint-plugin-mongo

1.0.5 • Public • Published

ESLint plugin for MongoDB

This plugin includes two ESLint environments:

  • mongo/server-side - for Mongo server-side scripts (i.e. mapReduce, eval, or $where)
  • mongo/shell - for Mongo shell scripts

Installation

You'll first need to install ESLint:

$ npm install eslint --save-dev

Next, install eslint-plugin-mongo:

$ npm install eslint-plugin-mongo --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-mongo globally.

Usage

Add mongo to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "mongo"
    ]
}

For Mongo server-side scripts, add the mongo/server-side environment to .eslintrc:

{
    "env": {
        "mongo/server-side": true
    }
}

For Mongo shell scripts, add the mongo/shell environment to .eslintrc:

{
    "env": {
        "mongo/shell": true
    }
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.5
    931
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.5
    931
  • 1.0.4
    0
  • 1.0.3
    0
  • 1.0.2
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i eslint-plugin-mongo

Weekly Downloads

931

Version

1.0.5

License

Apache-2.0

Last publish

Collaborators

  • ispringer