$ npm install @fimbul/bifrost
Compatiblity layer for TSLint rules and formatters.
Make sure to also read the full documentation of all available modules.
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.
npm install --save @fimbul/bifrost
# or
yarn add @fimbul/bifrost
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.
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};
Apache-2.0 © Klaus Meinhardt
© 2010 - cnpmjs.org x YWFE | Home | YWFE