Skip to content

Commit

Permalink
Disables rule @typescript-eslint/no-non-null-assertion
Browse files Browse the repository at this point in the history
- Cleans-up code on `help.ts` that was affected by the rule.
  • Loading branch information
andreban committed Jan 30, 2020
1 parent e339453 commit 7f2784c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
],
"rules": {
"@typescript-eslint/no-non-null-assertion": 0
}
}
]
}
9 changes: 2 additions & 7 deletions src/cli/cmds/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ export async function help(args: ParsedArgs, log = new Log('help')): Promise<voi
const command = args._[1];
const message = HELP_MESSAGES.get(command) || HELP_MESSAGES.get('main');

// Should never happen, as we know we have a message for main,
// but TypeScript doesn't know it.
if (message === undefined) {
log.error(`Could not find help message for args: ${args}`);
return;
}
log.info(message);
// We know we have a message for 'main', in case the command is invalid.
log.info(message!);
return;
}

1 comment on commit 7f2784c

@fcsan88
Copy link

Choose a reason for hiding this comment

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

.eslintrc.json #618 #667

Please sign in to comment.