Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Mar 1, 2024
1 parent abe08dc commit c36755d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/cmds/versions/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export interface Options extends CommonOptions {
}

export interface CommonOptions {
beta?: 'true' | 'false';
beta?: 'false' | 'true';
codename?: string;
deprecated?: 'true' | 'false';
hidden?: 'true' | 'false';
main?: 'true' | 'false';
deprecated?: 'false' | 'true';
hidden?: 'false' | 'true';
main?: 'false' | 'true';
}

export default class CreateVersionCommand extends Command {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function rdme(rawProcessArgv: NodeJS.Process['argv']) {
}

try {
let cmdArgv: CommandOptions | CommandLineOptions;
let cmdArgv: CommandLineOptions | CommandOptions;
let bin: Command;

// Handling for `rdme help` and `rdme help <command>` cases.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/apiError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export interface APIErrorResponse {
export default class APIError extends Error {
code: string;

constructor(res: string | APIErrorResponse | { error: APIErrorResponse }) {
let err: string | APIErrorResponse;
constructor(res: APIErrorResponse | string | { error: APIErrorResponse }) {
let err: APIErrorResponse | string;

// Special handling to for fetch `res` arguments where `res.error` will contain our API error
// response.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/baseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import isCI from './isCI.js';
import { debug, info, warn } from './logger.js';
import loginFlow from './loginFlow.js';

export type CommandOptions<T = {}> = ZeroAuthCommandOptions<T> | AuthenticatedCommandOptions<T>;
export type CommandOptions<T = {}> = AuthenticatedCommandOptions<T> | ZeroAuthCommandOptions<T>;

export type AuthenticatedCommandOptions<T = {}> = Omit<ZeroAuthCommandOptions<T>, 'key'> & {
key: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/castStringOptToBool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Options as UpdateOptions } from '../cmds/versions/update.js';
* and casts it to a boolean.
*/
export default function castStringOptToBool(
opt: 'true' | 'false' | undefined,
opt: 'false' | 'true' | undefined,
optName: keyof CreateOptions | keyof UpdateOptions,
) {
if (!opt) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/prepareOas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import readdirRecursive from './readdirRecursive.js';

export type SpecFileType = OASNormalize['type'];

type SpecType = 'OpenAPI' | 'Swagger' | 'Postman';
type SpecType = 'OpenAPI' | 'Postman' | 'Swagger';

interface FoundSpecFile {
/** path to the spec file */
Expand All @@ -30,7 +30,7 @@ interface FileSelection {
}

// source: https://stackoverflow.com/a/58110124
type Truthy<T> = T extends false | '' | 0 | null | undefined ? never : T;
type Truthy<T> = T extends '' | 0 | false | null | undefined ? never : T;

function truthy<T>(value: T): value is Truthy<T> {
return !!value;
Expand All @@ -49,7 +49,7 @@ const capitalizeSpecType = (type: string) =>
*/
export default async function prepareOas(
path: string | undefined,
command: 'openapi' | 'openapi:convert' | 'openapi:inspect' | 'openapi:reduce' | 'openapi:validate',
command: 'openapi:convert' | 'openapi:inspect' | 'openapi:reduce' | 'openapi:validate' | 'openapi',
opts: {
/**
* Optionally convert the supplied or discovered API definition to the latest OpenAPI release.
Expand Down

0 comments on commit c36755d

Please sign in to comment.