msg) // Object is possibly 'undefined'.ts(2532) // Works but feels like there should be an easier way // console.log((this.mySignal$() as { msg: string }).msg) } }); } } 相关安装的软件包 "@angular-eslint/eslint-plugin": "16.0.3" "@angular-eslint/eslint-plugin-template...
never: 'Unnecessary conditional, value is `never`.', neverNullish: 'Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined.', @@ -397,19 +468,6 @@ export default createRule<Options, MessageId>({ * - https://github.com/microsoft/TypeScript/...
const result1 = foo() === undefined; const result2 = foo() == null; `, ` declare const bigInt: 0n | 1n; if (bigInt) { } `, necessaryConditionTest('false | 5'), // Truthy literal and falsy literal necessaryConditionTest('boolean | "foo"'), // boolean and truthy literal ...
and it is not impossible to follow, but a bit difficult. AddedforceRequireReturnoption to ensure return type considered even ifvoid/undefinedand addedcontexts: ['any']so it checks virtual functions (e.g., with@implements).
/*eslint no-throw-literal: "error"*//*eslint-env es6*/throw"error";throw0;throwundefined;thrownull;varerr=newError();throw"an "+err;// err is recast to a string literalvarerr=newError();throw`${err}` Examples ofcorrectcode for this rule: ...
no-useless-undefined - I don't like the consequence of changing array-callback-return to allowImplicit, and it can make clear that use of undefined is deliberate. prefer-array-flat - Present in array-func prefer-array-flat-map - Present in array-func prefer-at - Not widely available prefe...
Fixedglobal.performance in undefined when starting metro from Expo CLI (0ccbd65581 by @Kudo) Re-enabled debugging for debug builds (41477c898c by Matt Blagden) Add global hook to assert that base Metro config is called (29f2602ff9 by @huntie)Android specific...
never: 'Unnecessary conditional, value is `never`.', neverNullish: 'Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined.', @@ -489,8 +489,11 @@ export default createRule<Options, MessageId>({ context.report({ node, messageId: 'literal...
the context object because it allowed greater flexibility -- it gives you the option to see BOTH the user's actual config and the merged config -- which can sometimes be useful if you want to act differently when a user skipped an option but also avoid having undefineds around the place....
allowUnusedVoidOrUndefinedValues = false, ): void { Member JoshuaKGoldberg Dec 14, 2024 [Style] This is totally optional and if you don't like it I won't be upset at all 😄, but: I found this function to be a lot to read through. It's essentially a set of individual cases...