仙台の山奥で自転車に乗ったり転んだり

愛車の GIOS でサイクリングしたりポタリングしたり、それをブログに記録してみたり。ロードバイクや自転車や坂のことを書いてみたり。ときたまプログラムのことを忘れないようにメモってみたり。

構文のエラーでgjslintが死ぬ

僕が世間の一般常識を知らないだけなんだと思うけど、こんな感じの構文にミスがあるJSファイルを gjslint でコーディングスタイルチェックかけると死んでしまうのなんでなのん

$ cat f.js
var f = function() {
}
$ gjslint f.js
Traceback (most recent call last):
  File "/usr/bin/gjslint", line 9, in <module>
    load_entry_point('closure-linter==2.3.17', 'console_scripts', 'gjslint')()
  File "/usr/lib/python2.7/site-packages/closure_linter/gjslint.py", line 271, in main
    _PrintErrorRecords(records_iter_copy)
  File "/usr/lib/python2.7/site-packages/closure_linter/gjslint.py", line 219, in _PrintErrorRecords
    for record in error_records:
  File "/usr/lib/python2.7/site-packages/closure_linter/gjslint.py", line 134, in _CheckPaths
    results = _CheckPath(path)
  File "/usr/lib/python2.7/site-packages/closure_linter/gjslint.py", line 150, in _CheckPath
    runner.Run(path, error_handler)
  File "/usr/lib/python2.7/site-packages/closure_linter/runner.py", line 146, in Run
    stop_token=error_token)
  File "/usr/lib/python2.7/site-packages/closure_linter/runner.py", line 198, in _RunChecker
    stop_token=stop_token)
  File "/usr/lib/python2.7/site-packages/closure_linter/checker.py", line 92, in Check
    self._ExecutePass(start_token, self._LintPass, stop_token)
  File "/usr/lib/python2.7/site-packages/closure_linter/checkerbase.py", line 189, in _ExecutePass
    pass_function(token)
  File "/usr/lib/python2.7/site-packages/closure_linter/checkerbase.py", line 154, in _LintPass
    self._lint_rules.CheckToken(token, self._state_tracker)
  File "/usr/lib/python2.7/site-packages/closure_linter/javascriptlintrules.py", line 75, in CheckToken
    super(JavaScriptLintRules, self).CheckToken(token, state)
  File "/usr/lib/python2.7/site-packages/closure_linter/ecmalintrules.py", line 363, in CheckToken
    is_immediately_used = (next_token.type == Type.START_PAREN or
AttributeError: 'NoneType' object has no attribute 'type'

とりあえずjshintで構文チェックするようして、vim上でちゃんと書くようにすればいいのかな。
スマートな開発スタイルがが分からない……。

let g:syntastic_javascript_checkers = ['jshint', 'gjslint']