coc-tslint-plugin


Ⅰ. 插件描述

coc.nvim extension that provides TSLint support using the typescript-tslint-plugin

Ⅱ. 基本信息

创建日期:  2019-03-05
使用用户:  5
Github星:  28
插件作者:  neoclide

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'neoclide/coc-tslint-plugin'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'neoclide/coc-tslint-plugin'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'neoclide/coc-tslint-plugin'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/neoclide/coc-tslint-plugin

Ⅳ. 文档说明

# coc-tslint-plugin

Adds tslint to coc.nvim using the TypeScript TSLint language service plugin.

This is a fork of vscode-typescript-tslint-plugin.

Please refer to the tslint documentation for how to configure the linting rules.

Install

Important: If you also have the coc-tslint extension installed, please disable it to avoid linting files twice.*

In your vim/neovim, run command:

:CocInstall coc-tsserver coc-tslint-plugin

Configuration

You can either configure the TSLint extension using a tsconfig or jsconfig as described here, or configure it with coc.nvim settings.

Note the coc.nvim based configuration override the tsconfig or jsconfig configuration.

  • tslint.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.
  • tslint.jsEnable - Enable/disable tslint for .js files. Default is false.
  • tslint.ignoreDefinitionFiles - Control if TypeScript definition files should be ignored. Default is true.
  • tslint.exclude - A glob or an array of globs. Any file matching these globs will not be linted.
  • tslint.alwaysShowRuleFailuresAsWarnings - Always show rule failures as warnings, ignoring the severity configuration in the tslint.json configuration.
  • tslint.suppressWhileTypeErrorsPresent - Suppress tslint errors from being reported while other errors are present.
  • tslint.autoFixOnSave - fix autofixable issues on save.

Differences with the coc-tslint extension

  • The implementation as a TypeScript server plugin enables to shares the program representation with TypeScript. This is more efficient than the current coc-tslint implementation. The current TSLint implementation needs to reanalyze a document that has already been analyzed by the TypeScript language server.
  • coc-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.

License

MIT

添加新评论