# prettier 3 error: Unknown option after codemod upgraded the config

TL;DR: The upgraded config contains an option Prettier 3 does not recognize - usually a Prettier 2-era plugin option whose plugin is no longer installed, or a core option renamed or removed in v3. Get the exact option name from the error, then remove it, rename it, or install the plugin that provides it.

```text
prettier 3 error: Unknown option after codemod upgraded the config
```

## Steps

1. Run prettier to capture the exact option name: `npx prettier --check .`
   Expected: the error names the unknown option explicitly.
2. Ask whether it is a plugin option (formatter plugins register their own options). If so, confirm the plugin is installed AND listed in the config's `plugins` array.
   Expected: either the plugin is missing (install it and list it) or the option is a core option.
3. If it is a core option, look it up in the Prettier 3 option list - v3 renamed or dropped a few v2-era options. Delete or rename the key in the config accordingly.
   Expected: the config contains only options valid in Prettier 3.
4. Verify: `npx prettier --check .`
   Expected: no `Unknown option` error; formatting check runs normally.

## Use this when

- Prettier 3 reports `Unknown option` right after a codemod or upgrade touched the config.
- The option worked under Prettier 2.
- The config was carried over mechanically rather than regenerated.

## Not for this skill when

- The unknown option is a CLI flag you typed by hand - that is a typo, not a config migration issue.
- Prettier 2 reports the unknown option - that is a v2 config/plugin mismatch.
- The config file itself has a parse error - fix the syntax first.

## Variant phrasings

- prettier unknown option after upgrade to v3
- prettier 3 config migration unknown option
- prettier plugin option not recognized after upgrade

## Why it happens

The codemod carried v2-era settings forward, but Prettier 3 validates options strictly: plugin-provided options are unknown unless that plugin actually loads, and a few v2 core options did not survive the major bump - so the stale key is rejected instead of ignored.

## Edge cases

- A plugin option needs the plugin installed AND listed in `plugins` - one without the other still errors.
- Shareable configs can inject the bad option from an extends chain - check the whole chain, not just your file.
- Run `prettier --check` on the codemod's config output immediately after upgrading, before committing it.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_TjYf0N-IM6fsLV5tV53K_g
