-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Cause
| node.superClass.object.name === 'cdk' && |
This line of code ⬆️ enforces we use the name cdk to import "all" from aws-cdk-lib.
e.g.
import * as cdk from "aws-cdk-lib" // ✅ works!
import * as Cdk from "aws-cdk-lib" // ❌ doesn't work!Reason
You might be curious why I would wanna use other import names like Cdk.
Well, let's take a look at React:
// 😌
import * as React from "react"
<React.Fragment />
React.useState()
// 🥴
import * as react from "react"
<react.Fragment />
react.useState()From the above example, we can see that capitalizing the name of import "all" makes more sense.
Workaround
import { Stack } from "aws-cdk-lib", or- Patch
eslint-plugin-cdk@1.8.0with ⬇️
- node.superClass.object.name === 'cdk' &&
+ node.superClass.object.name.toLowerCase() === 'cdk' &&Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels