Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

elm-impfix

1.0.8 • Public • Published

elm-impfix

Command-line tool to remove unused imports from Elm modules.

Install

$ npm install -g elm-impfix

Usage

$ elm-impfix MyModule.elm -o ../build/MyModule.elm

The use case is explained on the Github page.

Flags

Output (optional)

$ elm-impfix MyModule.elm -o path/to/output.elm

Defaults to name_Impfix.ext (if source = name.ext). Use "/" in paths.

Qualifying unqualified imports (optional)

$ elm-impfix MyModule.elm -q path/to/ImportedModule.elm
$ elm-impfix MyModule.elm -q "Imported1.elm Imported2.elm"

Makes unqualified imports explicit ("import ImportedModule exposing (..)" > "import ImportedModule exposing (this, that)").

Wildcards

All params support wildcards:

$ elm-impfix "*.elm"  -o "../build/*.*"  -q "./Imports/*.elm"

Wildcard params must be quoted.

To overwrite all source files, use the -r (--replace) flag. To recursively overwrite all .elm files in a folder, use

elm-impfix "folder/**/*.elm" -r

To exclude some files from the output wildcard, use -x (--exclude):

elm-impfix "folder/**/*.elm" -r -x "folder/elm-stuff/**/*.*"

Bugs

Bug reports are welcome and likely.

Keywords

none

install

npm i elm-impfix

Downloadsweekly downloads

26

version

1.0.8

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability