All Projects → angelozerr → Tslint Language Service

angelozerr / Tslint Language Service

Licence: mit
TypeScript 2.2.1 plugin for tslint

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Tslint Language Service

Discordinjections
Injects CSS and JS into the Discord client.
Stars: ✭ 138 (-27.37%)
Mutual labels:  plugins
Express Webpack React Redux Typescript Boilerplate
🎉 A full-stack boilerplate that using express with webpack, react and typescirpt!
Stars: ✭ 156 (-17.89%)
Mutual labels:  tslint
Awesome Intellij Idea
用爬虫在全网范围内检索 Intellij IDEA 的优秀文章,聚合在此。平台包括 「CSDN」「掘金」「简书」「知乎」「SegmentFault」「博客园」「开源中国」「慕课手记」,相信无论你对 Intellij IDEA 目前了解到什么程度,这个项目都能帮到你。
Stars: ✭ 2,704 (+1323.16%)
Mutual labels:  plugins
Mirai
The core for Mirai Bot v4 [Deprecated]
Stars: ✭ 142 (-25.26%)
Mutual labels:  plugins
Unimgpicker
Image picker for Unity iOS/Android
Stars: ✭ 148 (-22.11%)
Mutual labels:  plugins
Express Graphql Typescript Boilerplate
A starter kit for building amazing GraphQL API's with TypeScript and express by @w3tecch
Stars: ✭ 163 (-14.21%)
Mutual labels:  tslint
Ansible Human log
This Ansible callback plugin for human-readable result logging for Ansible 1.9/2.0-2.4.
Stars: ✭ 132 (-30.53%)
Mutual labels:  plugins
Typescript Webpack React Redux Boilerplate
React and Redux with TypeScript
Stars: ✭ 182 (-4.21%)
Mutual labels:  tslint
React Native Typescript Boilerplate
React Native Typescript starter kit / template (Redux Thunk + React Native Navigation v7 + TSLint)
Stars: ✭ 155 (-18.42%)
Mutual labels:  tslint
Xcodeplugintool
🎧a easy way use plugins after Xcode upgraded
Stars: ✭ 174 (-8.42%)
Mutual labels:  plugins
Electron React Typescript Webpack Boilerplate
Pre-configured boilerplate for Electron + React + TypeScript + Webpack
Stars: ✭ 146 (-23.16%)
Mutual labels:  tslint
Workflow
一个工作流平台
Stars: ✭ 1,888 (+893.68%)
Mutual labels:  tslint
Pf4j Spring
Plugin Framework for Spring (PF4J - Spring Framework integration)
Stars: ✭ 165 (-13.16%)
Mutual labels:  plugins
Xbar Plugins
Plugin repository for xbar (the BitBar reboot)
Stars: ✭ 1,964 (+933.68%)
Mutual labels:  plugins
Angular Tslint Rules
Shared TSLint & codelyzer rules to enforce a consistent code style for Angular development
Stars: ✭ 181 (-4.74%)
Mutual labels:  tslint
Build
Netlify Build runs the build command, Build Plugins and bundles Netlify Functions.
Stars: ✭ 135 (-28.95%)
Mutual labels:  plugins
Tslint Angular
Recommended tslint configuration for Angular applications.
Stars: ✭ 159 (-16.32%)
Mutual labels:  tslint
Sonartsplugin
SonarQube plugin for TypeScript files
Stars: ✭ 182 (-4.21%)
Mutual labels:  tslint
Typestrict
ESLint config focused on maximizing type safety 💪
Stars: ✭ 182 (-4.21%)
Mutual labels:  tslint
Unitymobileinput
Unity mobile Input plugin for iOS and Android (Unity UI compatible)
Stars: ✭ 170 (-10.53%)
Mutual labels:  plugins

This project is now deprecated, please see the following repositories:

It was a great experiences to work with smart guys (Mircrosoft and other guys), but today I have no time to work on this project. See discussion at https://github.com/angelozerr/tslint-language-service/issues/88#issuecomment-430142603

tslint-language-service

Build Status NPM version

TypeScript language service plugin for tslint.

To use it the plugin:

  • install the plugin with npm install tslint-language-service

  • enable the plugin in your tsconfig.json file:

{
  "compilerOptions": {
    "plugins": [
      { "name": "tslint-language-service"}
    ]
  }
}
  • If you are using TypeScript < 2.2.1, you must execute tsserver with tsserver-plugins.

Your node_modules folder should look like this:

  • node_modules
    • tslint
    • tslint-language-service
    • typescript

Notice due to an issue in the implementation of the no-unused-variable rule ([issue2469]), this rule will be disabled by the plugin. You can use the typescript compiler options noUnusedLocals and noUnusedParameters instead.

Configuration options

Notice this configuration settings allow you to configure the behaviour of the tslint-language-service plugin. To configure rules and tslint options you should use the tslint.json file.

  • 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.
  • ignoreDefinitionFiles - control if TypeScript definition files should be ignored.
  • alwaysShowRuleFailuresAsWarnings - always show rule failures as warnings, ignoring the severity configuration in the tslint.json configuration.
  • disableNoUnusedVariableRule - disable no-unused-variable rule.
  • supressWhileTypeErrorsPresent - supress tslint errors from being reported while other errors are present.
  • mockTypeScriptVersion - force tslint to use the same version of TypeScript as this plugin. This will affect other plugins that require the typescript package.

Here a configuration sample:

{
  "compilerOptions": {
    "plugins": [
      { "name": "tslint-language-service",
        "alwaysShowRuleFailuresAsWarnings": false,
        "ignoreDefinitionFiles": true,
        "configFile": "../tslint.json",
        "disableNoUnusedVariableRule": false,
        "supressWhileTypeErrorsPresent": false,
        "mockTypeScriptVersion": false
      }
    ]
  }
}

Editors Support

All editors which consumes tsserver (VSCode >=1.16.1, Sublime, Eclipse, etc) can use tslint-language-service. Here a demo with Eclipse and tslint 5.0.0.

tslint demo

Eclipse

Install typescript.java and you can use the TypeScript Project wizard which configures tslint-language-service.

Visual Studio Code

If you also have the vscode-tslint extension in VS Code installed, please disable it to avoid that files are linted twice.

To use the plugin with VS Code (>=1.16.1):

  • If you are using the vscode-tslint extension disable or uninstall it.
  • Install typescript, the tslint-language-service, and tslint into your workspace using npm install typescript tslint tslint-language-service.
  • Open VS Code on the workspace
  • Switch to the Typescript version that is installed locally in the workspace using the version switcher (see below) in the bottom right of the status bar.

The most important differences between the vscode-tslint extension and the tslint-languageservice-plugin are:

  • The plugin shares the program representation with TypeScript. This is more efficient than the vscode-tslint extension which needs to reanalyze the document.
  • Since vscode-tslint lints one file a time only, it cannot support tslint rules that require the type checker. The language service plugin doesn't have this limitation.
  • vscode-tslint provides additional features, please file issue requests for the features you are missing.

ts version switcher

Demo

tslint demo VS Code

Development Setup

This section describes how to setup your environment so that you can develop and test the language server plugin.

The folder dev contains a project with a tsconfig.json that enables the tslint-languageservice plugin a tslint.json and some test files with rule violations you can use for manual testing.

VS Code

To compile the test for manual testing run npm run devtest, this script compiles the plugin and patches the tslint-language-service module inside the dev folder.

To test open VS Code on the dev folder and use the TypeScript version picker to switch to the local version of TypeScript. This version will use the patched tslint-language-service module.

To 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:

  • Use the insider version for development and open it on the tslint-language-service workspace.
  • Use the stable version for debugging opened on the dev folder of the tslint-language service.

To setup the stable version for debugging, you need to set the environment variable TSS_DEBUG to port 5859. In a command prompt/shell:

  • make sure that the stable version isn't running already
  • set TSS_DEBUG=5859
  • cd to the dev folder
  • code .

To debug the tslint-language-service plugin press F5. The dev workspace has a launch configuration that attaches through port 5859 to the language server. To set a break point open node_modules\tslint-language-service\out\src\index.js. You have to set the break point in the .js file, but you can step afterwards in the TypeScript source file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].