Skip to content

Commit 52fc856

Browse files
authored
Enable eslint rule array-type with default 'array' (#91)
1 parent 4053841 commit 52fc856

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

.changeset/friendly-kids-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Enable eslint rule array-type with default 'array'

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
66
"rules": {
77
"simple-import-sort/imports": "error",
8-
"simple-import-sort/exports": "error"
8+
"simple-import-sort/exports": "error",
9+
"@typescript-eslint/array-type": ["error", { "default": "array" }]
910
},
1011
"ignorePatterns": ["__fixtures__"]
1112
}

src/transforms/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export type PositionalOptionsType = "boolean" | "number" | "string";
22

33
export interface AwsSdkJsCodemodTransformOption {
44
/** array of values, limit valid option arguments to a predefined set */
5-
choices?: ReadonlyArray<boolean> | ReadonlyArray<number> | ReadonlyArray<string>;
5+
choices?: readonly boolean[] | readonly number[] | readonly string[];
66

77
/** value, set a default value for the option */
88
default?: boolean | number | string;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const getMergedArrayWithoutDuplicates = <T>(arr1: Array<T>, arr2: Array<T>) =>
1+
export const getMergedArrayWithoutDuplicates = <T>(arr1: T[], arr2: T[]) =>
22
arr1.concat(arr2.filter((arr2Item) => arr1.indexOf(arr2Item) < 0));

src/transforms/v2-to-v3/utils/getV2ClientNames.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const getV2ClientNames = (
1111
j: JSCodeshift,
1212
source: Collection<any>,
1313
{ v2DefaultModuleName, v2ClientModuleNames }: GetV2ClientNamesOptions
14-
): Array<string> => {
14+
): string[] => {
1515
const v2ClientNamesFromDefaultModule = source
1616
.find(j.NewExpression, {
1717
callee: {

0 commit comments

Comments
 (0)