Repo: Rule [options] parameter should be non-nullable if defaultOptions exists #5439
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
blocked by another PR
PRs which are ready to go but waiting on another PR
repo maintenance
things to do with maintenance of the repo, and not with code/docs
Milestone
Suggestion
Right now, if a rule is created through
util.createRule
withdefaultOptions
, thecreate
function's second parameter is an array whose first element is stillOptions | 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
Unless I've grossly misinterpreted the rule options, those
!
should be unnecessary, right?Edit: here's a TypeScript playground with an isolated repro.
The text was updated successfully, but these errors were encountered: