# nuxt-eslint-global-imports

> Create a json file with all the global imports for eslint

Latest version **2.0.0** (published 2025-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install nuxt-eslint-global-imports
pnpm add nuxt-eslint-global-imports
yarn add nuxt-eslint-global-imports
bun add nuxt-eslint-global-imports
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2025-07-27 |
| First published | 2023-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | khr2003 |

## Links

- npm: https://www.npmjs.com/package/nuxt-eslint-global-imports
- npm.io page: https://npm.io/package/nuxt-eslint-global-imports

## Dependencies (1)

- [@nuxt/kit](https://npm.io/package/@nuxt/kit.md) ^4.0.1

## Recent versions

- 2.0.0 (latest) — 2025-07-27
- 1.0.1 — 2024-06-22
- 1.0.0 — 2023-02-20

## README

Create eslint globals file for nuxt.

When you use nuxt.js, many functions/variables/objects are defined globally so you can use them with importing. This will cause eslint to complain about undefined variables. This package will create a file that contains all the globals to include them in eslint config and hide the errors.

The file is called `eslintrc-auto-import.json` and it will be created in .nuxt folder.

## Installation

```bash
pnpm install nuxt-eslint-global-imports -D

-- or --
npm install nuxt-eslint-global-imports -D
```

## Usage
First add this package to your nuxt config under modules section:

```js
export default defineNuxtConfig({
	...
	modules: [
		// ....
		'nuxt-eslint-global-imports',
	],
};
```

Then in you eslint config add this line to `extends` array:
```js
const globalImportsPath = './.nuxt/.eslintrc-auto-import.json';
const nuxtAutoImports = JSON.parse(fs.readFileSync(globalImportsPath));

export default {
	//...
	{
		languageOptions: {
			globals: nuxtAutoImports.globals,
		},
	},
};
```

## Development
If you would like to develop this package, you can use clone it and run these commands:

```bash
# Install dependencies
pnpm install

# Generate type stubs
pnpm dev:prepare

# Develop with the playground
pnpm dev

# Build the playground
pnpm dev:build

# Compile the package
pnpm prepack
```

---
_Source: https://npm.io/package/nuxt-eslint-global-imports · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
