-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
blocked by external APIBlocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship APIBlocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship APIenhancementNew feature or requestNew feature or requestpackage: utilsIssues related to the @typescript-eslint/utils packageIssues related to the @typescript-eslint/utils packagerepo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs
Description
Suggestion
Right now, if a rule is created through util.createRule
with defaultOptions
, the create
function's second parameter is an array whose first element is still Options | undefined
. That means folks have to !
. For example, in #5327:
typescript-eslint/packages/eslint-plugin/src/rules/lines-around-comment.ts
Lines 136 to 137 in 7f2661f
create(context, [_options]) { | |
const options = _options!; |
Unless I've grossly misinterpreted the rule options, those !
should be unnecessary, right?
Edit: here's a TypeScript playground with an isolated repro.
Metadata
Metadata
Assignees
Labels
blocked by external APIBlocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship APIBlocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship APIenhancementNew feature or requestNew feature or requestpackage: utilsIssues related to the @typescript-eslint/utils packageIssues related to the @typescript-eslint/utils packagerepo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs