{"id":19777511,"url":"https://github.com/ilib-js/ilib-lint-react","last_synced_at":"2025-09-17T23:31:49.346Z","repository":{"id":166636825,"uuid":"621629300","full_name":"iLib-js/ilib-lint-react","owner":"iLib-js","description":"Ilib-lint plugin with a parser and a linter for React code","archived":false,"fork":false,"pushed_at":"2024-11-08T16:41:09.000Z","size":297,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-12T05:30:54.741Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iLib-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T03:50:50.000Z","updated_at":"2024-04-24T04:27:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"969327ac-066d-45e2-be95-e57b070c8b36","html_url":"https://github.com/iLib-js/ilib-lint-react","commit_stats":null,"previous_names":["ilib-js/ilib-lint-react"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-lint-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-lint-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-lint-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-lint-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iLib-js","download_url":"https://codeload.github.com/iLib-js/ilib-lint-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233430257,"owners_count":18675058,"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-12T05:25:20.312Z","updated_at":"2025-09-17T23:31:42.973Z","avatar_url":"https://github.com/iLib-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003e :warning: **Deprecation Notice** :warning:\n\u003e This repository has been deprecated. Please use the corresponding package from the [iLib-js monorepo](https://github.com/iLib-js/ilib-mono) instead.\n\n# ilib-lint-react\n\nAn ilib-lint plugin that provides the ability to parse React files and\nprovides rules to check resources that come from code written in React.\n\n## Installation\n\n```\nnpm install --save-dev ilib-lint-react\n\nor\n\nyarn add --dev ilib-lint-react\n```\n\nThen, in your `ilib-lib-config.json`, add some configuration:\n\n```\n    \"plugins\": [\n        \"react\"\n    ],\n    \"filetypes\": {\n        \"jsx\": {\n            \"parser\": \"jsx\",\n            \"ruleset\": [ \"react\" ]\n        },\n        \"js\": {\n            \"parser\": \"js\",\n            \"ruleset\": [ \"javscript\" ]\n        }\n    },\n    \"paths\": {\n        \"src/**/*.jsx\": \"jsx\",\n        \"src/**/*.js\": \"js\"\n    }\n```\n\nPlease note: nodejs version 14 or above is required to run ilib-lint, as it\nis written with ESM modules.\n\n## Parsers\n\nThis plugin provides multiple parsers:\n\n- FlowParser - parser for Javascript using flow type definitions, and for\nJSX files that use flow type definitions\n- JSParser - parser for plain Javascript files\n- JSXParser - parser for Javscript React JSX files\n- TSXParser - parser for Typescript files that may use React JSX\n- PropertiesParser - parser for properties files as used for translated\n  strings in the react-intl library\n\nSome projects use the file extension \"js\" instead of \"jsx\" for their JSX\nfiles. If you are not sure what is in your files that have a \"js\" extension,\nthen use the JSXParser to be safe. Both parsers produce the same form of\nintermediate representation that the rules can parse, and the JSX parser\nhas the ability to parse regular javascript as well as JSX syntax. You\nshould use the JSParser only if you want strict Javascript syntax which\nthrows exceptions if the file attempts to use JSX syntax.\n\n## Rules\n\nThe following rules apply to any resources from any file type, but are\ndesigned to check resources that come from react code:\n\n- [ban-formattedcompmessage](./docs/ban-formattedcompmessage.md) - The component\n  FormattedCompMessage in the box-ui-elements is deprecated and should not be used\n- [no-hard-coded-strings](./docs/no-hard-coded-strings.md) - Check for hard-coded\n  strings in your jsx code\n- [no-nested-messages](./docs/no-nested-messages.md) - Check whether the\n  component FormattedMessage from react-intl is used in the children of another\n  FormattedMessage\n- source-formatjs-plurals - check that any React-intl style plurals have\n  correct syntax (NOT IMPLEMENTED YET)\n\n## RuleSets\n\nThis plugin defines one ruleset `react` that will turn on all the rules\nthat this plugin supports. Users may rely on this ruleset when defining their\nfile types.\n\n## License\n\nCopyright © 2023-2024, Box, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n## Release Notes\n\n### v2.0.1\n\n- Fixed a bug where the exports were not properly set up in the package.json\n\n### v2.0.0\n\n- Updated dependency from i18nlint-common to ilib-lint-common\n    - IntermediateRepresentation now takes a SourceFile as an\n      parameter to the constructor instead of a file path\n    - Parser constructor no longer takes a file path. Instead,\n      the Parser.parse method takes a SourceFile parameter\n    - can now be loaded by ilib-lint \u003e= v2\n\n### v1.4.2\n\n- fixed a bug where HTML attribute values that are localizable but which\n  are empty were marked as hard-coded strings. Now it no longer complains\n  about those attribute values unless there is at least one non-whitespace\n  character in the string.\n\n### v1.4.1\n\n- fixed a bug where the different parsers did not have unique names\n- clarified the documentation about the various parser names and what the\n  parsers are used for\n- minor documentation updates\n\n### v1.4.0\n\n- added rule to check for usages of FormattedMessage or calls to intl.formatMessage()\n  within the children of another FormattedMessage component. That indicates broken\n  and unlocalizable strings.\n\n### v1.3.0\n- added Typescript and TSX parser\n- changed existing JavaScript, JSX, Flow, FlowJSX parsers to all produce Babel-style AST\n- added rule to ban usage of FormattedCompMessage\n- added rule to check for hard-coded strings and attributes in React code\n\n### v1.2.0\n\n- add a parser for JS or JSX code that uses flow types (FlowParser).\n  This parser produces the same ESTree style of AST as the JS and\n  JSX parsers.\n- update dependencies\n- convert unit tests from nodeunit to jest\n\n### v1.1.1\n\n- forgot to expose the properties parser to the consumers of this lib\n\n### v1.1.0\n\n- added a parser for properties files\n    - produces an array of Resource instances\n\n### v1.0.0\n\n- initial version\n- Parser for jsx and js files\n- Rules for react resources\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib-lint-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filib-js%2Filib-lint-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib-lint-react/lists"}