Skip to content

Fixed type-only import for bare-bone pattern#140

Merged
jpolavar merged 4 commits intomainfrom
skip-barebone-check-types-imports
Dec 30, 2025
Merged

Fixed type-only import for bare-bone pattern#140
jpolavar merged 4 commits intomainfrom
skip-barebone-check-types-imports

Conversation

@jpolavar
Copy link
Copy Markdown
Contributor

Closes #139

@jpolavar jpolavar self-assigned this Nov 24, 2025
Copilot AI review requested due to automatic review settings November 24, 2025 21:11
@jpolavar jpolavar added the PATCH label Nov 24, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the handling of type-only imports in the require-aws-bare-bones ESLint rule. The rule now correctly ignores declaration-level type imports (import type { ... }) from AWS SDK packages.

Key changes:

  • Added check for declaration-level type imports (node.importKind === 'type')
  • Refactored suffix arrays from Set<string> to string[] for simplicity
  • Removed per-specifier type import check
  • Added test case for declaration-level type imports

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/aws/require-aws-bare-bones.ts Added declaration-level type import check and simplified suffix data structures
src/aws/require-aws-bare-bones.spec.ts Added test case for import type syntax
package.json Version bump from 7.17.0 to 7.17.1
package-lock.json Lockfile version update to match package.json

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
{
code: `import type { Credentials } from '@aws-sdk/client-sts';`,
},
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only: true flag should be removed. This flag is typically used during development to run only a specific test, but should not be committed to the codebase as it will cause all other tests to be skipped.

Copilot uses AI. Check for mistakes.
Comment thread src/aws/require-aws-bare-bones.ts
@jpolavar jpolavar requested a review from le-cong November 24, 2025 21:43
@github-actions
Copy link
Copy Markdown

Beta Published - Install Command: npm install @checkdigit/eslint-plugin@7.17.1-PR.140-f1f3

@jpolavar
Copy link
Copy Markdown
Contributor Author

Tested in local services

@jpolavar jpolavar requested review from carlansley and le-cong and removed request for le-cong November 25, 2025 21:19
@github-actions
Copy link
Copy Markdown

❌ PR review status - has 1 reviewer outstanding

Copy link
Copy Markdown
Contributor

@le-cong le-cong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lftm

@jpolavar jpolavar merged commit f142c15 into main Dec 30, 2025
9 of 10 checks passed
@jpolavar jpolavar deleted the skip-barebone-check-types-imports branch December 30, 2025 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip check for bare-bone pattern on type-only import

4 participants