{"_id":"i18n-lint","_rev":"2-d11296682df6e96957835634afb86460","name":"i18n-lint","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"i18n-lint","version":"1.0.0","description":"Lint HTML and template source files for hardcoded (untranslated) strings","homepage":"https://jwarby.github.io/i18n-lint","preferGlobal":true,"directories":{"man":"doc/man"},"bin":{"i18n-lint":"./bin/i18n-lint"},"main":"lib/i18n-lint.js","scripts":{"test":"jshint bin/ lib/ test/ && ./node_modules/.bin/mocha --recursive","coverage":"nyc _mocha -- -R spec --recursive"},"author":{"name":"James Warwood","email":"james.duncan.1991@googlemail.com","url":"https://github.com/jwarby"},"contributors":[],"repository":{"type":"git","url":"git+https://github.com/jwarby/i18n-lint.git"},"license":"MIT","bugs":{"url":"https://github.com/jwarby/i18n-lint/issues"},"dependencies":{"chalk":"^1.0.0","commander":"^2.0.0","glob":"^5.0.0","htmlparser2":"^3.0.0","node.extend":"^1.0.0"},"devDependencies":{"chai":"^4.2.0","coveralls":"^3.0.6","hooker":"^0.2.3","nyc":"^14.1.1","jshint":"^2.0.0","mocha":"^6.2.0","mocha-lcov-reporter":"^1.3.0","strip-ansi":"^5.2.0"},"keywords":["hardcoded","strings","i18n","translation","i18n-lint","lint","untranslated","detect"],"engines":{"node":">=0.8.0"},"config":{"blanket":{"pattern":[""],"data-cover-never":["node_modules","tests"]}},"man":["/home/james/workspace/javascript/i18n-lint/doc/man/i18n-lint.1"],"gitHead":"253f2ec458fe606e2c0acdecdf74eac58a52e8c6","_id":"i18n-lint@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-0/cSIhRz10GTMSXvdMwhuz42nyWcE0HCjDjmJ3OkS0fz2nPNepuSbJeEix2EDX3F+q2Pr729VPCIhE70bxI3+Q==","shasum":"87b349630a610cc9f24aaa3845ee86299a77b111","tarball":"https://registry.npmjs.org/i18n-lint/-/i18n-lint-1.0.0.tgz","fileCount":10,"unpackedSize":35172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgliFCRA9TVsSAnZWagAAYMIP/A82Y/8xPGPLUH1UCel2\nG7LVjQRK9fn2C8BJqny/BTrzZzseNj3WL6V4wAaAtGpsQkOu8sw5FcHGUgQ3\nq9DlqJIKi5HJHREpdHgnZXqXzMjRJ7x/yvMnbgCHIG8iAHfFwxq1FwLS/EV+\nHf8zZfIw3ED5DUj3wcWu/PxHk0aVp7FsSKCxCkwG07hqM2HasJi2R/JHz4hz\ny8NXUwzGEYbRh83BHqO+jlpCTRoNFArl657KsOlG1tez0hjYQYy7o7QunAb+\nvXMdBGvVQDyuG3bZAM/uij0YkZtVw3soXl3X61wXErpuiLzQORjmTkxVsYPR\nk1g2/AYzztrzQkeRv8Urv6Olta8hqlVPLhAvlPlmdNfBNcUDr7z34H65w3hY\n010MWYZLyQm5EzRgxnHmblJe9IFqNOyBzVOTuzfmyCB58qUDQqyUOx5BvhwE\n/qQ+gdfyYFWHHoIdI7nYQSHvhc9pCdy3uePx6+IzwQcMSC5DS9IEDOJMdF+Z\njRAOXN0LABYohh/Dxxh00cMQsqbGWS218fg4wxRDpVTYTcv5BxEVuOtC0Qa3\nh/U16ahpDrYFCptFMkqOVMdj3m4q1UqWOd+1RDxkopyrDOcNb6cG3mwroX1J\nfLtu7LWAyyqDE7llYmIbEIp67wJ4nDNgJJI2IG+q8MJcTkngxlErdRWBCWJJ\noxBu\r\n=yozb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuo5KiymD4bJt0tuVkn5+O4HeodmE8+I1lvIWeDS0K3QIhAMr5QXhDoNaGG2NjLy9J/r0ltC6igEBooljDtOBsT9iC"}]},"maintainers":[{"name":"jwarby","email":"warwood.aj@gmail.com"}],"_npmUser":{"name":"jwarby","email":"warwood.aj@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-lint_1.0.0_1568823429074_0.7798897689082525"},"_hasShrinkwrap":false},"1.1.0":{"name":"i18n-lint","version":"1.1.0","description":"Lint HTML and template source files for hardcoded (untranslated) strings","homepage":"https://jwarby.github.io/i18n-lint","preferGlobal":true,"directories":{"man":"doc/man"},"bin":{"i18n-lint":"bin/i18n-lint"},"main":"lib/i18n-lint.js","scripts":{"test":"jshint bin/ lib/ test/ && ./node_modules/.bin/mocha --recursive","coverage":"nyc _mocha -- -R spec --recursive"},"author":{"name":"James Warwood","email":"james.duncan.1991@googlemail.com","url":"https://github.com/jwarby"},"contributors":[],"repository":{"type":"git","url":"git+https://github.com/jwarby/i18n-lint.git"},"license":"MIT","bugs":{"url":"https://github.com/jwarby/i18n-lint/issues"},"dependencies":{"chalk":"^1.0.0","commander":"^2.0.0","glob":"^5.0.0","htmlparser2":"^3.0.0","node.extend":"^1.0.0"},"devDependencies":{"chai":"^4.2.0","coveralls":"^3.0.6","hooker":"^0.2.3","nyc":"^14.1.1","jshint":"^2.0.0","mocha":"^6.2.0","mocha-lcov-reporter":"^1.3.0","strip-ansi":"^5.2.0"},"keywords":["hardcoded","strings","i18n","translation","i18n-lint","lint","untranslated","detect"],"engines":{"node":">=0.8.0"},"config":{"blanket":{"pattern":[""],"data-cover-never":["node_modules","tests"]}},"man":["/home/james/workspace/javascript/i18n-lint/doc/man/i18n-lint.1"],"gitHead":"bfd6399736793f171696898fe852e21b822dad87","_id":"i18n-lint@1.1.0","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-Lg2gxbPte2KWKe6NO+yy25H736xpC2ILVusgdiZFlkGpzHldMqmuqee8s3CBdwvMI1CY8STESZ0MfzqmR8a2dw==","shasum":"7a468a165be851264843caeb5e455f32c0abba37","tarball":"https://registry.npmjs.org/i18n-lint/-/i18n-lint-1.1.0.tgz","fileCount":10,"unpackedSize":35841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQiqyCRA9TVsSAnZWagAADqgP/i4XwmwJnhExRTwQNzqc\nb7SzM3Zso2ymMNU5lsJ1GIVSeNmG08JEC/LTCbfqApqB8eo2I2drs1EkRcDR\nX2uMQ9FJ8X7cdR4euLvu0f/4n6c2AKmvkqXidXcGzTpf1J3NTZiVj3kcQktx\nOPJ4x35mMs4V+mmx+iuQBAiYJyeMRsm4xvp0eEFHw5fF4Oecu47vGsgyz23x\n6P2Z1nzWWpH625bneaoNe+JGi68D/1QVsX8uFNsqWkHxamv6MfOYn7sLCN/X\nfkPp9GDODodPBHST+kKW+2gAMCjA4+MfTMFJtWcy2t9u2Sz1or2iHuHG1xZn\njpniKrJl3YCILj5BCWau5+Ax4IwopTxExy6lS8QoMezbu69i//GmJL1hgaz2\nRAYwn8L/u663SvVC7DH5qMEc+npH8dRq22tCAFavZqOUqGSJABcUyYBT9qfj\nzgX/wS/kB+JEYqKVfT17sqppC2ttF7G9C9GO840OyzXifxOt8VAbHkI/axXc\nI/IvCcLqOoRfHw8ra6u4qyEbn1m9nrvt1HR2lEj9zGQphKxBepIFgYzQqMTO\n5dAsKZOnrKrLgml7gTCczVyNIRlBxxzeHpOM40PnYJZ3idtttl1xntImtCtV\n2YfiOZxifDMzJniKvoNMBovM6qs3YufvBTZxRUdO3MP2gMZqfie2Aj0RXdD+\nIxG9\r\n=TJil\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbZ4l7ua8BeI1xzQU8Rf48YhAsdMV7kvfva/0rf/FLnQIhAIexMqhDcyH+EKrgr+ODxNGQiPftGM/LknVrxA4iMAs7"}]},"maintainers":[{"name":"jwarby","email":"warwood.aj@gmail.com"}],"_npmUser":{"name":"jwarby","email":"warwood.aj@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/i18n-lint_1.1.0_1598171825496_0.4184435409779985"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-18T16:17:09.073Z","1.0.0":"2019-09-18T16:17:09.216Z","modified":"2022-05-05T13:27:34.201Z","1.1.0":"2020-08-23T08:37:05.656Z"},"maintainers":[{"name":"jwarby","email":"warwood.aj@gmail.com"}],"description":"Lint HTML and template source files for hardcoded (untranslated) strings","homepage":"https://jwarby.github.io/i18n-lint","keywords":["hardcoded","strings","i18n","translation","i18n-lint","lint","untranslated","detect"],"repository":{"type":"git","url":"git+https://github.com/jwarby/i18n-lint.git"},"contributors":[],"author":{"name":"James Warwood","email":"james.duncan.1991@googlemail.com","url":"https://github.com/jwarby"},"bugs":{"url":"https://github.com/jwarby/i18n-lint/issues"},"license":"MIT","readme":"# i18n-lint [![GitHub version](https://badge.fury.io/gh/jwarby%2Fi18n-lint.svg)](http://semver.org/spec/v2.0.0.html)\n> Detect possible instances of untranslated strings being used in HTML and HTML-derived template languages\n\n[![Build Status](https://secure.travis-ci.org/jwarby/i18n-lint.png?branch=master)](https://travis-ci.org/jwarby/i18n-lint)\n[![Dependency Status](https://david-dm.org/jwarby/i18n-lint.svg?style=flat)](https://david-dm.org/jwarby/i18n-lint)\n[![devDependency Status](https://david-dm.org/jwarby/i18n-lint/dev-status.svg?style=flat)](https://david-dm.org/jwarby/i18n-lint#info=devDependencies)\n[![Coverage Status](https://coveralls.io/repos/jwarby/i18n-lint/badge.svg?branch=master&service=github)](https://coveralls.io/github/jwarby/i18n-lint?branch=master)\n\n`i18n-lint` is a tool for detecting hardcoded (untranslated) strings in HTML and template source files.  It can be used a CLI utility, or as library.\n`i18n-lint` detects instances where a HTML element's text node or certain attributes look like a hardcoded string.\n\nSee <https://jwarby.github.io/i18n-lint/> for the full documentation and demos.\n\n![i18n-lint screenshot](screenshot.png)\n\n## Getting started\n\n### Installing\n\nInstall using npm:\n\n```shell\n  $ npm install -g jwarby/i18n-lint\n```\n\nInstalling globally will give you access to the `i18n-lint` binary from anywhere.\n\n## Documentation\n\nSee <https://jwarby.github.io/i18n-lint/> for the full documentation.\n\n### CLI\n\nThe CLI program is called `i18n-lint`, and will be available once `i18n-lint` has been installed globally.\n\nUsage:\n\n```shell\n  $ i18n-lint [OPTIONS] <file ...>\n```\n\n#### Program help and information\n\n- Run `i18n-lint --help` or `i18n-lint -h` to display help output and then exit\n- Run `i18n-lint --version` or `i18n-lint -V` to display version and then exit\n- Run `man i18n-lint` on systems which support `man` to view the Linux manual page\n\n#### Linting files\n\nTo lint a file, call `i18n-lint <file>`:\n\n```shell\n  $ i18n-lint some_file.html\n```\n\nYou can use a glob pattern too:\n\n```shell\n  $ i18n-lint app/views/**/*.html\n```\n\n#### Options\n\n##### `-h, --help`\n\nDisplay help and then exit\n\n##### `-V, --version`\n\nDisplay version information and then exit\n\n##### `-t, --template-delimiters <delimiters>`\n\nSet the template delimiters which the source files use.  The value should be the start and\nend delimiters, separated by a comma.  For example, if running\n`i18n-lint` against template files which use a Mustache-like syntax, use the following:\n\n```shell\n  $ i18n-lint -t \"{{,}}\" views/**/*.hbs\n```\n\nSimilarly, but for EJS-syntax:\n\n```shell\n  $ i18n-lint -t \"<%,%>\" views/**/*.ejs\n```\n\n##### `-a, --attributes <attributes>`\n###### default: `alt,placeholder,title`\n\nA comma-separated list of which HTML attributes should be checked.\n\n##### `-i, --ignore-tags <tags>`\n###### default: `style,script`\n\nA comma-separated list of HTML tags to ignore when searching for hardcoded strings.\n\n##### `-r, --reporter <reporter>`\n###### default: `default`\n\nThe reporter to use when outputting information.  The reporters follow the same structure as\nJSHint reporters, and the `i18n-lint` library reports error in the same manner as JSHint - this\nmeans you can use any existing JSHint reporters as reporters for `i18n-lint`!\n\nThere are 3 built-in reporters that get shipped with `i18n-lint`: `default`, `unix` and `json`.\n\nTo write your own reporters, look to `lib/reporters/*.js` as a starting point.\n\n##### `--exclude <patterns>`\n\nA comma-separated list of file patterns to exclude, such as `'docs/,ignored.html'`.\n\n##### `--color/--no-color`\n\nMaintain/turn off colored output.  For more info, see <https://www.npmjs.com/package/chalk#chalk-supportscolor>.\n\n#### Exit Status\n\n- `0`: if everything went OK, and no hardcoded strings were found\n- `1`: if hardcoded strings were found\n- `64`: command-line usage error, e.g. no input files provided (`[EX_USAGE]`)\n- `66`: cannot open input, e.g. input files I/O error, specified reporter file does not exist (`[EX_NOINPUT]`)\n- `70`: internal software error (`[EX_SOFTWARE]`)\n\n#### Colored Output\n\nTo maintain colored output, run `i18n-lint` with the `--color` flag:\n\n```shell\n  $ i18n-lint --color **/*.html | less -R\n```\n\n### Library\n\nTo use `i18n-lint` as a library, install it locally and `require` it in your projects:\n\n```shell\n  $ npm install --save-dev i18n-lint\n```\n\n```javascript\nvar I18nLint = require('i18n-lint');\n\nvar errors = I18nLint('some_file.ejs', {\n  templateDelimiters: [['<%','%>']],\n  attributes: ['title', 'alt', 'data-custom-attr']\n});\n```\n\n> **Note:** prior to v1.1.0, only a single set of template delimiters could\n> be passed. However, the legacy single-depth API is still supported, ie:\n> `templateDelimiters: ['<%', '%>']` will still work (but is not recommended).\n\nIf you want to scan a string instead of reading in a file, you can use the `scan` function:\n\n```javascript\nvar I18nLint = require('i18n-lint');\n\nvar context = '<h1>Some hardcoded string</h1>\\n<br>\\n<p>\\ncontent not translated</p>';\n\nvar options = {\n  // ...snip...\n};\n\nvar errors = I18nLint.scan(context, options);\n```\n\nThe scan function can also accept a `fileName` parameter:\n\n```javascript\nvar I18nLint = require('i18n-lint');\n\nvar stdin = '';\n\n// Read stdin stream\n// ...snip...\n\n// Once stdin has finished...\nvar errors = I18nLint(context, options, 'stdin');\n```\n\nThis allows more meaningful output when the reporters print a filename.\n\n#### Options\n\nOptions are passed as an object, as the second parameter to `i18n-lint`.\n\n##### `templateDelimiters`\n###### type: `Array`, default: `[]`\n\nSpecify the start and end template delimiters which the source files use.  We can specify\nmultiple delimiters if needed. For example, when linting EJS files:\n\n```javascript\n  I18nLint('file.ejs', {\n    templateDelimiters: [['<%', '%>']]\n  });\n```\n\n##### `attributes`\n###### type: `Array`, default: `['alt', 'placeholder', 'title']`\n\nSpecify which HTML attributes to check when searching for hardcoded strings.\n\n##### `ignoreTags`\n###### type: `Array`, default: `['style', 'script', 'pre', 'code']`\n\nAn array of tags which should be ignored when searching for hardcoded strings.\n\n#### Using Reporters\n\nWhen using `i18n-lint` as a library, you can still use the reporters:\n\n```javascript\nconsole.log(I18nLint.reporters);\n// {\n//  default: [Function]\n// }\n\nvar reporter = I18nLint.reporters.default;\nvar errors = I18nLint('file.html', {});\n\nreporter(errors);\n```\n\nThere are currently 3 built-in reporters: `default`, `unix` and `json`.\n\nTo use other reporters, simply require them:\n\n```javascript\nvar I18nLint = require('i18n-lint');\nvar reporter = require('i18n-lint-awesome-reporter');\n\nreporter(I18nLint('file.html', {}));\n```\n\n#### Error Format\n\n```javascript\n{\n  file: '', // string, file which contains the errors,\n  error: {\n    id: String, // usually '(error)'\n    code: String, // warning code (see Warning Numbers)\n    reason: String, // message describing the error\n    evidence: RegExp, // with the offending text in match groups\n    line: Number, // line number of the error\n    character: Number, // column where evidence begins\n    scope: String // where the error was found\n  }\n}\n```\n\n### Grunt\n\nThere is a grunt task which wraps `i18n-lint`'s functionality, which\ncan be found at <https://github.com/jwarby/grunt-i18n-lint>.\n\n## Warning Numbers\n\n- `W001`: hardcoded text node found\n- `W002`: hardcoded attribute value found\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/jwarby/i18n-lint/blob/master/CONTRIBUTING.md).\n\n### Running Tests\n\n- `npm test`\n  - lints JS files in `bin/`, `lib/` and `test/`\n  - runs [`mocha`](http://mochajs.org) test suite\n\n#### Generate Code Coverage Report\n\n- `npm run-script coverage`\n  - coverage is output to a `./coverage` directory\n\n## Release History\n\n`i18n-lint` follows [SemVer](http://semver.org/spec/v2.0.0.html) rules for version numbers.\n\n\n### v1.1.0\n> 23rd Aug 2020\n\n- Support for more than one set of template delimiters add - thanks @alexmorvan\n\n### v1.0.0\n> 18th Sep 2019\n\nFirst published release.\n\n## License\n\nCopyright (c) 2015 James Warwood.  Licensed under the MIT license.\n\n## Authors\n\nSee [AUTHORS.txt](https://github.com/jwarby/i18n-lint/blob/master/AUTHORS.txt).\n## Acknowledgements\n\n- CLI app scaffolding from <https://github.com/Hypercubed/generator-commander>\n","readmeFilename":"README.md"}