LoginSignup
2
3

More than 5 years have passed since last update.

個人環境をflow対応した作業録

Last updated at Posted at 2017-04-21

プロジェクトはflow対応したしnpm scriptsも整備してCIも出来るようになった。

さて後は個人の設定だ。

この記事は鮮度に気を使いません。
書捨てますので、投稿日からの経過日数などに気をつけてください。

vimの設定

シンタックスハイライト効かなくて辛い。

雑にしらべたところvim-javascriptってのがあるらしくそれを試している。

スクリーンショット 2017-04-21 10.43.38.png

: type のあたりもハイライトしてほしい。

readmeに従って g:javascript_plugin_flow を設定した。

ついでに、 g:javascript_plugin_jsdoc も設定してみた。

追記

確かに色が付くんだけど、 typeのとこが必ず色が付くわけでもないのでちょっと不満。

追記 vim-flow

flow-binにwatchが無いので代わりにこいつをいれてみた。

eslint

どうせpluginがあるんでしょ?

eslint-plugin-flowtype インストール

ほらあった。
eslint-plugin-flowtype

とりあえずグローバルにインストール
npm i -g eslint-plugin-flowtype

ん? babel eslintも必要?
npm i -g babel-eslint

(ESLint parser does not support type annotations).

なんとなく分かる気もするけど、なんとなくでインストール。

.eslintrc 設定

.eslintrcの編集。 自分はyml派です。

parser: babel-eslint
plugins:
  - flowtype

コレで取り敢えず、eslintで怒られなくなった。

ルール 設定

もちろん recommendで
https://github.com/gajus/eslint-plugin-flowtype#recommended

終わり

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3