# @fimbul/bifrost

> Compatibility layer for TSLint rules

Latest version **0.24.0** (published 2021-02-19) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @fimbul/bifrost
pnpm add @fimbul/bifrost
yarn add @fimbul/bifrost
bun add @fimbul/bifrost
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.24.0 |
| Published | 2021-02-19 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 27.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 281 |
| Author | Klaus Meinhardt |
| Maintainers | ajaff, harbard |
| Keywords | wotan, rules, formatters, tslint, compatibility |

## Links

- npm: https://www.npmjs.com/package/@fimbul/bifrost
- Repository: https://github.com/fimbullinter/wotan
- Homepage: https://github.com/fimbullinter/wotan#readme
- Issues: https://github.com/fimbullinter/wotan/issues
- npm.io page: https://npm.io/package/@fimbul/bifrost

## Dependencies (4)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0
- [tsutils](https://npm.io/package/tsutils.md) ^3.5.0
- [@fimbul/ymir](https://npm.io/package/@fimbul/ymir.md) ^0.24.0
- [get-caller-file](https://npm.io/package/get-caller-file.md) ^2.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.24.0 (latest) — 2021-02-19
- 0.24.0-dev.20210216 — 2021-02-16
- 0.24.0-dev.20210214 — 2021-02-14
- 0.24.0-dev.20210120 — 2021-01-20
- 0.22.0 — 2020-12-09
- 0.21.0 — 2019-06-06
- 0.21.0-dev.20190518 — 2019-05-18
- 0.21.0-dev.20190329 — 2019-03-29
- 0.21.0-dev.20190322 — 2019-03-22
- 0.21.0-dev.20190318 — 2019-03-18
- 0.20.0 — 2019-03-16
- 0.18.0 — 2019-01-06
- 0.18.0-dev.20190106 — 2019-01-06
- 0.17.0 — 2018-12-21
- 0.17.0-dev.20181221 — 2018-12-21
- … 45 more at https://npm.io/package/@fimbul/bifrost/versions

## README

# Bifröst

Compatiblity layer for TSLint rules and formatters.

[![npm version](https://img.shields.io/npm/v/@fimbul/bifrost.svg)](https://www.npmjs.com/package/@fimbul/bifrost)
[![npm downloads](https://img.shields.io/npm/dm/@fimbul/bifrost.svg)](https://www.npmjs.com/package/@fimbul/bifrost)
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovateapp.com/)
[![CircleCI](https://circleci.com/gh/fimbullinter/wotan/tree/master.svg?style=shield)](https://circleci.com/gh/fimbullinter/wotan/tree/master)
[![Build status](https://ci.appveyor.com/api/projects/status/a28dpupxvjljibq3/branch/master?svg=true)](https://ci.appveyor.com/project/ajafff/wotan/branch/master)
[![codecov](https://codecov.io/gh/fimbullinter/wotan/branch/master/graph/badge.svg)](https://codecov.io/gh/fimbullinter/wotan)
[![Join the chat at https://gitter.im/fimbullinter/wotan](https://badges.gitter.im/fimbullinter/wotan.svg)](https://gitter.im/fimbullinter/wotan)

Make sure to also read the [full documentation of all available modules](https://github.com/fimbullinter/wotan#readme).

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

It also provides the exact opposite functionality: using rules originally written for Fimbullinter (wotan) as TSLint rule.

## Installation

```sh
npm install --save @fimbul/bifrost
# or
yarn add @fimbul/bifrost
```

## Using TSLint Rules and Formatters in Wotan

### Rules

Given a TSLint rule `my-foo` in a file `myFooRule.ts`, you simply create a file `my-foo.ts` with the following content:

```ts
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:

```ts
import {wrapTslintFormatter} from '@fimbul/bifrost';
import {Formatter} from './myFooFormatter.ts';

const Wrapped = wrapTslintFormatter(Formatter);
export {Wrapped as Formatter};
```

Note that findings with severity `suggestion` are reported as `warning` through TSLint formatters.

## Using Fimbullinter Rules in TSLint

Given a Fimbullinter rule `my-foo` in a file `my-foo.ts`, you simply create a file `myFooRule.ts` with the following content:

```ts
import {wrapRuleForTslint} from '@fimbul/bifrost';
import {Rule} from './my-foo.ts';

const Wrapped = wrapRuleForTslint(Rule);
export {Wrapped as Rule};
```

## License

Apache-2.0 © [Klaus Meinhardt](https://github.com/ajafff)

---
_Source: https://npm.io/package/@fimbul/bifrost · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
