ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sublime​Linter-contrib-tslint

by lavrton ST3

tslint plugin for SublimeLinter. Lint your typescript code.

Details

Installs

  • Total 9K
  • Win 3K
  • OS X 4K
  • Linux 2K
Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10
Windows 7 14 15 8 3 8 9 11 4 7 9 2 5 7 7 11 2 9 1 3 8 8 7 13 10 1 3 10 12 4 9 6 3 3 7 6 7 12 8 4 3 10 6 10 8 9
OS X 2 13 8 10 6 8 15 13 17 12 8 2 1 5 14 6 8 7 4 7 8 9 14 9 9 4 9 8 12 11 10 10 5 6 8 16 13 5 5 6 5 7 8 12 11 15
Linux 2 5 4 5 5 3 5 4 6 5 14 6 3 5 6 6 8 4 3 2 4 2 5 2 7 5 2 4 2 5 2 5 2 0 0 2 7 3 3 0 3 4 8 9 5 6

Readme

Source
raw.​githubusercontent.​com

SublimeLinter-contrib-tslint

Build Status

This linter plugin for SublimeLinter provides an interface to tslint. It will be used with files that have the “typescript” syntax.

Installation

SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions here.

Linter installation

Before installing this plugin, you must ensure that tslint is installed on your system. To install tslint, do the following:

  1. Install Node.js (and npm on Linux).

  2. Install tslint by typing the following in a terminal:

npm install -g tslint
  1. If you are using nvm and zsh, ensure that the line to load nvm is in .zshenv and not .zshrc.

Note: This plugin requires tslint 2.4.0 or later.

Linter configuration

In order for tslint to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in “Finding a linter executable” through “Validating your PATH” in the documentation.

Once you have installed and configured tslint, you can proceed to install the SublimeLinter-contrib-tslint plugin if it is not yet installed.

Plugin installation

Please use Package Control to install the linter plugin. This will ensure that the plugin will be updated when new versions are available. If you want to install from source so you can modify the source code, you probably know what you are doing so we won’t cover that here.

To install via Package Control, do the following:

  1. Within Sublime Text, bring up the Command Palette and type install. Among the commands you should see Package Control: Install Package. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.

  2. When the plugin list appears, type tslint. Among the entries you should see SublimeLinter-contrib-tslint. If that entry is not highlighted, use the keyboard or mouse to select it.

Settings

For general information on how SublimeLinter works with settings, please see Settings. For information on generic linter settings, please see Linter Settings. Also you should provide tslint.json file somewhere in your project directory.

You can configure tslint options in the way you would from the command line, with tslint.json files. For more information, see the tslint docs. The linter plugin does this by searching for a tslint.json file itself, just as tslint does from the command line. You may provide a custom config file by setting the linter’s "args" setting to ["--config", "/path/to/file"]. On Windows, be sure to double the backslashes in the path, for example ["--config", "C:\\Users\\Aparajita\\tslint.json"].

Alternatively, you can set the config_filename option to just the name of the configuration file in order to avoid defining absolute paths.

"linters": {
        "tslint": {
            "@disable": false,
            "args": [],
            "excludes": [
                "**/node_modules/**"
            ],
            "config_filename": "tslint.json"
        }
    }

Contributing

If you would like to contribute enhancements or fixes, please do the following:

  1. Fork the plugin repository.
  2. Hack on a separate topic branch created from the latest master.
  3. Commit and push the topic branch.
  4. Make a pull request.
  5. Be patient. ;-)

Please note that modications should follow these coding guidelines:

  • Indent is 4 spaces.
  • Code should pass flake8 and pep257 linters.
  • Vertical whitespace helps readability, don’t be afraid to use it.
  • Please use descriptive variable names, no abbrevations unless they are very well known.

Thank you for helping out!