Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ESLint Plugin: Fix
recommended
preset when prettier
is not instal…
…led (#40634) * Fix `recommended` ESLint preset when `prettier` is not installed The `prettier` package is incorrectly mandatory when using the `@wordpress/eslint-plugin/recommended` preset. Failure to install it results in an error. `prettier` is intended to be an optional peer dependency, with related rulesets added only when the user has installed `prettier`. However, the `@worpress/prettier-config` package eagerly loads `prettier`'s `package.json`, leading to an error when it is not installed. This change moves the require of `@worpress/prettier-config` inside the relevant `if` block, so that it is only loaded when `prettier` is confirmed to be installed. * Update CHANGELOG.md Co-authored-by: Greg Ziółkowski <[email protected]>
- Loading branch information