eslint-plugin-moment-utc
v2.0.0
Published
ESLint pluging to prevent usage of local time with moment.js.
Downloads
7,098
Maintainers
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
}
}