---
url: /rules/pascal-case-construct-id.md
---

# pascal-case-construct-id

This rule enforces writing Construct IDs in PascalCase.

Enforcing a consistent naming convention helps developers manage logical IDs more easily, and as a result, helps reduce the risk of unintentional logical ID collisions.

***

#### 🔧 How to use

::: code-group

```ts [Oxlint]
// oxlint.config.ts
export default defineConfig({
  // ... some configs
  rules: {
    "awscdk/pascal-case-construct-id": "error",
  },
});
```

```js [ESLint]
// eslint.config.mjs
export default defineConfig({
  // ... some configs
  rules: {
    "awscdk/pascal-case-construct-id": "error",
  },
});
```

:::

#### ✅ Correct Example

```ts
import { Bucket } from "aws-cdk-lib/aws-s3";

// ✅ Can use PascalCase
const bucket = new Bucket(this, "MyBucket");
```

#### ❌ Incorrect Example

```ts
import { Bucket } from "aws-cdk-lib/aws-s3";

// ❌ Shouldn't use camelCase
const bucket = new Bucket(this, "myBucket");

// ❌ Shouldn't use snake_case
const bucket = new Bucket(this, "my_bucket");

// ❌ Shouldn't use kebab-case
const bucket = new Bucket(this, "my-bucket");
```
