Bifröst
Compatiblity layer for TSLint rules and formatters.

Make sure to also read the full documentation of all available modules.
Purpose
Allows TSLint rule authors to provide the same rules for Wotan without any refactoring.
Although @fimbul/heimdall
already allows users to use your rules and formatters in Wotan, they still need to remember to use -m @fimbul/heimdall
when running Wotan.
You can help these users by providing your rules in a format that Wotan understands without any plugin.
Installation
npm install --save @fimbul/bifrost
yarn add @fimbul/bifrost
Rules
Given a TSLint rule my-foo
in a file myFooRule.ts
, you simply create a file my-foo.ts
with the following content:
import {wrapTslintRule} from '@fimbul/bifrost';
import {Rule} from './myFooRule.ts';
const Wrapped = wrapTslintRule(Rule, 'my-foo');
export {Wrapped as Rule};
If you want to use a different directory for your TSLint rules and their Wotan wrapper, you just need to adjust the paths in the above example.
Formatters
Given a TSLint formatter my-foo
in a file myFooFormatter.ts
, you simply create a file my-foo.ts
with the following content:
import {wrapTslintFormatter} from '@fimbul/bifrost';
import {Formatter} from './myFooFormatter.ts';
const Wrapped = wrapTslintFormatter(Formatter);
export {Wrapped as Formatter};
License
Apache-2.0 © Klaus Meinhardt
v0.4.0
This release contains a lot of refactoring and structural changes:
- renamed
await-promise
to await-only-promise
- renamed
deprecation
to no-unstable-api-use
Two new packages were split from the wotan
package:
ymir
contains all base types and classes. This package can be used by extension and rule authors to not depend on the full wotan
runtime.mimir
contains all rules, formatters and configuration presets. Together with ymir
this package allows rules to be executed in a different runtime without depending on the whole wotan
package
Features:
- Added recipes to Readme
- new rule
await-async-result
- new rule
generator-require-yield
- new rule
no-nan-compare
- new rule
no-unreachable-code
- new rule
prefer-dot-notation
- new rule
prefer-number-isnan
- new rule
prefer-object-spread
no-unstable-api-use
(previously deprecation
) also checks @experimental
tag
Bugfixes:
no-unused-label
no longer forbids labels on statements other than loops and switch