UNPKG

2.58 kBMarkdownView Raw
1<h1 align="center">ESLint Plugin TSLint</h1>
2
3<p align="center">ESLint plugin wraps a TSLint configuration and lints the whole source using TSLint.</p>
4
5<p align="center">
6 <a href="https://dev.azure.com/typescript-eslint/TypeScript%20ESLint/_build/latest?definitionId=1&branchName=master"><img src="https://img.shields.io/azure-devops/build/typescript-eslint/TypeScript%20ESLint/1/master.svg?label=%F0%9F%9A%80%20Azure%20Pipelines&style=flat-square" alt="Azure Pipelines"/></a>
7 <a href="https://github.com/typescript-eslint/typescript-eslint/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/typescript-estree.svg?style=flat-square" alt="GitHub license" /></a>
8 <a href="https://www.npmjs.com/package/@typescript-eslint/eslint-plugin-tslint"><img src="https://img.shields.io/npm/v/@typescript-eslint/eslint-plugin-tslint.svg?style=flat-square" alt="NPM Version" /></a>
9 <a href="https://www.npmjs.com/package/@typescript-eslint/eslint-plugin-tslint"><img src="https://img.shields.io/npm/dm/@typescript-eslint/eslint-plugin-tslint.svg?style=flat-square" alt="NPM Downloads" /></a>
10 <a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square" alt="Commitizen friendly" /></a>
11</p>
12
13## Installation
14
15```sh
16yarn add -D @typescript-eslint/eslint-plugin-tslint
17```
18
19## Usage
20
21Configure in your ESLint config file:
22
23```js
24{
25 "plugins": [
26 "@typescript-eslint/tslint"
27 ],
28 "parserOptions": {
29 "project": "tsconfig.json",
30 },
31 "rules": {
32 "@typescript-eslint/tslint/config": ["warn", {
33 "lintFile": "", // path to tslint.json of your project
34 "rules": {
35 // tslint rules (will be used if `lintFile` is not specified)
36 },
37 "rulesDirectory": [
38 // array of paths to directories with rules, e.g. 'node_modules/tslint/lib/rules' (will be used if `lintFile` is not specified)
39 ]
40 }],
41 }
42}
43```
44
45**Note:** The ability to automatically fix problems with `--fix` is unavailable for TSLint rules loaded with this plugin.
46
47## Rules
48
49Plugin contains only single rule `@typescript-eslint/tslint/config`.
50
51## Examples
52
53- [`unlight/node-package-starter/.eslintrc.js`](https://github.com/unlight/node-package-starter/blob/master/.eslintrc.js)
54
55### TSLint Plugins
56
57- https://github.com/Glavin001/tslint-clean-code
58- https://github.com/Microsoft/tslint-microsoft-contrib
59- https://github.com/SonarSource/SonarTS
60- https://github.com/ajafff/tslint-consistent-codestyle
61
62## Contributing
63
64[See the contributing guide here](../../CONTRIBUTING.md)