Skip to content

Conversation

@siddsriv
Copy link
Contributor

@siddsriv siddsriv commented May 16, 2024

Description

introduces a new eslint rule to enforce consistent type imports using the import type syntax.

running eslint with the --fix flag will enforce this rule and modify your file according to the consistent type imports eslint rule.

Testing

as an example:

import { S3Client, PutObjectCommand, PutObjectCommandInput } from "@aws-sdk/client-s3";

upon running eslint on this file, it would throw:

1:1  error  Import "PutObjectCommandInput" is only used as types  

this should be written as so (can be done by running eslint with the --fix flag):

import type { PutObjectCommandInput } from "@aws-sdk/client-s3";
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";

For this repo,

% npx eslint lib      
.
.
.
✖ 8 problems (0 errors, 8 warnings)

and,

% npx eslint packages
.
.
.
✖ 188 problems (0 errors, 188 warnings)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@siddsriv siddsriv requested a review from a team as a code owner May 16, 2024 15:44
@kuhe
Copy link
Contributor

kuhe commented Oct 29, 2025

will add this in a different PR scoped to only our handwritten packages to start

@kuhe kuhe closed this Oct 29, 2025
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants