Skip to content

Commit

Permalink
chore: eslint related cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonoh committed Dec 8, 2021
1 parent 3ee4969 commit a65277e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rules:

# eslint-plugin-unused-imports
'@typescript-eslint/no-unused-vars': off
'@typescript-eslint/no-explicit-any': off
unused-imports/no-unused-imports-ts: error
unused-imports/no-unused-vars-ts:
- warn
Expand Down
1 change: 0 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
} from './module';

// https://github.com/yargs/yargs/issues/1519
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-explicit-any
(process.stdout as any)._handle.setBlocking(true);

export const main = (argvInput?: string[]): Promise<void> =>
Expand Down
2 changes: 0 additions & 2 deletions src/lib/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class Ec2SpotPriceError extends Error {

readonly ec2SpotPriceError = true;

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
static isEc2SpotPriceError(error: any): error is Ec2SpotPriceError {
return !!error.ec2SpotPriceError;
}
Expand All @@ -73,7 +72,6 @@ export class Ec2SpotPriceError extends Error {
readonly code: string;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export const isAWSError = (error: any): error is AWSError => !!error.code;

const getEc2SpotPrice = async (options: {
Expand Down
7 changes: 4 additions & 3 deletions src/lib/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import {
import { ui } from './ui';

const getFamilySize = (family: string[]): string[] => {
const instanceFamilyCopy: Record<string, string[]> = Object.fromEntries(
Object.entries(instanceFamily).map(([k, v]) => [k, [...v]]),
);
const types = Object.keys(instanceFamily).reduce((list, f) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
if (family.includes(f)) return list.concat(instanceFamily[f] as string[]);
if (family.includes(f)) return list.concat(instanceFamilyCopy[f] as string[]);
return list;
}, [] as string[]);
const instances = allInstances.filter(i => types.includes(i.split('.').shift() as string));
Expand Down
1 change: 0 additions & 1 deletion test/mock-credential-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const mockAwsCredentials = (
config.credentials = null;

const mock = (): void => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
readFileSyncMock = jest.spyOn(fs, 'readFileSync').mockImplementation((...args: any) => {
const path = args[0] as string;
if (!path.includes(`${sep}.aws${sep}`)) {
Expand Down
4 changes: 1 addition & 3 deletions test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export const consoleMockCallJoin = (type: 'log' | 'warn' | 'error' = 'log'): string => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const { calls }: { calls: string[][] } = console[type].mock;
const { calls }: { calls: string[][] } = (console[type] as any).mock;
if (calls) return calls.map(sa => sa.join(' ')).join('\n');
return '';
};

0 comments on commit a65277e

Please sign in to comment.