{"id":19022992,"url":"https://github.com/chdsbd/eslint-plugin-better-dates","last_synced_at":"2025-04-23T08:34:44.998Z","repository":{"id":39643709,"uuid":"359035502","full_name":"chdsbd/eslint-plugin-better-dates","owner":"chdsbd","description":"⏱ An ESlint plugin to encourage better `Date` usage and prevent `Date`-related bugs.","archived":false,"fork":false,"pushed_at":"2022-10-20T14:38:19.000Z","size":85,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T23:37:15.677Z","etag":null,"topics":["eslint","eslint-plugin","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chdsbd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-18T03:34:38.000Z","updated_at":"2023-03-24T02:55:43.000Z","dependencies_parsed_at":"2022-09-20T07:02:05.910Z","dependency_job_id":null,"html_url":"https://github.com/chdsbd/eslint-plugin-better-dates","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdsbd%2Feslint-plugin-better-dates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdsbd%2Feslint-plugin-better-dates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdsbd%2Feslint-plugin-better-dates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chdsbd%2Feslint-plugin-better-dates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chdsbd","download_url":"https://codeload.github.com/chdsbd/eslint-plugin-better-dates/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250324687,"owners_count":21411943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","eslint-plugin","typescript"],"created_at":"2024-11-08T20:28:23.037Z","updated_at":"2025-04-23T08:34:44.967Z","avatar_url":"https://github.com/chdsbd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-better-dates [![npm version](https://img.shields.io/npm/v/eslint-plugin-better-dates.svg)](https://www.npmjs.com/package/eslint-plugin-better-dates)\n\n\u003e An ESlint plugin to prevent `Date`-related bugs.\n\n## Installation\n\nMake sure you have TypeScript and [`@typescript-eslint/parser`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md) installed:\n\n```console\n$ yarn add -D typescript @typescript-eslint/parser\n$ npm i --save-dev typescript @typescript-eslint/parser\n```\n\nThen install the plugin:\n\n```console\n$ yarn add -D eslint-plugin-better-dates\n$ npm i --save-dev eslint-plugin-better-dates\n```\n\n## Usage\n\nAdd `@typescript-eslint/parser` to the `parser` field, your `tsconfig.json` relative path to `parserOptions.project`, and `better-dates` to the plugins section of your `.eslintrc` configuration file, then configure the rules you want to use under the rules section.\n\n```json\n{\n  \"parser\": \"@typescript-eslint/parser\",\n  \"parserOptions\": { \"project\": \"./tsconfig.json\" },\n  \"plugins\": [\"better-dates\"],\n  \"rules\": {\n    \"better-dates/ban-date-mutation\": \"error\"\n  }\n}\n```\n\n**Note: Make sure to use `eslint --ext .js,.ts` since by [default](https://eslint.org/docs/user-guide/command-line-interface#--ext) `eslint` will only search for `.js` files.**\n\n## Rules\n\n**Key**: :wrench: = fixable, :thought_balloon: = requires type information\n\n| Name                                                                  | Description                                               | :wrench: | :thought_balloon: |\n| --------------------------------------------------------------------- | --------------------------------------------------------- | -------- | ----------------- |\n| [`better-dates/ban-date-mutation`](./docs/rules/ban-date-mutation.md) | Bans calling methods on `Date` that will mutate the date. |          | :thought_balloon: |\n\n\u003e Project layout and configuration modified from [`typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/26d71b57fbff013b9c9434c96e2ba98c6c541259/packages/eslint-plugin).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchdsbd%2Feslint-plugin-better-dates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchdsbd%2Feslint-plugin-better-dates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchdsbd%2Feslint-plugin-better-dates/lists"}