AtomLinter / linter-flow

Atom Linter for Facebook's Flow typechecker
MIT License
98 stars 21 forks source link

Make ability to use local flow-bin more obvious #153

Open aendra-rininsland opened 7 years ago

aendra-rininsland commented 7 years ago

As per #67, setting Flow path to ./node_modules/.bin/flow definitely loads the local Flow binary.

That said, it feels like this could be more intuitive — perhaps by assuming local flow-bin by default if the path isn't set in settings. It feels like using the local version of Flow is the current best practice (able to control Flow version based on package.json being the primary benefit; not having to deal with arbitrarily-versioned Flow binaries between projects being the other), and I didn't even realise using a local flow-bin was possible until I searched the issue queue.

Even in #67, it's never really mentioned that setting a relative path is an option (the fact that the field's label says "Absolute path to the Flow executable on your system." doesn't help).

idan commented 7 years ago

Ideally this should work without needing to configure the path to the local flow binary. If you take a look at how linter-eslint does this, it automatically looks for a project-local eslint before trying the global one. There's even an option to only enable eslint if an .eslintrc is present; this could work the same way vis-a-vis .flowconfig:

2017-05-18 at 15 34

Configuring linter-flow using ./node_modules/.bin/flow seems to be broken for me right now, but regardless, it's a hack.

Since this isn't coming with a pull request attached, consider it an argument for the ideal UI here. :)