Project

General

Profile

Feature #43525

mgr/dashboard: Enable compiler options used by Angular --strict flag

Added by Tiago Melo 9 months ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
dashboard/general
Target version:
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Recently Angular added a new flag to the "ng new" command, that adds 5 new typescript compiler options.
They add more strict rules that help the code to be more readable and less prone to errors.

The PR can be found here: https://github.com/angular/angular-cli/pull/14905

Rules added:
noImplicitAny - https://basarat.gitbooks.io/typescript/docs/options/noImplicitAny.html
noImplicitReturns - https://lucidchart.com/techblog/2018/06/20/how-to-actually-improve-type-safety-with-the-typescript-strict-flags/
noImplicitThis - https://logicbig.com/tutorials/misc/typescript/no-implicit-this.html
noFallthroughCasesInSwitch - https://typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html
strictNullChecks - https://typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html

I would suggest to postpone strictNullChecks until we start using TS 3.7, since it introduces Optional Chaining and Assertion Functions [1], and I think that would simplify a lot the code.

Source: https://twitter.com/aaronfrost/status/1204820861573709824

[1] https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html

History

#1 Updated by Tiago Melo 9 months ago

  • Status changed from New to In Progress
  • Pull request ID set to 32553

#2 Updated by Tiago Melo 7 months ago

  • Status changed from In Progress to Resolved
  • Target version set to v15.0.0

Also available in: Atom PDF