let g:jsx_ext_required = 0
Finding Files and Navigating
There are two options among so many options for fuzzy finding; they are FZF and the corresponding FZF.vim plugin. This lets me quickly navigate through projects to find the files I’m after. Not JS specific, but definitely worth a mention.
ESLint + Flow Integration
ESLint and Flow are the two command line tools that are usually used. These tools will check my code to ensure that everything typed correctly, or formatted correctly based on ESLint.
Until recently, integrating these with Vim was far from ideal, for two reasons:
- If you often install command line tools locally instead of globally, npm puts the executable in ./node_modules/.bin. This can break editor integrations, because they expect to have the executable available, so try running eslint, rather than ./node_modules/.bin/eslint./node_modules/.bin/eslint , for example.
- Vim didn’t have support for async, background jobs, up until the release of Vim 8. This causes the editor would be unresponsive for a second or two when you saved your file, and ESLint ran, until ESLint returned. This is only a small amount of lag but it’s really noticeable.
With Vim 8, all of those problems have been solved recently. Ale is a linting plugin that comes out the box with support for a variety of linting tools for different filetypes and languages, and most importantly for me that includes ESLint and Flow. Moreover, it can automatically detect which linters to run and you really don’t need to configure it all.