You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
kenberkeley
changed the title
[eslint-plugin-cdk] doesn't work if I rename the import
[eslint-plugin-cdk/rules/ban-lambda-runtimes] doesn't work if I rename the import
Nov 28, 2022
We can not assume all the developers would write import { Runtime } from "aws-cdk-lib/aws-lambda". What if somebody writes import { Runtime as LambdaRuntime } from "aws-cdk-lib/aws-lambda" to void this rule check?
Cause
cdkdx/packages/eslint-plugin-cdk/src/utils/cdk.ts
Line 20 in 28df1ba
This line of code ⬆️ enforces we use the name
cdk
to import "all" fromaws-cdk-lib
.e.g.
Reason
You might be curious why I would wanna use other import names like
Cdk
.Well, let's take a look at React:
From the above example, we can see that capitalizing the name of import "all" makes more sense.
Workaround
import { Stack } from "aws-cdk-lib"
, oreslint-plugin-cdk@1.8.0
with ⬇️The text was updated successfully, but these errors were encountered: