Awesome
coc-tslint
Tthis extension is not maintained anymore, it can't work with latest coc.nvim.
Tslint language server extension for coc.nvim.
The tslint
module is resolved from current file and then global modules of npm
and yarn
.
Note: this extension can't detect semantic issues, use coc-tslint-plugin instead.
Install
In your vim/neovim run command:
:CocInstall coc-tslint
Features
- Lint
typescript
andjavascript
files using tslint. - Provide
codeActions
for fix lint issues. - Provide tslint commands:
tslint.fixAllProblems
fix problems of current buffer.tslint.createConfig
create tslint config file.tslint.lintProject
lint current project
Configuration options
Notice this configuration settings allow you to configure the behaviour of the vscode-tslint extension. To configure rules and tslint options you should use the tslint.json
file.
tslint.enable
- enable/disable tslint.tslint.jsEnable
- enable/disable tslint for .js files, default isfalse
.tslint.run
- run the linteronSave
oronType
, default isonType
.tslint.rulesDirectory
- an additional rules directory, for user-created rules.tslint.configFile
- the configuration file that tslint should use instead of the defaulttslint.json
.tslint.ignoreDefinitionFiles
- control if TypeScript definition files should be ignored, default istrue
.tslint.exclude
- configure glob patterns of file paths to exclude from linting. The pattern is matched against the absolute path of the linted file.tslint.validateWithDefaultConfig
- validate a file for which no custom tslint configuration was found. The default isfalse
.tslint.nodePath
- custom path to node modules directory, used to load tslint from a different location than the default of the current workspace or the global node modules directory.tslint.autoFixOnSave
- turns auto fix on save on or off, or defines an array of rules (e.g. [no-var-keyword
]) to auto fix on save. Note: Auto-fixing is only done when manually saving a file. It is not performed when the file is automatically saved based on thefiles.autoSave
setting. Executing a manual save on an already-saved document will trigger auto-fixing.tslint.alwaysShowStatus
- always show theTSLint
status bar item and not only when there are errors. The default isfalse
.tslint.alwaysShowRuleFailuresAsWarnings
- always show rule failures as warnings, ignoring the severity configuration in thetslint.json
configuration.tslint.packageManager
: use this package manager to locate thetslint
andtypescript
modules. Valid values are"npm"
or"yarn"
. This setting is only consulted when the modules are installed globally.
Auto-fixing
The extension supports automatic fixing of warnings to the extent supported by tslint. For warnings which support an auto-fix. You can apply the quick fix by either:
- Trigger
<Plug>(coc-codeaction)
with mapped keys, and select a fix action in input list. - use the command
Fix all auto-fixable problems
.
When there are overlapping auto fixes a user will have to trigger Fix all auto-fixable problems
more than once.
License
MIT