summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShane Smith <shane@smudel.ca>2017-04-18 04:28:54 -0400
committerw0rp <w0rp@users.noreply.github.com>2017-04-18 09:28:54 +0100
commit72449d7cb154ec16dee95fac76c487c28f7d48df (patch)
tree47570e5d9e164a2c5da93a5c5c03ac0616203321
parentbdad25eefd6526f8130f97edbe25a1179e27aadc (diff)
downloadale-72449d7cb154ec16dee95fac76c487c28f7d48df.zip
Add missing "use global" var for tslint (#484)
* Add missing "use global" var for tslint * Add typescript tslint documentation
-rw-r--r--ale_linters/typescript/tslint.vim7
-rw-r--r--doc/ale-typescript.txt40
-rw-r--r--doc/ale.txt2
3 files changed, 49 insertions, 0 deletions
diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim
index 247aeb43..c56c8b23 100644
--- a/ale_linters/typescript/tslint.vim
+++ b/ale_linters/typescript/tslint.vim
@@ -7,7 +7,14 @@ let g:ale_typescript_tslint_executable =
let g:ale_typescript_tslint_config_path =
\ get(g:, 'ale_typescript_tslint_config_path', '')
+let g:ale_typescript_tslint_use_global =
+\ get(g:, 'ale_typescript_tslint_use_global', 0)
+
function! ale_linters#typescript#tslint#GetExecutable(buffer) abort
+ if ale#Var(a:buffer, 'typescript_tslint_use_global')
+ return ale#Var(a:buffer, 'typescript_tslint_executable')
+ endif
+
return ale#path#ResolveLocalPath(
\ a:buffer,
\ 'node_modules/.bin/tslint',
diff --git a/doc/ale-typescript.txt b/doc/ale-typescript.txt
new file mode 100644
index 00000000..b33084cf
--- /dev/null
+++ b/doc/ale-typescript.txt
@@ -0,0 +1,40 @@
+===============================================================================
+ALE TypeScript Integration *ale-typescript-options*
+
+
+-------------------------------------------------------------------------------
+tslint *ale-typescript-tslint*
+
+g:ale_typescript_tslint_executable *g:ale_typescript_tslint_executable*
+
+ Type: |String|
+ Default: `'tslint'`
+
+ ALE will first discover the tslint path in an ancestor node_modules
+ directory. If no such path exists, this variable will be used instead.
+
+ If you wish to use only a globally installed version of tslint, set
+ |g:ale_typescript_tslint_use_global| to `1`.
+
+
+g:ale_typescript_tslint_config_path *g:ale_typescript_tslint_config_path*
+
+ Type: |String|
+ Default: `''`
+
+ ALE will first discover the tslint.json path in an ancestor directory. If no
+ such path exists, this variable will be used instead.
+
+
+g:ale_typescript_tslint_use_global *g:ale_typescript_tslint_use_global*
+
+ Type: |Number|
+ Default: `0`
+
+ This variable controls whether or not ALE will search for a local path for
+ tslint first. If this variable is set to `1`, then ALE will always use the
+ global version of tslint, in preference to locally installed versions of
+ tslint in node_modules.
+
+-------------------------------------------------------------------------------
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale.txt b/doc/ale.txt
index b82fd5f5..1e332993 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -74,6 +74,8 @@ CONTENTS *ale-contents*
tex...................................|ale-tex-options|
chktex..............................|ale-tex-chktex|
lacheck.............................|ale-tex-lacheck|
+ typescript............................|ale-typescript-options|
+ tslint..............................|ale-typescript-tslint|
vim...................................|ale-vim-options|
vint................................|ale-vim-vint|
yaml..................................|ale-yaml-options|