eslint-plugin-moment-utc

ESLint pluging to prevent usage of local time with moment.js.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
eslint-plugin-moment-utc
201.0.08 years ago8 years agoMinified + gzip package size for eslint-plugin-moment-utc in KB

Readme

eslint-plugin-moment-utc
This is an ESLint plugin to prevent the usage of localtime.

Installation

You'll first need to install ESLint:
npm i eslint --save-dev

Next, install eslint-plugin-moment-utc:
npm install eslint-plugin-moment-utc --save-dev

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

Usage

Add utc to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
    "plugins": [
        "moment-utc"
    ]
}

Then configure the rules you want to use under the rules section.
{
    "rules": {
        "moment-utc/no-moment-without-utc": 2
    }
}

Supported Rules