<commit_before>" ========== "
" Javascript "
" ========== "

noremap <buffer> <leader><b> :call JsBeautify()<CR>

map <leader><space> :VimuxRunCommand("clear; npm start")<CR>
map <leader>t :VimuxRunCommand("clear; npm test")<CR>

nmap gd :TernDef<CR>

function! s:set_javascript_checker() " {{{
    " Set which linter syntastic uses based on lint option comments
    let l:lint_comment_line_num = search('\/\*.s.int', 'nwb')
    " Could be eslint, jslint, jshint
    let l:linter = matchstr(getline(l:lint_comment_line_num), '.s.int')

    if (len(l:linter))
        let g:syntastic_javascript_checkers = [ l:linter ]
    endif
endfunction " }}}

" Presume eslint
let g:syntastic_javascript_checkers = ['eslint']

if has("autocmd")
    augroup set_js_linter
        " clear group
        autocmd!
        " check on save for lint comments that might suggest linter
        autocmd BufWritePre <buffer> call s:set_javascript_checker()
    augroup END
endif

" Allow jsx in js files:
let g:jsx_ext_required = 0

" Use deoplete.
let g:tern_request_timeout = 1
let g:tern_show_signature_in_pum = 0  " This do disable full signature type on autocomplete

" syntax highlighting for flow
let g:javascript_plugin_flow = 1

" vim:fdm=marker
<commit_msg>Add flow to javascript neomake<commit_after>" ========== "
" Javascript "
" ========== "

noremap <buffer> <leader><b> :call JsBeautify()<CR>

map <leader><space> :VimuxRunCommand("clear; npm start")<CR>
map <leader>t :VimuxRunCommand("clear; npm test")<CR>

nmap gd :TernDef<CR>

function! s:set_javascript_checker() " {{{
    " Set which linter syntastic uses based on lint option comments
    let l:lint_comment_line_num = search('\/\*.s.int', 'nwb')
    " Could be eslint, jslint, jshint
    let l:linter = matchstr(getline(l:lint_comment_line_num), '.s.int')

    if (len(l:linter))
        let g:neomake_javascript_enabled_makers  = [ l:linter ]
        let g:neomake_jsx_enabled_makers  = [ l:linter ]
    endif
endfunction " }}}

" Presume eslint
let g:neomake_javascript_enabled_makers  = ['eslint', 'flow']
let g:neomake_jsx_enabled_makers  = ['eslint', 'flow']

if has("autocmd")
    augroup set_js_linter
        " clear group
        autocmd!
        " check on save for lint comments that might suggest linter
        autocmd BufWritePre <buffer> call s:set_javascript_checker()
    augroup END
endif

" Allow jsx in js files:
let g:jsx_ext_required = 0

" Use deoplete.
let g:tern_request_timeout = 1
let g:tern_show_signature_in_pum = 0  " This do disable full signature type on autocomplete

" syntax highlighting for flow
let g:javascript_plugin_flow = 1

" vim:fdm=marker

{'fraction_non_alphanumeric': 0.12333965844402277, 'fraction_numerical': 0.0030360531309297912, 'mean_word_length': 4.240556660039761, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6939068', 'n_tokens_mistral': 970, 'n_tokens_neox': 931, 'n_words': 240}