0.24.0 • Published 3 years ago

@fimbul/valtyr v0.24.0

Weekly downloads
1,401
License
Apache-2.0
Repository
github
Last release
3 years ago

Valtýr

Wotan module to lint according to your existing tslint.json and tslint:disable comments.

npm version npm downloads Greenkeeper badge CircleCI Build status codecov Join the chat at https://gitter.im/fimbullinter/wotan

Make sure to also read the full documentation of all available modules.

Purpose

Drop-in replacement for TSLint. Uses your existing tslint.json files, loads TSLint rules and formatters and honors tslint:disable comments.

Installation

npm install --save-dev @fimbul/wotan @fimbul/valtyr
# or
yarn add -D @fimbul/wotan @fimbul/valtyr

Usage

wotan -m @fimbul/valtyr

The -m @fimbul/valtyr argument enables this package. It searches tslint.json (or 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
  • stylish formatter is used by default
  • files of external modules are always excluded while *.d.ts in your project are included by default

Why!?

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 -p flag.
  • Smart handling of overlapping fixes avoids destroying your code.
  • Allows the use of builtin configurations and shareable configs as CLI argument for -c, e.g. -c tslint:latest or -c tslint-config-airbnb.
  • Debug output to diagnose crashes.
  • Configuration caching avoids unnecessary work when linting many directories with the same config.
  • Optimized line switch parser finds tslint:disable comments faster with less overhead, especially in big files.

Caveats

  • Additional startup time by loading Wotan and TSLint.
  • Wrapping rules and formatters comes with additional runtime and memory overhead.
  • There's some overhead of the processor machinery that still runs, even though it's unused.
  • For most projects there will be no noticeable difference in performance, smaller projects usually take longer to lint while bigger ones get faster.

Difference to Heimdall

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 features like processors, 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.yaml (or .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.

License

Apache-2.0 © Klaus Meinhardt

0.24.0

3 years ago

0.23.0

3 years ago

0.22.0

3 years ago

0.21.0

5 years ago

0.20.0

5 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.0

6 years ago

0.14.0

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago