Code Monkey home page Code Monkey logo

vscode-ts-tslint's Introduction

DEPRECATED

This extension has been deprecated in favor of the vscode-typescript-tslint-plugin extension.

This repository has been superseded by typescript-tslint-plugin and vscode-typescript-tslint-plugin


vscode-tslint(vnext) PREVIEW

This is a preview of a work in progress reimplementation of the vscode-tslint extension. It is published to enable early feedback and testing. The implementation uses the new TypeScript language server plugin support introduced in TypeScript version 2.3. It runs tslint as a plugin for the TypeScript language server.

The extension can be installed side-by-side with the current vscode-tslint extension, use the Extensions Viewlet to disable the version of the extension you do not want to use.

Limitations

This is a preview and many of the features provided by the vscode-tslint extension are not yet provided. See this issue for the list of known gaps between vscode-tslintsee this issue.

Due to an issue in the tslint implementation of the no-unused-variable rule (#2649), this rule has to be disabled by the plugin. You can use the typescript compiler options noUnusedLocals and noUnusedParameters instead.

Differences between vscode-tslint (vnext) and vscode-tslint

  • configuration options for tslint are now done inside the tsconfig.json in plugins section (see below).
  • the implementation as a TypeScript server plugin enables to shares the program representation with TypeScript. This is more efficient than the current vscode-tslint implementation. The current implementation needs to reanalyze a document that has already been analyzed by the TypeScript language server.
  • vscode-tslint can only lint one file a time. It therefore cannot support semantic tslint rules that require the type checker. The language service plugin doesn't have this limitation. To overcome this limitation is a key motivation for reimplementing the extension.
  • the extension bundles a tslint and typescript version.

Configuring the tslint-server-plugin

You can define settings for the tslint-language-service plugin in the tsconfig.json file. The available settings are documented here:

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

Using a different version of tslint than the version that is bundled with the extension

The extension comes with a particular version of tslint. If you want to use a different version then you have to use npm install the tslint-language-service module and tslint as a peer to the TypeScript version you want to use. The modules folder should have the following layout:

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

If you are extending the TypeScript version that is installed into your workspace then make sure to use this version and not the one that comes with VS Code. Otherwise you will have configured the setting typescript.tsdk already and things should just work.

vscode-ts-tslint's People

Contributors

egamma avatar gregvanl avatar mjbvz avatar unional avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.