{"_id":"eslint-plugin-gettext","_rev":"8-024843a870122181226b2fe9e0d3ed77","name":"eslint-plugin-gettext","description":"Set of eslint rules for gettext API","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"eslint-plugin-gettext","version":"1.0.0","description":"Set of eslint rules for gettext API","author":{"name":"App Annie Engineering"},"files":["lib","index.js"],"main":"index.js","keywords":["gettext","gettext-eslint","literal","eslint","eslint-plugin","i18n","internationalization","localization"],"devDependencies":{"codecov":"^1.0.1","coveralls":"^2.13.1","eslint":"^4.1.0","eslint-config-prettier":"^2.3.0","eslint-config-xo-space":"^0.16.0","eslint-plugin-prettier":"^2.2.0","husky":"^0.14.3","istanbul":"~0.4.5","jest":"^19.0.2","jest-cli":"^20.0.0","lint-staged":"^4.0.3","mocha":"^3.1.2","nsp":"^2.6.3","prettier":"^1.5.3"},"scripts":{"test":"jest --coverage","prepublish":"nsp check","pretest":"eslint .","precommit":"lint-staged"},"lint-staged":{"*.js":["eslint --fix","git add"]},"repository":{"type":"git","url":"git+https://github.com/appannie/eslint-plugin-gettext.git"},"license":"MIT","eslintConfig":{"extends":["xo-space","prettier"],"plugins":["prettier"],"env":{"jest":true,"node":true},"rules":{"indent":"off","prettier/prettier":["error",{"singleQuote":true,"trailingComma":"es5","tabWidth":4,"printWidth":90}]}},"jest":{"testEnvironment":"node","coverageReporters":["lcov","text","html"],"coverageThreshold":{"global":{"branches":100,"functions":100,"lines":100,"statements":100}}},"gitHead":"284b1546db6ab55ac658e86d677787956fdec207","bugs":{"url":"https://github.com/appannie/eslint-plugin-gettext/issues"},"homepage":"https://github.com/appannie/eslint-plugin-gettext#readme","_id":"eslint-plugin-gettext@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"integrity":"sha512-GM973WN9dv5WETTxSGsMxF7uU+ax8TQ9EP87DVYMMrVyFwS/PVuWSz5B6Q2gqe17EhfNubt3NVv94fP1wyAprg==","shasum":"ea957fc099344d1dcfc77ee92e45354739a3c2d5","tarball":"https://registry.npmjs.org/eslint-plugin-gettext/-/eslint-plugin-gettext-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVFVZw9wetEJwCCf6V+RDWbqOwWhV5KIzi6IQCZ2bJOQIhAPSuAqgxH5ppJyJvE32lbEjrZJ+19APWLa79T3xUgTu8"}]},"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-gettext-1.0.0.tgz_1510549445258_0.2973950549494475"},"directories":{}},"1.1.0":{"name":"eslint-plugin-gettext","version":"1.1.0","description":"Set of eslint rules for gettext API","author":{"name":"App Annie Engineering"},"files":["lib","index.js"],"engines":{"node":">=6.0.0"},"main":"index.js","keywords":["gettext","gettext-eslint","literal","eslint","eslint-plugin","i18n","internationalization","localization"],"devDependencies":{"coveralls":"^3.0.0","eslint":"^4.1.0","eslint-config-prettier":"^2.3.0","eslint-config-xo-space":"^0.17.0","eslint-plugin-prettier":"^2.2.0","husky":"^0.14.3","istanbul":"~0.4.5","jest":"^21.2.1","lint-staged":"^5.0.0","nsp":"^3.1.0","prettier":"^1.5.3"},"scripts":{"test":"jest --coverage","prepublish":"nsp check","pretest":"eslint .","precommit":"lint-staged"},"lint-staged":{"*.js":["eslint --fix","git add"]},"repository":{"type":"git","url":"git+https://github.com/appannie/eslint-plugin-gettext.git"},"license":"MIT","eslintConfig":{"extends":["xo-space","prettier"],"plugins":["prettier"],"env":{"jest":true,"node":true},"rules":{"indent":"off","prettier/prettier":["error",{"singleQuote":true,"trailingComma":"es5","tabWidth":4,"printWidth":90}]}},"jest":{"testEnvironment":"node","coverageReporters":["lcov","text","html"],"coverageThreshold":{"global":{"branches":100,"functions":100,"lines":100,"statements":100}}},"gitHead":"93c68cee6dcedd4b7f0e8e894d5c5d8d2d2ec275","bugs":{"url":"https://github.com/appannie/eslint-plugin-gettext/issues"},"homepage":"https://github.com/appannie/eslint-plugin-gettext#readme","_id":"eslint-plugin-gettext@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"integrity":"sha512-PhVshXJRhnVEtNDYKsebvRUd6WWOB91U3SrflRrrUVMMF9JBATMbD0wkU8kSTWuY9cp75lrfCGh6SJwdlbIa3A==","shasum":"49122cddc7c2df0275ff90afd364e68a138de484","tarball":"https://registry.npmjs.org/eslint-plugin-gettext/-/eslint-plugin-gettext-1.1.0.tgz","fileCount":7,"unpackedSize":12966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3vUfCRA9TVsSAnZWagAAOQoQAJ/vsxev2Q+cwFpV8HAJ\nm/hiMgzC0jWCdbrxHeHHf0xsd/Ysy6etKNCLIEDHG2vJxH0oG0Yf31nXcX+a\nuOjchXQgEb/w+KbzNXLHuofSaRtcT4zB4WjyiV1J9IIlOHfgB6I9PjjC07p/\nSzO6JTENW0j5uwR1hBtW5HnymLmO/6OQh+qz1Kh/Xn67bqhzeVNkp1U8y3Sn\n8Yn3Nad3SJgP6SKIIgT7VZsRmiKhPfGCpDKVsUAwQyItgend6kfj9D0aHp89\nCTpTA1iiyVoqqGLK8aHai0lpm9IaAj6xXguce8GBWiL2pTtzvRODtogFNu1w\n3ucXbwUyYEfAyla+gb4CJjefKDWKEj67WJH4T1coBbhYBVrj/I8gKW2kauHG\nD+B610jwqCBfxMluxLBZx98fcYJnjyCTUaD5ut2HAIt/wBqZoazZPam4mYXZ\n8qUT3qhFQOiJTtZTn8sKE2nckoyfUy6oZy754UI7ch9XeBz7VjEcmvbsmPhs\n+XNVUt/nqyoTCX+b1+UWSrUJ1nQHACRWZWZeCcMf2Acy9twReKgwV3J5oU7r\nHgqdaHmNvokbjTIlRSnw+q9OK0Pqppn4sNYdz1WvkV0MUf/dZhLxvxEpmWre\nsI/zeOtRmdRQ0G3GtmA4C/VPCaNdY6mNDzcGSgb21eTx+3UXODR9XDhcl7tO\nHhfW\r\n=3MYn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHhPj9C8gPS/3+inoP0blHqGawDK0O43Rioy6oSiz4SGAiEAzvLsdMozYJRLQKzvhkVO8dOs4FK1Br7ZR03oJ+Lzpew="}]},"maintainers":[{"email":"jiuyue@outlook.com","name":"jiuyue"},{"email":"admin@simonboudrias.com","name":"sboudrias"},{"email":"xunuoi@163.com","name":"xunuoi"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-gettext_1.1.0_1524561183323_0.5678369660692297"},"_hasShrinkwrap":false},"1.2.0":{"name":"eslint-plugin-gettext","version":"1.2.0","description":"Set of eslint rules for gettext API","author":{"name":"App Annie Engineering"},"engines":{"node":">=6.0.0"},"main":"index.js","keywords":["gettext","gettext-eslint","literal","eslint","eslint-plugin","i18n","internationalization","localization"],"dependencies":{"gettext-parser":"^4.0.4"},"devDependencies":{"coveralls":"^3.0.4","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-config-xo-space":"^0.29.0","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.2","istanbul":"~0.4.5","jest":"^27.2.4","lint-staged":"^11.1.2","prettier":"^2.4.1"},"scripts":{"test":"jest --coverage","pretest":"eslint .","precommit":"lint-staged"},"lint-staged":{"*.js":["eslint --fix","git add"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"repository":{"type":"git","url":"git+https://github.com/appannie/eslint-plugin-gettext.git"},"license":"MIT","eslintConfig":{"extends":["xo-space","prettier"],"plugins":["prettier"],"env":{"jest":true,"node":true},"rules":{"indent":"off","prettier/prettier":["error",{"singleQuote":true,"trailingComma":"es5","tabWidth":4,"printWidth":90}]}},"jest":{"testEnvironment":"node","coverageReporters":["lcov","text","html"],"coverageThreshold":{"global":{"branches":100,"functions":100,"lines":100,"statements":100}}},"gitHead":"aebd929cadb1f0233acd634a930454aa5b9f098f","bugs":{"url":"https://github.com/appannie/eslint-plugin-gettext/issues"},"homepage":"https://github.com/appannie/eslint-plugin-gettext#readme","_id":"eslint-plugin-gettext@1.2.0","_nodeVersion":"16.9.0","_npmVersion":"7.21.1","dist":{"integrity":"sha512-k7jSJD1nETfGYk94VS7AxHXPe7AZN7LvTfhBEnpyUx6DR98/5Bffovuw5vGk4axFBgKqzzfIV7ASTz/lnVd2qQ==","shasum":"bf532816858dfc99cad9d39e5b464a2ecab74d95","tarball":"https://registry.npmjs.org/eslint-plugin-gettext/-/eslint-plugin-gettext-1.2.0.tgz","fileCount":8,"unpackedSize":18285,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2qLPCRA9TVsSAnZWagAA824P/28FUWzU7NvCKWPENQt+\nh3pt9Cy2vuLVDD+DEyChJkV30gWROAWhkkW/AorXooKdy57GTiMjBRCAYIKy\nuMKU5w09Q+gL5nW5MeZM8SaNj1rpmOirQ0xpL7fJ2AULlmEGVVkgRqlT2dwK\n+qPErgePBXV4G1r5aKPGood0NCCht90X7afNZGBmuCYlZRP1ALP85D6NIdfe\nCwdiZwPdbbKxVWdHVoxvhc6Mc0bOtOKW2/+iQaXs6r/im6W5tJjYSOglI2qX\nGlbnotDlar2r0PmmFdeeQr1CI8MTYgYLHSZx7oxALZCmRJmBLGqiPVO7aHnK\nlbeJwrpcYixguoohmehE38ZRE1l+eyNJYSHEGsdv59ZKjxq0seH1fzcM+/37\nigxPr6qYIUnljlFWF0QnJ6WvJ9tYHTuej3+9V3YNvcwTbDAdxrvZBbIN1dzI\ngjSKjDrOgHS/Qa6C+DDfKqYfSq0+l3jTX0PZvZ87zCK8M8Qqfa4RGPpy1OBZ\nM8aM0Bs2I+mIyWDV/sViSEUFnJbkYlhUuAMKDqdyCmt4xeJsjvBqLAUc7K0v\n+n+ldFkYeqlfPlhJ84s6nCqJPznIQKlFPgI/TrD2EKN0r/n7+1zG8NzMi9t/\nGmWnCyYKAT0JeJwv4LYxofX4TmL25LBd+3UK/3ERkmdonoo0gRPJfA4RDhG1\nNmYc\r\n=JjP9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKtOMFfor1sa2K2yBC1tsQnxe2CXIUi2NNPjfR7njVBwIhAMUsG2szfRD71ZJ3ppC+I4A9EbkZeyeifBGqXqZhQqDq"}]},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"jiuyue","email":"monopieces@gmail.com"},{"name":"aanpmjs","email":"accounts+npmjs@appannie.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-gettext_1.2.0_1633111515626_0.23977656702527161"},"_hasShrinkwrap":false}},"readme":"# eslint-plugin-gettext [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]\n\n[Gettext](https://en.wikipedia.org/wiki/Gettext) linting rules for ESLint.\n\nWe're using this rule to lint against misuse of the [jed gettext integration](https://github.com/messageformat/Jed) and the [django JS catalog](https://docs.djangoproject.com/en/1.11/topics/i18n/translation/#internationalization-in-javascript-code); so we're confident it should work against any gettext integration.\n\n## Installation\n\n1. Install [ESLint](https://www.github.com/eslint/eslint).\n1. Install [eslint-plugin-gettext](https://github.com/appannie/eslint-plugin-gettext) plugin.\n\n```sh\nnpm install eslint --save-dev\nnpm install eslint-plugin-gettext --save-dev\n```\n\n## Configuration\n\n1. Load plugin.\n1. Enable rules.\n\n```json\n{\n  \"plugins\": [\"gettext\"],\n  \"rules\": {\n    \"gettext/no-variable-string\": \"error\",\n    \"gettext/required-positional-markers-for-multiple-variables\": \"error\"\n  }\n}\n```\n\n## Rules\n\n### `gettext/no-variable-string`\n\nDisallow non literal strings inside common `gettext` functions. This is a very common mistake that disallow translation system from statically collecting the translatable strings.\n\n```js\n// Disallows any non string literals in string reserved fields:\ngettext(variable)\ngettext(123)\nngettext(varA, varB, 5)\npgettext(varA, varB)\nnpgettext(varA, varB, varC, 5)\n\n// Allows:\ngettext('hello')\nngettext('cat', '%d cats', 5)\npgettext('homepage', 'hello')\nnpgettext('homepage', 'cat', '%d cats', 5)\ni18n.gettext('hello') // any object can expose the gettext API\nthis.gettext('hello')\n```\n\n### `gettext/required-positional-markers-for-multiple-variables`\n\nRequire that all strings containing multiple variables also includes positional marker. This allows translator to reorder variables, and prevents `sprintf()` errors if someone change the order of `%s` and `%d`.\n\n```js\n// Disallows:\ngettext('There is %d more event in the %s.')\ngettext('There is %d more event in the %1$s.')\n\n// Allows:\ngettext('There is %d more event in the game.')\nngettext('cat %1$s $2$s', '%1$d cats %2$d dogs', count)\n```\n\n## License\n\nMIT © [App Annie](https://www.appannie.com/en/about/careers/engineering/)\n\n[npm-image]: https://badge.fury.io/js/eslint-plugin-gettext.svg\n[npm-url]: https://npmjs.org/package/eslint-plugin-gettext\n[travis-image]: https://travis-ci.org/appannie/eslint-plugin-gettext.svg?branch=master\n[travis-url]: https://travis-ci.org/appannie/eslint-plugin-gettext\n[daviddm-image]: https://david-dm.org/appannie/eslint-plugin-gettext.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/appannie/eslint-plugin-gettext\n[coveralls-image]: https://coveralls.io/repos/appannie/eslint-plugin-gettext/badge.svg\n[coveralls-url]: https://coveralls.io/r/appannie/eslint-plugin-gettext\n","maintainers":[{"email":"ramon.villain@gmail.com","name":"ramonvillain"},{"email":"admin@simonboudrias.com","name":"sboudrias"},{"email":"monopieces@gmail.com","name":"jiuyue"},{"email":"accounts+npmjs@appannie.com","name":"aanpmjs"}],"time":{"modified":"2022-05-01T16:14:19.898Z","created":"2017-11-13T05:04:05.346Z","1.0.0":"2017-11-13T05:04:05.346Z","1.1.0":"2018-04-24T09:13:03.449Z","1.2.0":"2021-10-01T18:05:15.753Z"},"homepage":"https://github.com/appannie/eslint-plugin-gettext#readme","keywords":["gettext","gettext-eslint","literal","eslint","eslint-plugin","i18n","internationalization","localization"],"repository":{"type":"git","url":"git+https://github.com/appannie/eslint-plugin-gettext.git"},"author":{"name":"App Annie Engineering"},"bugs":{"url":"https://github.com/appannie/eslint-plugin-gettext/issues"},"license":"MIT","readmeFilename":"README.md"}