Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@checkdigit/eslint-plugin",
"version": "7.17.0",
"version": "7.17.1",
"description": "Check Digit eslint plugins",
"keywords": [
"eslint",
Expand Down
6 changes: 6 additions & 0 deletions src/aws/require-aws-bare-bones.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ createTester().run(ruleId, rule, {
{
code: `import { type UploadOptions } from '@aws-sdk/lib-storage';`,
},
{
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.
{
code: `import { S3Client, type S3 } from '@aws-sdk/client-s3';`,
},
],
invalid: [
{
Expand Down
12 changes: 5 additions & 7 deletions src/aws/require-aws-bare-bones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import getDocumentationUrl from '../get-documentation-url.ts';
export const ruleId = 'require-aws-bare-bones';
export const MESSAGE_ID_AGGREGATED_CLIENT = 'noAggregatedClient';

const BARE_BONES_SUFFIXES = new Set(['Client', 'Command', 'Exception', 'Input', 'Output']);
const AWS_LIB_AGGREGATED_SUFFIXES = new Set(['Document', 'Paginator', 'Utils', 'Service', 'Collection', 'Manager']);
const BARE_BONES_SUFFIXES = ['Client', 'Command', 'Exception', 'Input', 'Output'];
const AWS_LIB_AGGREGATED_SUFFIXES = ['Document', 'Paginator', 'Utils', 'Service', 'Collection', 'Manager'];
const AWS_SDK_CLIENT = '@aws-sdk/client-';
const AWS_SDK_LIB = '@aws-sdk/lib-';

Expand All @@ -22,7 +22,7 @@ const kebabToPascal = (str: string): string =>
.map((item) => item.charAt(0).toUpperCase() + item.slice(1))
.join('');

const endsWithAnySuffix = (name: string, suffixes: Set<string>): boolean => {
const endsWithAnySuffix = (name: string, suffixes: string[]): boolean => {
for (const suffix of suffixes) {
if (name.endsWith(suffix)) {
return true;
Expand Down Expand Up @@ -64,16 +64,14 @@ const rule: ESLintUtils.RuleModule<typeof MESSAGE_ID_AGGREGATED_CLIENT> = create
create(context) {
return {
ImportDeclaration(node) {
if (!isAwsSdkClientModule(node)) {
if (node.importKind === 'type' || !isAwsSdkClientModule(node)) {
return;
}

for (const specifier of node.specifiers) {
const isTypeImport = specifier.type === AST_NODE_TYPES.ImportSpecifier && specifier.importKind === 'type';

if (
specifier.type === AST_NODE_TYPES.ImportSpecifier &&
!isTypeImport &&
specifier.importKind !== 'type' &&
isAggregatedClient(specifier.local.name, node.source.value)
) {
context.report({
Expand Down
Loading