# @type-zen/ts-plugin

> TypeScript Plugin for TypeZen

Latest version **0.1.0** (published 2023-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @type-zen/ts-plugin
pnpm add @type-zen/ts-plugin
yarn add @type-zen/ts-plugin
bun add @type-zen/ts-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-04-03 |
| First published | 2023-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 46.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xlboy |
| Maintainers | xlboy88888 |
| Keywords | type-zen for typescript-plugin, type-zen-typescript-plugin, type-zen-ts-plugin, TypeZen TypeScript Plugin, TypeZen TS Plugin |

## Links

- npm: https://www.npmjs.com/package/@type-zen/ts-plugin
- npm.io page: https://npm.io/package/@type-zen/ts-plugin

## Dependencies (1)

- [@type-zen/core](https://npm.io/package/@type-zen/core.md) ^0.0.1-alpha.18

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

- 0.1.0 (latest) — 2023-04-03
- 0.1.0-alpha.1 — 2023-03-30

## README

# TypeScript Plugin for TypeZen


<p align="center">
  <a href="https://npmjs.com/package/@type-zen/ts-plugin"><img src="https://img.shields.io/npm/v/@type-zen/ts-plugin.svg?style=flat-square" alt="npm downloads"></a>
  <a href="https://npmjs.com/package/@type-zen/ts-plugin"><img src="https://img.shields.io/npm/dt/@type-zen/ts-plugin.svg?style=flat-square" alt="npm version"></a>
  <a href="https://www.npmjs.com/package/@type-zen/ts-plugin"><img src="https://img.shields.io/npm/l/@type-zen/ts-plugin.svg?style=flat-square" alt="License"></a>
</p>


![preview](https://user-images.githubusercontent.com/63690944/229493017-9a114a1c-357d-4db7-9b96-51715a3228b0.png)

English | [简体中文](./README.zh.md)

--- 
## Features

- Use types exported from `*.tzen` files in `*.ts` files

- Show related information when hovering over types exported from `*.tzen` files

- ...in development, stay tuned!

## Installation

```bash
npm install @type-zen/ts-plugin -D
```

## Usage

1. Import the plugin in `tsconfig.json`

    ```json
    {
      "compilerOptions": {
        "plugins": [{ "name": "@type-zen/ts-plugin" }]
      }
    }
    ```

2. Configure your editor

    Set the TypeScript version used in your project to the version in `node_modules/typescript/lib`.
    
    - **VSCode**

        Use the `Select TypeScript version` command to switch TypeScript versions.
    
    - ...
  
## Issues

1. When using `tsc` or other tools to perform *type checking*, the error `Cannot use namespace '...' as a type` is prompted

    **Answer:** This is because `tsc` and other tools do not load plugins during *type checking*, and therefore cannot recognize types exported from `*.tzen` files. For discussions related to this issue, please refer to [TypeScript#16607](https://github.com/microsoft/TypeScript/issues/16607).

    **Solution:** Compile the `*.tzen` files to generate the corresponding type declaration files (`.d.ts` files) before running `tsc` or other tools to perform *type checking*. This way, `tsc` or other tools can recognize the type declarations from `*.tzen` files.

2. When performing certain operations on types exported from `*.tzen` files in `*.ts` files (e.g., finding references, jumping to definitions, etc.), the **associated positions** may not be correct.

    **Answer:** This is due to certain internal mechanisms of TS Server, which still need to be studied in depth... (no solution yet)

## CHANGELOG

[CHANGELOG.md](https://github.com/xlboy/type-zen/blob/master/packages/ts-plugin/CHANGELOG.md)

## License

MIT License © 2023-PRESENT  [xlboy](https://github.com/xlboy)

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