{"id":19026559,"url":"https://github.com/sbdchd/eslint-plugin-safer-moment","last_synced_at":"2026-04-30T23:30:19.130Z","repository":{"id":57701212,"uuid":"499352358","full_name":"sbdchd/eslint-plugin-safer-moment","owner":"sbdchd","description":"An ESlint plugin to prevent `moment` related bugs","archived":false,"fork":false,"pushed_at":"2022-06-03T02:13:50.000Z","size":78,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T17:18:50.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sbdchd.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":"2022-06-03T02:13:44.000Z","updated_at":"2022-06-03T02:13:53.000Z","dependencies_parsed_at":"2022-08-29T05:30:46.120Z","dependency_job_id":null,"html_url":"https://github.com/sbdchd/eslint-plugin-safer-moment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbdchd%2Feslint-plugin-safer-moment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbdchd%2Feslint-plugin-safer-moment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbdchd%2Feslint-plugin-safer-moment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbdchd%2Feslint-plugin-safer-moment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbdchd","download_url":"https://codeload.github.com/sbdchd/eslint-plugin-safer-moment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240072185,"owners_count":19743540,"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":[],"created_at":"2024-11-08T20:49:39.775Z","updated_at":"2026-04-30T23:30:19.077Z","avatar_url":"https://github.com/sbdchd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-safer-moment [![npm version](https://img.shields.io/npm/v/eslint-plugin-safer-moment.svg)](https://www.npmjs.com/package/eslint-plugin-safer-moment)\n\n\u003e An ESlint plugin to prevent `moment` 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-safer-moment\n$ npm i --save-dev eslint-plugin-safer-moment\n```\n\n## Usage\n\nAdd `@typescript-eslint/parser` to the `parser` field, your `tsconfig.json` relative path to `parserOptions.project`, and `safer-moment` 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\": [\"safer-moment\"],\n  \"rules\": {\n    \"safer-moment/ban-moment-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| [`safer-moment/ban-moment-mutation`](./docs/rules/ban-moment-mutation.md) | Bans mutating `moment` objects. |          | :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%2Fsbdchd%2Feslint-plugin-safer-moment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbdchd%2Feslint-plugin-safer-moment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbdchd%2Feslint-plugin-safer-moment/lists"}