Wotan module to lint according to your existing
Make sure to also read the full documentation of all available modules.
Drop-in replacement for TSLint. Uses your existing
tslint.json files, loads TSLint rules and formatters and honors
npm install --save-dev @fimbul/wotan @fimbul/valtyr# oryarn add -D @fimbul/wotan @fimbul/valtyr
wotan -m @fimbul/valtyr
-m @fimbul/valtyr argument enables this package. It searches
tslint.yaml) files for configuration like TSLint does. It loads TSLint core rules as well as custom rules with the same rules as TSLint. It uses TSLint formatters to format the result.
There are only minor differences:
- CLI arguments are still those of the Wotan executable
- exception messages are a bit different
stylishformatter is used by default
- files of external modules are always excluded while
*.d.tsin your project are included by default
tslint.json has no field to configure processors, you need to configure them in a separate file.
Create a file named
.fimbullinter.yaml. If it already exists, simply add the new cofiguration under the
The following example shows how to enable a processor for
valtyr:overrides:- files: "*.vue"processor: "@fimbul/ve"
Note that the configuration for
valtyr can only contain
processor. Everything else is not supported and will result in an error.
Why should you use Wotan to execute TSLint rules?
- Allows you to use your existing configuration, rules and formatters without modification.
- Avoids using two different lint tool during migration to Wotan.
- Blazingly fast autofixing, especially when linting the whole project with the
- Smart handling of overlapping fixes avoids destroying your code.
- Allows the use of builtin configurations and shareable configs as CLI argument for
- Debug output to diagnose crashes.
- Configuration caching avoids unnecessary work when linting many directories with the same config.
- Optimized line switch parser finds
tslint:disablecomments faster with less overhead, especially in big files.
- Reports unused and redundant
- Processor support for TSLint rules
- Consistently excludes external files and JSON files from linting.
- Supports project
- Additional startup time by loading Wotan and TSLint.
- Wrapping rules and formatters comes with additional runtime and memory overhead.
- For most projects there will be no noticeable difference in performance, smaller projects usually take longer to lint while bigger ones get faster.
- Minor differences in handling disable comments:
- Disabling a previously disabled rule for a single line doesn't automatically enable the rule after that line.
- Having a disable comment in a line that is affected by a singleline disable comment might work differently:
/* tslint:disable-line */ // tslint:disable. Since this pattern doesn't make sense most cases this shouldn't be noticeable.
This package allows you to use your existing TSLint configuration. On the other hand you cannot use any of the builtin rules of Wotan or all those other useful configuration features like overrides, aliases, etc. If you want to lint with your existing TSLint config and your new Wotan config, you need to run Wotan twice, which adds a lot of overhead.
Heimdall requires you to rewrite your linter configuration and switch to
.wotanrc.json if you like that better).
In return you can use Wotans fully optimized builtin rules as well as all the other cool features.
Heimdall allows you to execute Wotan and TSLint rules in one single run.
Apache-2.0 © Klaus Meinhardt