Run mix format on all unstaged Elixir files
git ls-files -m | awk '/\.[ex|exs]/' | xargs mix format {}
git ls-files -m | awk '/\.[ex|exs]/' | xargs mix format {}
This will only run tests which failed the last time:
mix tests --failed
There are far more useful options listed under mix help test
If you use just one or a few Lodash functions in a file, try importing them directly from their respective files, one by one.
import _ from 'lodash'; // bad - 70.5K (gzipped: 24.4K)
import { has } from 'lodash'; // bad - 70.5K (gzipped: 24.4K)
import has from 'lodash/has'; // good - 9K (gzipped: 2.7K)
Alternatively, one can use babel-plugin-lodash or lodash-es. These packages come with sets of restrictions though.
It is worth noting that mixing these 2 import styles will cause the net gain to be negative. Basically, it will import the entire lodash + individual utilities twice. So, for this to be effective, the ‘good’ pattern needs to be enforced everywhere across the codebase.