Lint rules related to i18n for TSLint.
Code is based on https://github.com/palantir/tslint-react. Thanks to the authors.
tslint-i18n has peer dependencies on TSLint and TypeScript.
To use these lint rules with the default preset, use configuration inheritance via the extends
keyword.
Here's a sample configuration where tslint.json
lives adjacent to your node_modules
folder:
{
"extends": ["tslint:latest", "tslint-i18n"],
"rules": {
// override tslint-i18n rules here
"i18n-no-literal": false
}
}
To lint your .ts
and .tsx
files you can simply run tslint -c tslint.json 'src/**/*.{ts,tsx}'
.
The built-in configuration preset you get with "extends": "tslint-i18n"
is semantically versioned in a manner similar to TSLint's built-in presets and the TypeScript language itself. As new rules are added to tslint-i18n across minor versions, stricter checks may be enabled here. Your code is not guaranteed to continue passing checks across these version bumps. If you wish to ensure that npm upgrade
or yarn upgrade
never breaks your build, declare a tilde dependency on this package (e.g. "~1.0.0"
).
We track rule suggestions on Github issues -- here's a useful link to view all the current suggestions. Tickets are roughly triaged by priority (P1, P2, P3).
We're happy to accept PRs for new rules, especially those marked as Status: Accepting PRs. If submitting a PR, try to follow the same style conventions as the core TSLint project.
Quick Start (requires Node v6+, yarn v0.22+):
yarn
yarn verify
yarn lint
See the Github release history.