File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 > ) ,
You can’t perform that action at this time.
0 commit comments