Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-33938

Correct implicit coercions in relational operators to adopt typescript 5.0

    XMLWordPrintableJSON

Details

    Description

      Since TypeScript 5.0, there is a break change that implicit coercions in relational operators are forbidden [1].

      So that the following code in flink-runtime-web/web-dashboard/src/app/components/humanize-date.pipe.ts get error:

      public transform(
        value: number | string | Date,
        ...
      ): string | null | undefined {
        if (value == null || value === '' || value !== value || value < 0) {
          return '-';
        } 
        ...
      }

      The correctness improvement is availble in here [2].

      I think we should optimize this type of code for better compatibility.

       

      [1] https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#forbidden-implicit-coercions-in-relational-operators

      [2] https://github.com/microsoft/TypeScript/pull/52048

      Attachments

        Issue Links

          Activity

            People

              laffery Ao Yuchen
              laffery Ao Yuchen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: