# Migration: `import-x` namespace (v12.0.0)

`10.0.0` adopted `eslint-plugin-import-x` but registered it under the `import` namespace to keep the
`import/*` rule IDs stable (ADR-0002). `import` is the canonical namespace of a different package, so a
config that also claimed that key aborted; `docs/known-issue-import-namespace.md` records how. `12.0.0`
moves the plugin to its own `import-x` namespace, and moves Nuxt's registration with it. ADR-0004 records
the decision.

## What changed

- The plugin is registered as `import-x` instead of `import`.
- The rule this config sets from it is now `import-x/no-duplicates` (was `import/no-duplicates`).
- `/nuxt` used to move `@nuxt/eslint-config`'s own import registration to `import-x` as well. From `14.0.0` it
  composes that layer with `features.standalone: false`, which contributes no `import` registration, so there is
  nothing to move. `docs/known-issue-import-namespace.md` covers a configuration that keeps the standalone
  layer.

## What you need to do

Rename any reference to an `import/*` rule that resolves through **this** config:

```diff
  rules: {
-     'import/no-duplicates': ['error'],
+     'import-x/no-duplicates': ['error'],
  }
```

Left unchanged, an active severity (`'error'`, `'warn'`, `2`, `1`) aborts the run with
`Could not find plugin "import"` as soon as ESLint lints a file the reference applies to. An `'off'` (or
`0`) severity is tolerated, but rename it for consistency.

```diff
- /* eslint-disable import/no-duplicates */
+ /* eslint-disable import-x/no-duplicates */
```

Left unchanged, a stale disable directive reports `Definition for rule 'import/no-duplicates' was not
found`, whatever your `reportUnusedDisableDirectives` setting. The same applies to
`eslint-disable-next-line`.

`eslint-plugin-import-x` remains the peer dependency at the same version. Two setups need a closer look:

- If you register your **own** copy of `eslint-plugin-import-x`, it now contends with this config for the
  `import-x` key unless the two resolve to one instance. Pin `eslint-plugin-import-x` with an
  `overrides`/`resolutions` entry (workaround 2 in `docs/known-issue-import-namespace.md`), or drop your
  registration where this config already supplies `import-x` for the files you reference the rules on.
- If you register your **own** `eslint-plugin-import`, your `import/*` references resolve against your
  plugin and keep working untouched. A workaround that disabled Nuxt's import chunk can be dropped
  wherever the rehome runs; `docs/known-issue-import-namespace.md` lists the cases where it does not.

## Links

- Issue #204 (tracked in the private repository)
- ADR-0004 records this decision, and ADR-0002 the superseded registration choice. Both are kept in the
  repository rather than published.
- [Known issue: `import` plugin namespace collision](known-issue-import-namespace.md) - when the collision
  still fires, and the workarounds
