{"id":22018118,"url":"https://github.com/calm/eslint-plugin-react-intl-format","last_synced_at":"2025-05-07T03:10:39.488Z","repository":{"id":57230158,"uuid":"150799858","full_name":"calm/eslint-plugin-react-intl-format","owner":"calm","description":"Linter for React-Intl components to enforce styling and valid translations","archived":false,"fork":false,"pushed_at":"2019-04-18T21:28:02.000Z","size":3568,"stargazers_count":3,"open_issues_count":4,"forks_count":1,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-03T03:01:48.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-28T22:19:13.000Z","updated_at":"2024-11-19T21:10:21.000Z","dependencies_parsed_at":"2022-09-14T15:02:56.426Z","dependency_job_id":null,"html_url":"https://github.com/calm/eslint-plugin-react-intl-format","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/calm%2Feslint-plugin-react-intl-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calm%2Feslint-plugin-react-intl-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calm%2Feslint-plugin-react-intl-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calm%2Feslint-plugin-react-intl-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calm","download_url":"https://codeload.github.com/calm/eslint-plugin-react-intl-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252173235,"owners_count":21705993,"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-30T05:09:59.104Z","updated_at":"2025-05-07T03:10:39.454Z","avatar_url":"https://github.com/calm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NOTICE\nThis plugin has been deprecated. Please use `@calm/eslint-plugin-react-intl` instead.\nnpm: https://www.npmjs.com/package/@calm/eslint-plugin-react-intl\ngithub: https://github.com/calm/eslint-plugin-react-intl\n\n# eslint-plugin-react-intl-format\n\nThis is a plugin to ensure that Intl translations are being made correctly with [react-intl](https://www.npmjs.com/package/react-intl).\nSince they should be stored in an object for translation, this disables plain\ntext between html tags.\n\nThere are three options to enable, and we recommend enabling all of them to ensure\nproper translations in all languages.\n\nThe { noTrailingWhitespace: true } option is set by default and is not necessary to declare in the rules section.\nThis is recommended as some languages don't have spaces between words.\nAdditionally, the option `ignoreLinks` is set to true by default. Depending on your\nuse case, you may want to disable this.\n\n## Use Cases\n\n#### FormattedMessage validation\n* Checks to make sure plain text doesn't exist within html tags (should be translated)\n* `\u003ca\u003e` tags by default are not checked (this can be disabled)\n* Numbers are ignored (they're the same in every language)\n* Trailing whitespace is not allowed (this can be disabled)\n\n#### Missing Values validation\n* In defaultMessage attributes within \u003cFormattedMessage/\u003e components, `{variable}` declarations must be declared in the `values` attribute\n* It will look over anything before a comma, allowing for FormatJS plurals\n  * Ex. defaultMessage=\"{number} {number, plural, one {Day} other {Days}}\" will resolve 1 variable as `number`\n\n#### Missing Attribute validation\n* \u003cFormattedMessage/\u003e components must have both `defaultMessage` and `id` attributes set\n* `defaultMessage` and `id` attributes cannot be empty\n* Spread operator by default is not allowed\n  * Spread operator can't be evaluated by eslint's AST, so translations can't be guaranteed\n\n## Installation\n\nYou'll first need to install [ESLint](http://eslint.org):\n\n```\n$ npm i eslint --save-dev\n```\n\nNext, install `eslint-plugin-react-intl-format`:\n\n```\n$ npm install eslint-plugin-react-intl-format --save-dev\n```\n\n**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-react-intl-format` globally.\n\n## Usage\n\nAdd `react-intl-format` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:\n\n```json\n{\n    \"plugins\": [\n        \"react-intl-format\"\n    ]\n}\n```\n\n\nThen configure the rules you want to use under the rules section.\nCurrently there's just one rule: 'missing-formatted-message'.\n\n```json\n{\n    \"rules\": {\n        \"react-intl-format/missing-formatted-message\": [2, { \"noTrailingWhitespace\": true, \"ignoreLinks\": true }],\n        \"react-intl-format/missing-attribute\": [2, { \"noTrailingWhitespace\": true, \"noSpreadOperator\": true }],\n        \"react-intl-format/missing-values\": 2\n    }\n}\n```\n\n## Supported Rules\n\n* missing-formatted-message\n* missing-attribute\n* missing-values\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalm%2Feslint-plugin-react-intl-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalm%2Feslint-plugin-react-intl-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalm%2Feslint-plugin-react-intl-format/lists"}