elm-review/documentation/Migration v1 to v2.md
2020-04-05 13:14:18 +02:00

4.3 KiB

Migration from v1 to v2

Rule writing

There are a lot of other API changes not related to creating rules, which are related to making everything work for the CLI. I am not going to describe these here because it's unlikely that someonetiuched that. If I am wrong about this and you did depend on these APIs, come talk to me or open an issue.

Review configuration

Folder structure change

The default folder structure has been updated, therefore I recommend removing your review/ folder (at least the ReviewConfig.elm and elm.json) then running elm-review init. Then you can copy paste what you had in your previous ReviewConfig into the new one.

In practice, you should be able to have a very similar configuration, but the following sections might make you change a few things.

Tests now included by default

If you were running elm-review with arguments, I recommend removing them and to see if that works out.

The tests/ directory is now included by default, so you might get errors from that. To ignore these errors for the moment, you can change the arguments to elm-review, or use Rule.ignoreErrorsForDirectories. I recommend having your tests reviewed after the migration phase.

Rule changes

Here are the changes for the review packages from jfmengels.

jfmengels/review-debug

The NoDebug rule is split into NoDebug.Log and NoDebug.TodoOrToString. Just remove the former and add the latter two rules to have the same.

jfmengels/review-unused

NoUnused.CustomTypeConstructors now takes an argument, which you can replace by [].

Notice that both NoUnused.Variables and NoUnused.CustomTypeConstructors can report new errors though, so you might need to fix the errors or to disable the rule temporarily.

There are now a lot of new rules that you can pick up from, so go check those out!