Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Repro
{"rules": {"@typescript-eslint/prefer-optional-chain": ["error"] }}
declareconsta:{b:string|null}|null;a!==null&&a.b!==null&&a.b.length>0;/*^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer using an optional chain expression instead, as it's more concise and easier to read.*/
Expected Result
a?.b!=null&&a.b.length>0;
Actual Result
a?.b!==null&&a.b.length>0;/* ^ Object is possibly 'null'.*/
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 2.15.0 |
@typescript-eslint/parser | 2.15.0 |
TypeScript | 3.7.3 |
ESLint | 6.1.0 |
node | 10.16.0 |
npm | 6.9.0 |