{"_id":"@agama-project/eslint-plugin-agama-i18n","_rev":"6-2848fe9f734dece3b8ae860eee540d9f","name":"@agama-project/eslint-plugin-agama-i18n","dist-tags":{"latest":"1.4.0"},"versions":{"1.0.0":{"name":"@agama-project/eslint-plugin-agama-i18n","version":"1.0.0","keywords":["eslint","eslintplugin","eslint-plugin"],"license":"MIT","_id":"@agama-project/eslint-plugin-agama-i18n@1.0.0","maintainers":[{"name":"lslezak","email":"lad.slezak@gmail.com"}],"homepage":"https://github.com/agama-project/eslint-plugin-agama-i18n","bugs":{"url":"https://github.com/agama-project/eslint-plugin-agama-i18n/issues"},"dist":{"shasum":"51e6ebcd2acc42577dbe24b9a16c7121fb57e0a2","tarball":"https://registry.npmjs.org/@agama-project/eslint-plugin-agama-i18n/-/eslint-plugin-agama-i18n-1.0.0.tgz","fileCount":5,"integrity":"sha512-5fb92s19fbcrCjmuIQcTtFolXZco1tur5iV60mKpmSGqEYW4FgUz+uibC7Z8djnT9fMs0rGkZ7o7XGhiJavXag==","signatures":[{"sig":"MEQCIF5OId4szwaVgl8iaacWgQO/ZSIDRLd+8/1WmVv6HoHyAiAHBUL7vKmEWxnmhC5e9WlQUkylBVGLDW3T3lWa5g76bg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5865},"main":"eslint-plugin-agama-i18n.js","gitHead":"ec71be89d020382512ba558adce38d212301f5b6","scripts":{"tag":"VERSION=`jq -r .version package.json` && git tag -s -m \"Version $VERSION\" v$VERSION && git push origin v$VERSION","test":"node string-literals.test.js"},"_npmUser":{"name":"lslezak","email":"lad.slezak@gmail.com"},"repository":{"url":"git+https://github.com/agama-project/eslint-plugin-agama-i18n.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple ESLint plugin which checks that only string literals are passed to the translation functions","directories":{},"_nodeVersion":"18.20.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.10.0"},"peerDependencies":{"eslint":">=9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-agama-i18n_1.0.0_1733833964000_0.8961816925779988","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@agama-project/eslint-plugin-agama-i18n","version":"1.1.0","keywords":["eslint","eslintplugin","eslint-plugin"],"license":"MIT","_id":"@agama-project/eslint-plugin-agama-i18n@1.1.0","maintainers":[{"name":"lslezak","email":"lad.slezak@gmail.com"},{"name":"imobachgs","email":"imobachgs@gmail.com"}],"homepage":"https://github.com/agama-project/eslint-plugin-agama-i18n","bugs":{"url":"https://github.com/agama-project/eslint-plugin-agama-i18n/issues"},"dist":{"shasum":"2f3ade3ee2076ae8a03a026441678200ce981b5a","tarball":"https://registry.npmjs.org/@agama-project/eslint-plugin-agama-i18n/-/eslint-plugin-agama-i18n-1.1.0.tgz","fileCount":7,"integrity":"sha512-MGhVVeEFaiw4OfaXwl1jTHhTdOy1QVULy7/XdpaWvp4EB+aYdlrgvIblpFDkCtqgLOaLa0+J88icHZzyLCK5aA==","signatures":[{"sig":"MEUCIQC8wd8tgV28c8AboxveBdYCwwvVbwo8ggKpXn6hMy108QIgK9yXrTRWAHe79wsfOChNXYvfuOZgYNabCEjYxq9oCpA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9085},"main":"eslint-plugin-agama-i18n.js","gitHead":"2ecd9734b9c19988938bcf15960238b3017683b0","scripts":{"tag":"VERSION=`jq -r .version package.json` && git tag -s -m \"Version $VERSION\" v$VERSION && git push origin v$VERSION","test":"find . -name '*.test.js' -exec node \\{\\} \\;"},"_npmUser":{"name":"lslezak","email":"lad.slezak@gmail.com"},"repository":{"url":"git+https://github.com/agama-project/eslint-plugin-agama-i18n.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple ESLint plugin which checks usage of the translation functions","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.10.0"},"peerDependencies":{"eslint":">=9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-agama-i18n_1.1.0_1758217942271_0.7295126359459403","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@agama-project/eslint-plugin-agama-i18n","version":"1.2.0","keywords":["eslint","eslintplugin","eslint-plugin"],"license":"MIT","_id":"@agama-project/eslint-plugin-agama-i18n@1.2.0","maintainers":[{"name":"lslezak","email":"lad.slezak@gmail.com"},{"name":"imobachgs","email":"imobachgs@gmail.com"}],"homepage":"https://github.com/agama-project/eslint-plugin-agama-i18n","bugs":{"url":"https://github.com/agama-project/eslint-plugin-agama-i18n/issues"},"dist":{"shasum":"b4574c0b524cbcd8c2232aaeb5782a0d838100fc","tarball":"https://registry.npmjs.org/@agama-project/eslint-plugin-agama-i18n/-/eslint-plugin-agama-i18n-1.2.0.tgz","fileCount":7,"integrity":"sha512-mI3qGf7XDuHjrO13KT2xKTrFEm5uGxBm17MApvoxStS0kU6oU+eUa6Sh2tX9J6ypvKxzdITMh3QkITeNNztfEg==","signatures":[{"sig":"MEUCIQCda72ygPJBue9Xyjobb54znIxrahB481H02TWuOYk/rAIgLjGGMsqTb6i+JjkMAW6DSmho0s6wuXFlHwQyb2LivoQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10001},"main":"eslint-plugin-agama-i18n.js","gitHead":"56a07ff46e09602e1ef8c4f4b0a755e4dfeaa59f","scripts":{"tag":"VERSION=`jq -r .version package.json` && git tag -s -m \"Version $VERSION\" v$VERSION && git push origin v$VERSION","test":"find . -name '*.test.js' -exec node \\{\\} \\;"},"_npmUser":{"name":"lslezak","email":"lad.slezak@gmail.com"},"repository":{"url":"git+https://github.com/agama-project/eslint-plugin-agama-i18n.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple ESLint plugin which checks usage of the translation functions","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.10.0"},"peerDependencies":{"eslint":">=9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-agama-i18n_1.2.0_1759231634444_0.23586984468056493","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@agama-project/eslint-plugin-agama-i18n","version":"1.3.0","keywords":["eslint","eslintplugin","eslint-plugin"],"license":"MIT","_id":"@agama-project/eslint-plugin-agama-i18n@1.3.0","maintainers":[{"name":"lslezak","email":"lad.slezak@gmail.com"},{"name":"imobachgs","email":"imobachgs@gmail.com"}],"homepage":"https://github.com/agama-project/eslint-plugin-agama-i18n","bugs":{"url":"https://github.com/agama-project/eslint-plugin-agama-i18n/issues"},"dist":{"shasum":"d4fdf881ddcbf1976fb572de1fd9610091bf8d44","tarball":"https://registry.npmjs.org/@agama-project/eslint-plugin-agama-i18n/-/eslint-plugin-agama-i18n-1.3.0.tgz","fileCount":8,"integrity":"sha512-es1B8wcqo7oIe+gT6w2sYmwBcz+hswBRWsteGgQ8bpfliAEcQj2mAWjGLkEf2EkW9G2cqShRWlEgEmIWxbz0HA==","signatures":[{"sig":"MEYCIQCe4CEdEzXJ7WDKLyMoqc35UNglPoRQCqR71MEtxq9pOAIhALm/EciuObbIF1J8DijCLCaceT962N898r0CIT2lIowF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12908},"main":"eslint-plugin-agama-i18n.js","gitHead":"3dc15d095866894a1bbb33ce0cfb80aeb368ea42","scripts":{"tag":"VERSION=`jq -r .version package.json` && git tag -s -m \"Version $VERSION\" v$VERSION && git push origin v$VERSION","test":"find . -name '*.test.js' -exec node \\{\\} \\;"},"_npmUser":{"name":"lslezak","email":"lad.slezak@gmail.com"},"repository":{"url":"git+https://github.com/agama-project/eslint-plugin-agama-i18n.git","type":"git"},"_npmVersion":"10.8.2","description":"A simple ESLint plugin which checks usage of the translation functions","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.10.0"},"peerDependencies":{"eslint":">=9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/eslint-plugin-agama-i18n_1.3.0_1764624343281_0.9515077790224562","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@agama-project/eslint-plugin-agama-i18n","version":"1.4.0","description":"A simple ESLint plugin which checks usage of the translation functions","homepage":"https://github.com/agama-project/eslint-plugin-agama-i18n","repository":{"type":"git","url":"git+https://github.com/agama-project/eslint-plugin-agama-i18n.git"},"license":"MIT","publishConfig":{"access":"public"},"main":"eslint-plugin-agama-i18n.js","scripts":{"test":"find . -name '*.test.js' -exec node \\{\\} \\;","tag":"VERSION=`jq -r .version package.json` && git tag -s -m \"Version $VERSION\" v$VERSION && git push origin v$VERSION"},"peerDependencies":{"eslint":">=9.0.0"},"keywords":["eslint","eslintplugin","eslint-plugin"],"devDependencies":{"@typescript-eslint/rule-tester":"^8.62.1","eslint":"^9.34.0","typescript-eslint":"^8.62.1"},"dependencies":{"@typescript-eslint/utils":"^8.62.1"},"_id":"@agama-project/eslint-plugin-agama-i18n@1.4.0","gitHead":"d337eaa9b103d869b3cc5da339e3e05f643e16b0","bugs":{"url":"https://github.com/agama-project/eslint-plugin-agama-i18n/issues"},"_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-IP+8X12cDDoo39463zwv+gjd/j+4L+cEv5Mg20/iux1Q85CQ4xRpRujxfZeXX+Xy54bh1XY49PLTbd4B+Yv0fQ==","shasum":"a627d38acce8092ffa2a1462092c698a4bf8fa21","tarball":"https://registry.npmjs.org/@agama-project/eslint-plugin-agama-i18n/-/eslint-plugin-agama-i18n-1.4.0.tgz","fileCount":9,"unpackedSize":14936,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCDsKXMgB94n6UtEaDbcynND0E1y9SUwamsLGhoPCteRQIgVquqszT9kMquHYouz6XaMX3oLP3fiRXjOiF7W6GMjLA="}]},"_npmUser":{"name":"lslezak","email":"lad.slezak@gmail.com"},"directories":{},"maintainers":[{"name":"lslezak","email":"lad.slezak@gmail.com"},{"name":"imobachgs","email":"imobachgs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-agama-i18n_1.4.0_1783094856344_0.4519350193231282"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-10T12:32:43.933Z","modified":"2026-07-03T16:07:36.652Z","1.0.0":"2024-12-10T12:32:44.165Z","1.1.0":"2025-09-18T17:52:22.452Z","1.2.0":"2025-09-30T11:27:14.646Z","1.3.0":"2025-12-01T21:25:43.481Z","1.4.0":"2026-07-03T16:07:36.499Z"},"bugs":{"url":"https://github.com/agama-project/eslint-plugin-agama-i18n/issues"},"license":"MIT","homepage":"https://github.com/agama-project/eslint-plugin-agama-i18n","keywords":["eslint","eslintplugin","eslint-plugin"],"repository":{"type":"git","url":"git+https://github.com/agama-project/eslint-plugin-agama-i18n.git"},"description":"A simple ESLint plugin which checks usage of the translation functions","maintainers":[{"name":"lslezak","email":"lad.slezak@gmail.com"},{"name":"imobachgs","email":"imobachgs@gmail.com"}],"readme":"# The ESLint Plugin\n\n![NPM Version](https://img.shields.io/npm/v/@agama-project/eslint-plugin-agama-i18n)\n[![CI](https://github.com/agama-project/eslint-plugin-agama-i18n/actions/workflows/ci.yml/badge.svg)](https://github.com/agama-project/eslint-plugin-agama-i18n/actions/workflows/ci.yml)\n\nThis directory contains a simple ESLint plugin which checks for some common\ntranslation problems:\n\n- Only string literals are allowed as arguments in the translation functions (or\n  their concatenation using the `+` operator)\n- Translation functions are not allowed at the top level (they are evaluated too\n  early, before the actual translations are available)\n- The text should not contain multiple white space characters in a sequence (in\n  HTML they are collapsed to a single space anyway and multiple spaces might be\n  confusing for translators.)\n\nIt is closely tied to the [Agama](https://github.com/agama-project/agama)\nproject and probably does not make much sense for other projects.\n\n## Installation\n\nRun\n\n```shell\nnpm install --save-dev @agama-project/eslint-plugin-agama-i18n\n```\n\nUpdate your ESLint configuration:\n\n```js\n// eslint.config.mjs\nimport agamaI18nEslintPlugin from \"@agama-project/eslint-plugin-agama-i18n\";\n\nexport default [\n  {\n    plugins: {\n      \"agama-i18n\": agamaI18nEslintPlugin,\n    },\n  },\n  {\n    rules: {\n      \"agama-i18n/string-literals\": \"error\",\n      \"agama-i18n/top-level-translation\": \"error\",\n      \"agama-i18n/multiple-space\": \"error\",\n      \"agama-i18n/marked-string\": \"error\"\n    }\n  }\n];\n```\n\n## Disabling the Check\n\nIn some rare cases using a variable instead of a string literal is correct. In\nthat case disable the check locally:\n\n```js\nconst SIZES = [ N_(\"small\"), N_(\"medium\"), N_(\"large\") ];\n\n// returns one of the sizes above\nconst sz = getSize();\n\n// eslint-disable-next-line agama-i18n/string-literals\nreturn <span>{_(sz)}</span>;\n```\n\n## Testing changes during development\n\nTo test new changes locally during development install the plugin into an Agama\ncheckout using command `npm install ../../eslint-plugin-agama-i18n/` (the path\nshould point to checkout of this plugin).\n\nThis creates a symlink pointing to the plugin directory so it will always use\nthe latest files from the local plugin, that is very convenient during\ndevelopment.\n\n## Publishing new version\n\nThe NPM package is automatically published by a GitHub Action when a version tag\nis created.\n\nTo create a new tag update the version in `package.json` and run the `npm run\ntag` command.\n\n## Links\n\n- https://eslint.org/docs/latest/extend/custom-rule-tutorial - tutorial for\n  writing an ESLint plugin\n- https://eslint.org/docs/latest/extend/custom-rules - documentation for\n  writing an ESLint plugin\n- https://astexplorer.net - online tool for browsing a parsed AST tree,\n  useful for inspecting the properties of parsed source code\n- https://ts-ast-viewer.com - similar tool for TypeScript sources\n","readmeFilename":"README.md"}