A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/typescript-eslint/typescript-eslint/issues/5439 below:

Rule [options] parameter should be non-nullable if defaultOptions exists · Issue #5439 · typescript-eslint/typescript-eslint · GitHub

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4