- Notifications
You must be signed in to change notification settings - Fork3
⏱ An ESlint plugin to encourage better `Date` usage and prevent `Date`-related bugs.
License
chdsbd/eslint-plugin-better-dates
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
An ESlint plugin to prevent
Date-related bugs.
Make sure you have TypeScript and@typescript-eslint/parser installed:
$yarn add -D typescript @typescript-eslint/parser$npm i --save-dev typescript @typescript-eslint/parser
Then install the plugin:
$yarn add -D eslint-plugin-better-dates$npm i --save-dev eslint-plugin-better-dates
Add@typescript-eslint/parser to theparser field, yourtsconfig.json relative path toparserOptions.project, andbetter-dates to the plugins section of your.eslintrc configuration file, then configure the rules you want to use under the rules section.
{"parser":"@typescript-eslint/parser","parserOptions": {"project":"./tsconfig.json" },"plugins": ["better-dates"],"rules": {"better-dates/ban-date-mutation":"error" }}Note: Make sure to useeslint --ext .js,.ts since bydefaulteslint will only search for.js files.
Key: 🔧 = fixable, 💭 = requires type information
| Name | Description | 🔧 | 💭 |
|---|---|---|---|
better-dates/ban-date-mutation | Bans calling methods onDate that will mutate the date. | 💭 |
Project layout and configuration modified from
typescript-eslint/eslint-plugin.
About
⏱ An ESlint plugin to encourage better `Date` usage and prevent `Date`-related bugs.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.