This linter plugin for Linter provides an interface to elixirc/mix.
It will be used with files that have the "source.elixir" syntax
There are limitations with Elixirc that:
Plugin requires Linter package and it should install it by itself. If it did not, please follow Linter instructions here.
$ apm install linter-elixirc
Plugin should work with default settings. If not:
Edit > Preferences (Ctrl+, or Cmd+,)
Packages > Search "linter-elixirc" > Settings
elixirc path option - use
which elixirc to find path. ie.
mix path option - use
which mix to find path. ie.
always use elixirc option - leave it disabled, unless
mix compile is too slow.
mix env option - Allows changing the Mix environment for lint runs. If using IEx at the same time as Atom this can be changed to allow IEx to pick up code changes.
The operation of the linter is dependent on the type of Elixir files you are working with:
If you open a folder containing a Mix project (i.e. the file
in the root folder of the project), the linter will use
mix compile to
include all dependencies, unless you enable "Always use elixirc" setting.
If you open a single
.ex file, the linter will use
elixirc. This will try
to find dependency build artifacts in the location where Mix projects normally
output to (
\_build/dev/lib/\*/ebin). If your build output path is different,
then every external dependency will trigger a compile error.
.exs files are not compiled by
mix compile, they are always linted
elixirc, even if they appear within a Mix project.
ExUnit tests are always organised within
.exs files, so they will also be
elixirc. Test files can have extra dependencies that will not
be found within the normal dev build artifact directory. Instead, test files
are linted using the test build artifact directory (
Whether you're using the Mix or
elixirc options for linting, it is still
possible to encounter false positive errors in your lint output, particularly
relating to dependencies. It can help to perform a
mix compile from a
terminal to keep the project build output directory fresh, and a
will help if you are seeing particular problems with errors in ExUnit test
Sometimes Mix can get confused when files are renamed, so it can also help
to perform the occasional
mix do clean, compile.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.