 linterPath = atom.packages.getLoadedPackage('linter').path
 Linter = require "#{linterPath}/lib/linter"
-findFile = require "#{linterPath}/lib/util"
 
 path = require "path"
 fs = require 'fs'

    @flowPath = @findFlowInPath()

    @flowEnabled = true
    @flowEnabled &= atom.project.path and fs.existsSync(atom.project.path)
    @flowEnabled &= fs.existsSync(path.join(atom.project.path, '.flowconfig'))
    @flowEnabled &= @flowPath?

    unless @flowEnabled


    @flowPath = path.join(@flowPath, 'flow')

    flowServer = spawn(@flowPath, ['start', '--all', '--module', 'node', path.resolve(atom.project.getPath())])
    flowServer.on 'close', (code) => @flowEnabled &= (code is 2)

  destroy: ->
    spawn(@flowPath, ['--stop', path.resolve(atom.project.getPath())])
    console.log "die"

module.exports = LinterFlow
