# @fbem/typescript-plugin

> Functional BEM TypeScript plugin

Latest version **2.0.14** (published 2023-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fbem/typescript-plugin
pnpm add @fbem/typescript-plugin
yarn add @fbem/typescript-plugin
bun add @fbem/typescript-plugin
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.14 |
| Published | 2023-12-14 |
| First published | 2022-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Vladislav Ivanov |
| Maintainers | yungvldai |
| Keywords | bem, fbem, typescript, plugin |

## Links

- npm: https://www.npmjs.com/package/@fbem/typescript-plugin
- Repository: https://github.com/yungvldai/fbem
- Homepage: https://github.com/yungvldai/fbem/tree/master/packages/typescript-plugin
- Issues: https://github.com/yungvldai/fbem/issues
- npm.io page: https://npm.io/package/@fbem/typescript-plugin

## Dependencies (7)

- [postcss](https://npm.io/package/postcss.md) 8.4.31
- [@fbem/core](https://npm.io/package/@fbem/core.md) ^2.0.13
- [icss-utils](https://npm.io/package/icss-utils.md) ^5.1.0
- [postcss-load-config](https://npm.io/package/postcss-load-config.md) ^3.0.1
- [postcss-filter-plugins](https://npm.io/package/postcss-filter-plugins.md) ^3.0.1
- [postcss-icss-keyframes](https://npm.io/package/postcss-icss-keyframes.md) ^0.2.1
- [postcss-icss-selectors](https://npm.io/package/postcss-icss-selectors.md) ^2.0.3

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.14 (latest) — 2023-12-14
- 2.0.13 — 2022-12-18
- 2.0.12 — 2022-11-19
- 2.0.11 — 2022-11-19
- 2.0.10 — 2022-11-19
- 2.0.7 — 2022-11-18
- 2.0.0 — 2022-11-16
- 1.0.5 — 2022-11-16
- 1.0.4 — 2022-11-15
- 1.0.3 — 2022-11-15
- 1.0.2 — 2022-11-15

## README

# @fbem/typescript-plugin [![npm](https://img.shields.io/npm/v/@fbem/typescript-plugin)](https://www.npmjs.com/package/@fbem/typescript-plugin)

**@fbem/typescript-plugin** is a plugin for TypeScript. Plugin provides type definitions for generated BEM functions.

## Getting started

```console
npm i -D @fbem/typescript-plugin
```

**tsconfig.json**
```json
{
  "compilerOptions": {
    "plugins": [
      { 
        "name": "@fbem/typescript-plugin",
      }
    ]
  }
}
```

## Options

| Option | Description     |                   Default value                         |
|:------------:|:------:|:---------------------------------------------------------------:|
|     match    | Match pattern of what files should plugin process       |                              `"\\.css"`                             |
|    naming    | BEM naming rules for parsing CSS       | `{ "elem": "__", "modName": "\_", "modVal": "\_", "prefix": "cn" }` |
|   postcssOptions | Allows loading plugins (only supported ones) from PostCSS configuration and disable some of them    | `{ "useConfig": false, "excludePlugins": [] }`

useConfig	false	Set to true to load plugins from your PostCSS config.
excludePlugins	false	Only sync plugins are supported. Use this to set an array of async plugins to exclude (i.e. ['postcss-mixins'])

For VS Code users it's important to use [workspace version of TypeScript](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-the-workspace-version-of-typescript).

And last but not least: add a declaration (.d.ts) file with the following content into your project:
```ts
declare module '*.css';
```

## Troubleshooting

The first thing to do in case of problems is to make sure that the root of the project in the IDE is the folder with `tsconfig` file. Make sure you are using the workspace version of TypeScript. Try to restart TS server. If the problem persists, then open an issue, but please attach the TS server logs.

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