# auto-import-types

> A vite plugin for auto import types.

Latest version **0.0.6** (published 2024-09-06) · 0 weekly downloads

## Install

```sh
npm install auto-import-types
pnpm add auto-import-types
yarn add auto-import-types
bun add auto-import-types
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2024-09-06 |
| First published | 2022-05-10 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Allen-1998 |
| Maintainers | runninguo |

## Links

- npm: https://www.npmjs.com/package/auto-import-types
- Repository: https://github.com/Allen-1998/auto-import-types
- Homepage: https://github.com/Allen-1998/auto-import-types#readme
- Issues: https://github.com/Allen-1998/auto-import-types/issues
- npm.io page: https://npm.io/package/auto-import-types

## Recent versions

- 0.0.6 (latest) — 2024-09-06
- 0.0.4 — 2022-06-14
- 0.0.3 — 2022-06-13
- 0.0.2 — 2022-05-23
- 0.0.1 — 2022-05-10

## README

# auto-import-types

[![NPM version](https://img.shields.io/npm/v/auto-import-types?color=a1b858&label=)](https://www.npmjs.com/package/auto-import-types)

Auto Import Types on-demand for Vite. With TypeScript support. The implementation idea by [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import).It will automatically configure declared types in esLint's global option.

## Install

`npm i auto-import-types`

## Setup

```ts
// vite.config.ts
import { defineConfig } from 'vite'
import AutoImportTypes from 'auto-import-types'

export default defineConfig({
  plugins: [AutoImportTypes()],
})
```

```js
// .eslintrc.js
module.exports = {
  extends: ['.eslintrc-auto-import-types.json'],
}
```

## Config Options

```ts
type ESLintGlobalsPropValue = boolean | 'readonly' | 'readable' | 'writable' | 'writeable'

interface ESLintConfigs {
  globals: Record<string, ESLintGlobalsPropValue>
}

type Options = Partial<{
  dtsDir: string
  filepath: string
  globalsPropValue: ESLintGlobalsPropValue
}>

const defaultOptions = {
  dtsDir: 'src/@types',
  filepath: '.eslintrc-auto-import-types.json',
  globalsPropValue: true,
}
```

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