Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 766ab1d

Browse files
chore: check package.json existence in package-packages.ts (typescript-eslint#6454)
1 parent bbfed02 commit 766ab1d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/integration/pack-packages.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ const tarFolder = tmp.dirSync({
3030
const tseslintPackages: PackageJSON['devDependencies'] = {};
3131
for (const pkg of PACKAGES) {
3232
const packageDir = path.join(PACKAGES_DIR, pkg);
33-
const packageJson: PackageJSON = require(path.join(
34-
packageDir,
35-
'package.json',
36-
));
33+
const packagePath = path.join(packageDir, 'package.json');
34+
if (!fs.existsSync(packagePath)) {
35+
continue;
36+
}
37+
38+
const packageJson = require(packagePath) as PackageJSON;
3739
if (packageJson.private === true) {
3840
continue;
3941
}

0 commit comments

Comments
 (0)