0.0.0 • Published 2 years ago

eslint-plugin-date v0.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
2 years ago

eslint-plugin-date

eslint plugin to handle safely date usage.

Contributing

Source Code Reference from https://github.com/Skyscanner/eslint-plugin-skyscanner-dates But there are specical changes for Business Scenarios.

Features

This eslint plugin is meant to be used to avoid explicit usage/manupulation of date in JS, so to avoid issues with timezones.

Installation

npm install --save-dev eslint-plugin-date

Usage

Add to the .eslintrc file inside the root folder of a linted project:

{
	"extends": "plugin:date/recommended",
	"plugins": ["date"]
}
{
	"extends": "plugin:date/error",
	"plugins": ["date"]
}
{
	"extends": "plugin:date/warn",
	"plugins": ["date"]
}
{
	"plugins": ["date"],
	"rules": {
		"date/no-date-fns": "off",
		"date/no-moment-dayjs": "off",
		"date/no-new-date-with-args": "error",
		"date/no-new-date-without-args": "off"
	}
}