{"id":13452569,"url":"https://github.com/microsoft/typescript-tslint-plugin","last_synced_at":"2025-09-27T00:31:09.365Z","repository":{"id":33163063,"uuid":"145568743","full_name":"microsoft/typescript-tslint-plugin","owner":"microsoft","description":"TypeScript TSLint language service plugin","archived":true,"fork":false,"pushed_at":"2023-05-01T20:48:49.000Z","size":1211,"stargazers_count":282,"open_issues_count":0,"forks_count":45,"subscribers_count":25,"default_branch":"main","last_synced_at":"2024-09-20T07:02:04.053Z","etag":null,"topics":["linter","tslint","typescript","typescript-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-21T13:36:25.000Z","updated_at":"2023-11-30T03:20:46.000Z","dependencies_parsed_at":"2024-01-16T03:46:24.411Z","dependency_job_id":"0f3e2d92-99ad-4d7d-8b14-399ebd238fa7","html_url":"https://github.com/microsoft/typescript-tslint-plugin","commit_stats":{"total_commits":272,"total_committers":24,"mean_commits":"11.333333333333334","dds":0.4338235294117647,"last_synced_commit":"585ee21fe900baff1f24f83786b3ae356ded60af"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftypescript-tslint-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftypescript-tslint-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftypescript-tslint-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftypescript-tslint-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/typescript-tslint-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219864100,"owners_count":16554033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linter","tslint","typescript","typescript-plugin"],"created_at":"2024-07-31T07:01:27.772Z","updated_at":"2025-09-27T00:31:03.899Z","avatar_url":"https://github.com/microsoft.png","language":"TypeScript","readme":"# TypeScript TSLint Language Service Plugin\n\n[![Build Status](https://travis-ci.org/Microsoft/typescript-tslint-plugin.svg?branch=master)](https://travis-ci.org/Microsoft/typescript-tslint-plugin)\n\n\u003e **❗IMPORTANT**: TSLint [has been deprecated](https://medium.com/palantir/tslint-in-2019-1a144c2317a9) in favor of ESLint and this plug-in has also been deprecated in favor of eslint.\n\u003e\n\u003e Please look into [migrating your projects to ESLint](https://github.com/typescript-eslint/typescript-eslint#typescript-eslint).\n\nTypeScript [language service plugin](https://blogs.msdn.microsoft.com/typescript/2017/04/27/announcing-typescript-2-3/) for [TSLint][tslint].\n\nTo use the plugin:\n\n* Install TSLint 5+ in your workspace or globally (if you are using a local TSLint, see [workspace library execution](#workspace-library-execution))\n\n* Install the plugin with `npm install typescript-tslint-plugin` \n\n* Enable the plugin in your `tsconfig.json` file:\n\n    ```json\n    {\n      \"compilerOptions\": {\n        \"plugins\": [\n          { \"name\": \"typescript-tslint-plugin\" }\n        ]\n      }\n    }\n    ```\n\nSee [editor support](#editor-support) for more detailed setup instructions.\n\n## Workspace Library Execution\n\nBy default this plugin will not load TSLint or custom rules from the workspace if you are using a global version of TypeScript. This is done for security reasons. The plugin always allows using the global version of TSLint.\n\nTo use enable using a local TSLint install and custom rules from the workspace, you must either:\n\n- Use a workspace version of TypeScript that is installed alongside TSLint.\n\n- Enable workspace library execution in your editor of choice. This must be done through an editor and cannot be configured in a `tsconfig`.\n\n    In VS Code for example, you can run the `TSLint: Manage Workspace Library Execution` command to enable using the TSLint for the current workspace or for all workspaces.\n\n- Set a `TS_TSLINT_ENABLE_WORKSPACE_LIBRARY_EXECUTION=1` environment variable and make sure the TypeScript server is run in an environment where this variable is set to true.\n\n## Configuration options\n\n**Notice**: This configuration settings allow you to configure the behavior of the typescript-tslint-plugin itself. To configure rules and tslint options you should use the `tslint.json` file.\n\n * `configFile` - The configuration file that tslint should use instead of the default tslint.json. A relative file path is resolved relative to the project root.\n * `jsEnable` - Enable/disable tslint for `.js` files, default is `false`.\n * `ignoreDefinitionFiles` - Control if TypeScript definition files should be ignored. Default is `true`\n * `alwaysShowRuleFailuresAsWarnings` - Always show rule failures as warnings, ignoring the severity configuration in the tslint.json configuration. Default is `true`.\n * `suppressWhileTypeErrorsPresent` - Suppress tslint errors from being reported while other errors are present.\n * `exclude` - List of files to exclude from tslint.\n * `packageManager` - Package manager used, either: `npm`, `yarn`, or `pnpm`. This is currently only used for error message instructions about how to install tslint. Default is `npm`.\n \nHere is a configuration sample:\n\n```json\n{\n  \"compilerOptions\": {\n    \"plugins\": [\n      {\n        \"name\": \"typescript-tslint-plugin\",\n        \"alwaysShowRuleFailuresAsWarnings\": false,\n        \"ignoreDefinitionFiles\": true,\n        \"configFile\": \"../tslint.json\",\n        \"suppressWhileTypeErrorsPresent\": false\n      }\n    ]\n  }\n}\n```\n\n**Notice**: due to an issue in the implementation of the `no-unused-variable` rule ([palantir/tslint#2469](https://github.com/palantir/tslint/issues/2649)), this rule will be disabled by the plugin. You can use the typescript compiler options `noUnusedLocals` and `noUnusedParameters` instead. \n\n\n# Editor Support\nThis plugin requires TypeScript 3.0 or later. It can provide intellisense in both JavaScript and TypeScript files within any editors that uses TypeScript to power their language features.\n\n## With VS Code\n*If you also have the [vscode-tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) extension in VS Code installed, please disable it to avoid that files are linted twice.*\n\nThe simplest way to use this plugin is to install the [TypeScript TSLint Plugin VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin). This extension enables the plugin when using VS Code's version of TypeScript.\n\nIf you are using a workspace version of TypeScript, you must manually install the plugin alongside the version of TypeScript in your workspace:\n\n```bash\nnpm install --save-dev typescript-tslint-plugin typescript\n```\n\nThen add a `plugins` section to your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or [`jsconfig.json`](https://code.visualstudio.com/Docs/languages/javascript#_javascript-project-jsconfigjson)\n\n```json\n{\n  \"compilerOptions\": {\n    \"plugins\": [\n      {\n        \"name\": \"typescript-tslint-plugin\"\n      }\n    ]\n  }\n}\n```\n\nFinally, run the `Select TypeScript version` command in VS Code to switch to use the workspace version of TypeScript for VS Code's JavaScript and TypeScript language support. You can find more information about managing typescript versions [in the VS Code documentation](https://code.visualstudio.com/Docs/languages/typescript#_using-newer-typescript-versions).\n\n![Usage with VS Code](documentation/example-vscode.png)\n\nThe most important differences between the `vscode-tslint` extension and `typescript-tslint-plugin` are:\n\n* The plugin shares the program representation with TypeScript. This is more efficient than the `vscode-tslint` extension which needs \n  to reanalyze the document.\n* Since `vscode-tslint` lints one file a time only, it cannot support tslint rules that require the type checker. The plugin doesn't have this limitation.\n* `vscode-tslint` provides additional [features](https://marketplace.visualstudio.com/items?itemName=eg2.tslint), please file issue requests for the features you are missing.\n\n\n### With Atom\nThis plugin works with the [Atom TypeScript plugin](https://atom.io/packages/atom-typescript).\n\nFirst install the plugin and a copy of TypeScript in your workspace:\n\n```bash\nnpm install --save-dev typescript-tslint-plugin typescript\n```\n\nThen add a `plugins` section to your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or [`jsconfig.json`](https://code.visualstudio.com/Docs/languages/javascript#_javascript-project-jsconfigjson) and restart Atom.\n\n```json\n{\n  \"compilerOptions\": {\n    \"plugins\": [\n      {\n        \"name\": \"typescript-tslint-plugin\"\n      }\n    ]\n  }\n}\n```\n\n![Usage with atom](documentation/example-atom.png)\n\n\n### With Sublime\nThis plugin works with the [Sublime TypeScript plugin](https://github.com/Microsoft/TypeScript-Sublime-Plugin).\n\nFirst install the plugin and a copy of TypeScript in your workspace:\n\n```bash\nnpm install --save-dev typescript-tslint-plugin typescript\n```\n\nAnd configure Sublime to use the workspace version of TypeScript by [setting the `typescript_tsdk`](https://github.com/Microsoft/TypeScript-Sublime-Plugin#note-using-different-versions-of-typescript) setting in Sublime:\n\n```json\n{\n  \"typescript_tsdk\": \"/Users/me/my-amazing-project/node_modules/typescript/lib\"\n}\n```\n\nFinally add a `plugins` section to your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or [`jsconfig.json`](https://code.visualstudio.com/Docs/languages/javascript#_javascript-project-jsconfigjson) and restart Sublime.\n\n```json\n{\n  \"compilerOptions\": {\n    \"plugins\": [\n      {\n        \"name\": \"typescript-tslint-plugin\"\n      }\n    ]\n  }\n}\n```\n\n![Usage with Sublime](documentation/example-sublime.png)\n\n### With Visual Studio\nThis plugin works [Visual Studio 2017](https://www.visualstudio.com) using the TypeScript 2.5+ SDK.\n\nFirst install the plugin in your project:\n\n```bash\nnpm install --save-dev typescript-tslint-plugin\n```\n\nThen add a `plugins` section to your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html).\n\n```json\n{\n  \"compilerOptions\": {\n    \"plugins\": [\n      {\n        \"name\": \"typescript-tslint-plugin\"\n      }\n    ]\n  }\n}\n```\n\nThen reload your project to make sure the plugin has been loaded properly. Note that `jsconfig.json` projects are currently not supported in Visual Studio.\n\n### With vim and neovim\n\nUse [coc-tslint-plugin](https://github.com/neoclide/coc-tslint-plugin) as extension of [coc.nvim](https://github.com/neoclide/coc.nvim).\n\nRun command in your vim after coc.nvim installed:\n\n```\n:CocInstall coc-tsserver coc-tslint-plugin\n```\n\nRun command `:CocConfig` to open configuration file.\n\n# Contributing\nTo build the typescript-tslint-plugin, you'll need [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/).\n\nFirst, [fork](https://help.github.com/articles/fork-a-repo/) the typescript-tslint-plugin repo and clone your fork:\n\n```bash\ngit clone https://github.com/YOUR_GITHUB_ACCOUNT_NAME/typescript-tslint-plugin.git\ncd typescript-tslint-plugin\n```\n\nThen install dev dependencies:\n\n```bash\nnpm install\n```\n\nThe plugin is written in [TypeScript](http://www.typescriptlang.org). The source code is in the `src/` directory with the compiled JavaScript output to the `lib/` directory. Kick off a build using the `compile` script:\n\n```bash\nnpm run compile\n```\n\nPlease also see our [Code of Conduct](CODE_OF_CONDUCT.md).\n\n## VS Code\n\nTo test the newly compiled program, open the `test-workspace` folder in VS Code and use the TypeScript version picker to [switch to the local version of TypeScript](https://code.visualstudio.com/Docs/languages/typescript#_using-newer-typescript-versions).\n\nTo debug you use two versions of VS Code, e.g., the stable and the insider version. The idea is that one of them is configured to support attaching a debugger to the Typescript language server:\n\n- Use the insider version for development and open it on the typescript-tslint-plugin workspace.\n- Use the stable version for debugging opened on the `test-workspace` folder of the tslint-language service.\n\nTo setup the stable version for debugging, you need to set the environment variable `TSS_DEBUG` to port 5859. In a command prompt/shell:\n\n- make sure that the stable version isn't running already\n- `set TSS_DEBUG=5859`\n- cd to the `dev` folder\n- `code .`\n\nTo debug the plugin press `F5`. The `dev` workspace has a launch configuration that attaches through port 5859 to the language server. \n\n# Credits\n\nThis project was forked from  https://github.com/angelozerr/tslint-language-service which itself is based on https://github.com/Microsoft/vscode-tslint/\n\n\n[tslint]: https://github.com/palantir/tslint\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Ftypescript-tslint-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Ftypescript-tslint-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Ftypescript-tslint-plugin/lists"}