0.24.0 • Published 3 years ago

@fimbul/heimdall v0.24.0

Weekly downloads
173
License
Apache-2.0
Repository
github
Last release
3 years ago

Heimdall

Wotan module to use TSLint rules and formatters.

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

Enable the use of TSLint rules and formatters.

Installation

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

Using TSLint Formatters

wotan -m @fimbul/heimdall -f code-frame

-f code-frame refers to the TSLint core CodeFrameFormatter.

The -m @fimbul/heimdall argument enables a hook that loads TSLint formatters if no Wotan formatter is found. That means you cannot use a TSLint formatter when a builtin Wotan formatter with the same name exists.

Using TSLint Rules

To enable Heimdall, add the -m @fimbul/heimdall argument when running wotan from CLI.

wotan -m @fimbul/heimdall

Specifying TSLint rules in your .wotanrc.yaml works as follows. Note that you need to specify a prefix for TSLint rules (tslint/ in this example)

---
rulesDirectories:
  tslint: . # enables TSLint core rules
  tcc: tslint-consistent-codestyle/rules # enables custom TSLint rules provided by the package 'tslint-consistent-codestyle'. the path may be different for each package
rules:
  no-unused-expression: error # without prefix this is a Wotan core rule
  tslint/no-unused-expression: error # with prefix this refers to the TSLint core rule
  tslint/semicolon: # TSLint core rule 'semicolon' with option 'always'
    options: always
  tcc/no-unused: error # 'no-unused' from tslint-consistent-codestyle

Why!?

Why should you use Wotan to execute TSLint rules?

  • Allows you to reuse existing rules and rules packages without any modification.
  • Enables the use of processors, for example to use files like Vue Single File Components (see @fimbul/ve), that are currently not supported by TSLint.
  • Configuration goodness provided by Wotan:
    • Overrides to change the config by matching glob patterns.
    • You can use a rule with the same name from different packages. Because you need to specify a prefix for every package, rules won't get overidden by other packages or TSLint core rules.
    • Aliases
    • JSON5 support
  • Blazingly fast autofixing, especially when linting the whole project with the -p flag.
  • Smart handling of overlapping fixes avoids destroying your code.

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.4.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago