epm

eslint-plugin-mongo

ESLint environments for MongoDB

Showing:

Popularity

Downloads/wk

886

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

1.0KB

License

Apache-2.0

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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
    }
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100