Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(installation): Update Hoisted dependencies step to help users with Prettier/EsLint #4580

Open
wants to merge 2 commits into
base: canary
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions apps/docs/content/docs/guide/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,26 @@ If you are using pnpm, you need to add the following line to your `.npmrc` file
public-hoist-pattern[]=*@heroui/*
```

<Blockquote color="primary">
**Note**: In version <10 of pnpm the default values of the hoist pattern contains ['*eslint*', '*prettier*'] and by adding the hoist pattern they will get removed and you may experince the tools not working.
</Blockquote>

##### Additional Steps: #####
1. **Prettier**: If you are using Prettier < v3, add it back to the hoist pattern.

2. **ESLint**:
- If you use ESLint < v9 without the flat config, add it back.
- Some v9 setups may also require it.

Refer to [this pnpm release note](https://github.com/pnpm/pnpm/releases/tag/v10.0.0-rc.0#:~:text=Packages%20containing%20eslint%20or%20prettier%20in%20their%20name%20are%20no%20longer%20hoisted%20to%20the%20root%20node_modules.%20The%20default%20value%20of%20the%20public%2Dhoist%2Dpattern%20setting%20has%20changed) for more details.

Depending on your needs, your `.npmrc` file might look like this:
```bash
public-hoist-pattern[]=*@heroui/*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
```

After modifying the `.npmrc` file, you need to run `pnpm install` again to ensure that the dependencies are installed correctly.

#### Tailwind CSS Setup
Expand Down Expand Up @@ -262,6 +282,26 @@ If you are using pnpm, you need to add the following line to your `.npmrc` file
public-hoist-pattern[]=*@heroui/*
```

<Blockquote color="primary">
**Note**: In version <10 of pnpm the default values of the hoist pattern contains ['*eslint*', '*prettier*'] and by adding the hoist pattern they will get removed and you may experince the tools not working.
</Blockquote>

##### Additional Steps: #####
1. **Prettier**: If you are using Prettier < v3, add it back to the hoist pattern.

2. **ESLint**:
- If you use ESLint < v9 without the flat config, add it back.
- Some v9 setups may also require it.

Refer to [this pnpm release note](https://github.com/pnpm/pnpm/releases/tag/v10.0.0-rc.0#:~:text=Packages%20containing%20eslint%20or%20prettier%20in%20their%20name%20are%20no%20longer%20hoisted%20to%20the%20root%20node_modules.%20The%20default%20value%20of%20the%20public%2Dhoist%2Dpattern%20setting%20has%20changed) for more details.

Depending on your needs, your `.npmrc` file might look like this:
```bash
public-hoist-pattern[]=*@heroui/*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
```

After modifying the `.npmrc` file, you need to run `pnpm install` again to ensure that the dependencies are installed correctly.

#### Tailwind CSS Setup
Expand Down