diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.ts b/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.ts index b85cf8180401c..440749d0bdf19 100644 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.ts +++ b/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.ts @@ -143,6 +143,10 @@ function getCdkRootDir(filename: string): string | undefined { } function isAlphaPackage(packageDir: string): boolean { + if (packageDir.endsWith('aws-cdk-lib/core')) { + return false; // special case for core because it does not have a package.json + } + const pkg = JSON.parse(fs.readFileSync(path.join(packageDir, 'package.json'), { encoding: 'utf-8' })); const separateModule = pkg['separate-module']; @@ -182,4 +186,4 @@ function checkLeftAndRightForCfn(node: any): { name: string, location: string } const left = checkLeftAndRightForCfn(node.left); return right ?? left ?? undefined; -} \ No newline at end of file +}