Skip to content

Commit 8b1e29d

Browse files
committed
docs: ✏️ update comments
1 parent 46a6e61 commit 8b1e29d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/syncDependencies/checkMissedPackageDeclaration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ export async function checkMissedPackageDeclaration(
1919
const packageJsonFile = join(projectCwd, 'package.json');
2020
// Extract the package.json file
2121
const packgeJson = readJson<Package['packageJson']>(packageJsonFile);
22-
// Extract the dependencies and devDependencies from the package.json file
23-
// Sort by length, to avoid the longest match
22+
// Extract the dependencies and peerDependencies from the package.json file
23+
// Sort by length in descending order to ensure imported modules are properly declared in either dependencies or peerDependencies
24+
// For example, '@scope/package/subpath' should match '@scope/package' not '@scope'
2425
const dependencies = Object.keys({
2526
...(packgeJson['dependencies'] as Record<string, string>),
2627
...(packgeJson['peerDependencies'] as Record<string, string>),

0 commit comments

Comments
 (0)