Skip to content

Conversation

@le-cong
Copy link
Contributor

@le-cong le-cong commented Sep 30, 2025

Fixes #132

@le-cong le-cong self-assigned this Sep 30, 2025
Copilot AI review requested due to automatic review settings September 30, 2025 14:30
@le-cong le-cong added the MINOR label Sep 30, 2025
Copy link

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 adds a new ESLint rule called 'require-aws-config' that enforces the use of @checkdigit/aws-config when working with AWS SDK v3 clients instead of instantiating them directly.

  • Implements a new ESLint rule to detect direct AWS client instantiation
  • Adds utility function to detect AWS SDK v3 usage in projects
  • Integrates the rule into the existing ESLint configuration system

Reviewed Changes

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

Show a summary per file
File Description
src/require-aws-config.ts Main rule implementation that detects new *Client() patterns
src/require-aws-config.spec.ts Test cases covering valid and invalid usage scenarios
src/is-aws-sdk-v3-used.ts Utility to determine if AWS SDK v3 is used in the project
src/index.ts Integration of the new rule into the plugin's rule registry
eslint.config.mjs Configuration to enable AWS SDK v3 detection
docs/rules/require-aws-config.md Documentation with usage examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings September 30, 2025 19:11
Copy link

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

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 1, 2025 01:50
Copy link

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

Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@le-cong le-cong requested review from carlansley and jpolavar October 1, 2025 18:41
defaultOptions: [],
create(context) {
return {
ImportDeclaration(node) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have check for imports of checkdigit/aws and report as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, will add the check.

Copilot AI review requested due to automatic review settings October 2, 2025 17:07
Copy link

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

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jpolavar jpolavar self-requested a review October 2, 2025 18:06
import requireAssertMessage from './require-assert-message';
import requireTsExtensionImportsExports from './require-ts-extension-imports-exports.ts';

export { default as isAwsSdkV3Used } from './is-aws-sdk-v3-used.ts';
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to export?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it's needed for eslint-config to call asynchronously and put into settings as part of the rule configuration

Copy link
Contributor

Choose a reason for hiding this comment

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

isAwsSdkV3Used directly imported from ./src/is-aws-sdk-v3-used.ts in the eslint.config.mjs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed since it's not applicable for rules themselves

Copy link
Contributor

@jpolavar jpolavar left a comment

Choose a reason for hiding this comment

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

lftm

Copilot AI review requested due to automatic review settings October 3, 2025 23:37
Copy link

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

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Oct 3, 2025

❌ PR review status - has 1 reviewer outstanding

@carlansley
Copy link
Contributor

@le-cong I've re-enabled the CodeQL action but you might need to do another commit to pass the check

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Beta Published - Install Command: npm install @checkdigit/eslint-plugin@7.15.0-PR.134-bf92

@le-cong le-cong requested a review from jpolavar October 6, 2025 18:52
Copy link
Contributor

@jpolavar jpolavar left a comment

Choose a reason for hiding this comment

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

lftm

@le-cong le-cong merged commit 01a71da into main Oct 6, 2025
9 checks passed
@le-cong le-cong deleted the aws-config branch October 6, 2025 20:48
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.

make sure aws-config is applied to aws client for aws-sdk v3 updates

4 participants