Skip to content

Commit 5c657e2

Browse files
authored
fix: VSCode ESLint Plugin unable to load correctly when using pnpm@10 (#2090)
1 parent 89cfba9 commit 5c657e2

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.changeset/real-women-post.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-t3-app": patch
3+
---
4+
5+
Fix VSCode ESLint Plugin unable to load correctly when using [email protected]

cli/src/installers/eslint.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { PKG_ROOT } from "~/consts.js";
55
import { type Installer } from "~/installers/index.js";
66
import { addPackageDependency } from "~/utils/addPackageDependency.js";
77
import { addPackageScript } from "~/utils/addPackageScript.js";
8+
import { getUserPkgManager } from "~/utils/getUserPkgManager.js";
89
import { type AvailableDependencies } from "./dependencyVersionMap.js";
910

1011
// Also installs prettier
@@ -42,6 +43,13 @@ export const dynamicEslintInstaller: Installer = ({ projectDir, packages }) => {
4243

4344
fs.copySync(prettierSrc, prettierDest);
4445

46+
// pnpm
47+
const pkgManager = getUserPkgManager();
48+
if (pkgManager === "pnpm") {
49+
const pnpmSrc = path.join(extrasDir, "pnpm/.npmrc");
50+
fs.copySync(pnpmSrc, path.join(projectDir, ".npmrc"));
51+
}
52+
4553
addPackageScript({
4654
projectDir,
4755
scripts: {

cli/template/extras/pnpm/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
public-hoist-pattern[]=*eslint*
2+
public-hoist-pattern[]=*prettier*

0 commit comments

Comments
 (0)