Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint-plugin): linter chokes on aws-cdk-lib/core import #26022

Merged
merged 2 commits into from
Jun 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update invalid-cfn-imports.ts
  • Loading branch information
kaizencc authored Jun 16, 2023
commit 518851f2e25526de861b380acdde8e74ad02fd5a
Original file line number Diff line number Diff line change
@@ -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;
}
}