vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.3k stars 1.14k forks source link

typescript/eslint checker not displaying error #2287

Closed adikari closed 5 years ago

adikari commented 5 years ago

I am using typescript/eslint checker and for some reason the error is not reported by Syntastic. When I check the debug message, I can see the expected error message in the output.

Output from mes:

Messages maintainer: Bram Moolenaar <Bram@vim.org>
"src/graphql/index.ts" 10L, 269C
"src/graphql/index.ts" 10L, 269C written
syntastic: 5.363273: g:syntastic_version = '3.10.0-4 (Vim 801, Darwin)'
syntastic: 5.363476: &shell = '/bin/zsh', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir
 = '>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape = ''
syntastic: 5.364452: UpdateErrors (auto): default checkers
syntastic: 5.364966: CacheErrors: default checkers
syntastic: 5.366265: g:syntastic_aggregate_errors = 1
syntastic: 5.366635: getcwd() = '/Users/subash/acloudguru/gardener/backend/services/plants'
syntastic: 5.390913: CacheErrors: Invoking checker: typescript/eslint
syntastic: 5.393257: SyntasticMake: called with options: {'postprocess': ['guards'], 'errorformat': '%E%f: line %l\, co
l %c\, Error - %m,%W%f: line %l\, col %c\, Warning - %m', 'makeprg': 'eslint src/graphql/index.ts'}
syntastic: 7.990729: system: command run in 2.594744s
syntastic: 7.990928: checker output: ['', '/Users/subash/acloudguru/gardener/backend/services/plants/src/graphql/index.
ts', '  10:1  error  Prefer default export  import/prefer-default-export', '', '✖ 1 problem (1 error, 0 warnings)', '',
 '']
syntastic: 7.992417: raw loclist: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'ty
pe': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', '
type': '', 'pattern': '', 'text': '/Users/subash/acloudguru/gardener/backend/services/plants/src/graphql/index.ts'}, {'
lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': '  10
:1  error  Prefer default export  import/prefer-default-export'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol':
 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol
': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': '✖ 1 problem (1 error, 0 warnings)'}, {'lnum': 0, 'buf
nr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'b
ufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 7.996808: postprocess: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'ty
pe': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', '
type': '', 'pattern': '', 'text': '/Users/subash/acloudguru/gardener/backend/services/plants/src/graphql/index.ts'}, {'
lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': '  10
:1  error  Prefer default export  import/prefer-default-export'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol':
 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol
': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': '✖ 1 problem (1 error, 0 warnings)'}, {'lnum': 0, 'buf
nr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'b
ufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 7.999553: getLocList: checker typescript/eslint returned 1
syntastic: 7.999723: typescript/eslint raw: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module
': '', 'type': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'modu
le': '', 'type': '', 'pattern': '', 'text': '/Users/subash/acloudguru/gardener/backend/services/plants/src/graphql/inde
x.ts'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'te
xt': '  10:1  error  Prefer default export  import/prefer-default-export'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid':
0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid'
: 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': '✖ 1 problem (1 error, 0 warnings)'}, {'lnum
': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}, {'ln
um': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 8.000274: quiet_messages filter: {}
syntastic: 8.000436: getLocList: checker typescript/eslint run in 2.609231s
syntastic: 8.000798: aggregated: {'_sorted': 0, '_name': '', '_owner': 3, '_columns': 1, '_rawLoclist': []}
syntastic: 8.001154: sorted: {'_sorted': 1, '_name': '', '_owner': 3, '_columns': 1, '_rawLoclist': []}

Output of SyntasticInfo:

Syntastic version: 3.10.0-4 (Vim 801, Darwin)
Info for filetype: typescript
Global mode: active
Filetype typescript is active
The current file will be checked automatically
Available checkers: eslint tslint
Currently enabled checker: eslint

I have a local eslintrc.yml where my eslint rules are defined.

Thanks.

lcd047 commented 5 years ago

'makeprg': 'eslint src/graphql/index.ts'

^ This seems to be the root of your of your problem, you're missing a -f compact. This happens only if you have g:syntastic_javascript_eslint_generic set to a true value. Don't do that if you're using the real eslint.

adikari commented 5 years ago

awesome. that worked. Thank you @lcd047