Conversation

JoshuaKGoldberg

Similar to // @ts-ignore, but will itself cause a new error diagnostic if it does not cause an existing diagnostic to be ignored.

Technical summary:

  1. The scanner will now keep track of CommentDirectives it comes across: both @ts-expect-error and @ts-ignore
  2. During type checking, the program will turn those directives into a map keying them by line number
  3. For each diagnostic, if it's preceded by a directive, that directive is marked as "used"
  4. All @ts-expect-error directives not marked as used generate a new diagnostic error

Fixes #29394

Similar to `// @ts-ignore`, but will itself cause a new error diagnostic if it does not cause an existing diagnostic to be ignored.

Technical summary:
1. The scanner will now keep track of `CommentDirective`s it comes across: both `@ts-expect-error` and `@ts-ignore`
2. During type checking, the program will turn those directives into a map keying them by line number
3. For each diagnostic, if it's preceded by a directive, that directive is marked as "used"
4. All `@ts-expect-error` directives not marked as used generate a new diagnostic error
@orta

I'd like to try this in a playground:

@typescript-bot perf test
@typescript-bot pack this

@typescript-bot

Heya @orta, I've started to run the perf test suite on this PR at eb5610a. You can monitor the build here. It should now contribute to this PR's status checks.

Update: The results are in!

@typescript-bot

Heya @orta, I've started to run the tarball bundle task on this PR at eb5610a. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

@orta
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..36014

Metricmaster36014DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used355,734k (± 0.01%)356,812k (± 0.02%)+1,078k (+ 0.30%)356,627k356,970k
Parse Time1.60s (± 0.37%)1.63s (± 0.59%)+0.02s (+ 1.50%)1.61s1.65s
Bind Time0.87s (± 0.66%)0.88s (± 0.66%)+0.01s (+ 1.15%)0.87s0.90s
Check Time4.58s (± 0.50%)4.58s (± 0.63%)-0.00s (- 0.02%)4.49s4.64s
Emit Time5.25s (± 0.56%)5.27s (± 0.62%)+0.02s (+ 0.42%)5.16s5.32s
Total Time12.31s (± 0.36%)12.37s (± 0.49%)+0.06s (+ 0.45%)12.14s12.43s
Monaco - node (v10.16.3, x64)
Memory used364,273k (± 0.01%)366,643k (± 0.01%)+2,369k (+ 0.65%)366,557k366,739k
Parse Time1.25s (± 0.52%)1.27s (± 0.59%)+0.01s (+ 1.20%)1.25s1.28s
Bind Time0.76s (± 0.48%)0.76s (± 0.65%)+0.00s (+ 0.13%)0.76s0.78s
Check Time4.62s (± 0.38%)4.73s (± 0.51%)+0.11s (+ 2.40%)4.67s4.78s
Emit Time2.94s (± 0.68%)2.96s (± 0.71%)+0.01s (+ 0.48%)2.91s3.01s
Total Time9.58s (± 0.39%)9.72s (± 0.42%)+0.14s (+ 1.45%)9.63s9.81s
TFS - node (v10.16.3, x64)
Memory used323,439k (± 0.02%)322,400k (± 0.02%)-1,038k (- 0.32%)322,272k322,517k
Parse Time0.95s (± 0.38%)0.97s (± 0.77%)+0.02s (+ 2.22%)0.95s0.99s
Bind Time0.74s (± 0.92%)0.74s (± 1.50%)+0.00s (+ 0.14%)0.72s0.76s
Check Time4.16s (± 0.55%)4.19s (± 0.61%)+0.03s (+ 0.79%)4.16s4.26s
Emit Time3.02s (± 0.96%)3.04s (± 0.88%)+0.02s (+ 0.56%)2.96s3.08s
Total Time8.87s (± 0.46%)8.94s (± 0.49%)+0.07s (+ 0.83%)8.84s9.02s
Angular - node (v12.1.0, x64)
Memory used331,474k (± 0.03%)332,501k (± 0.02%)+1,027k (+ 0.31%)332,355k332,624k
Parse Time1.56s (± 0.61%)1.57s (± 0.76%)+0.02s (+ 1.03%)1.54s1.60s
Bind Time0.85s (± 0.97%)0.87s (± 0.56%)+0.02s (+ 2.34%)0.86s0.88s
Check Time4.51s (± 0.66%)4.49s (± 0.42%)-0.03s (- 0.60%)4.45s4.52s
Emit Time5.45s (± 0.56%)5.47s (± 0.49%)+0.02s (+ 0.42%)5.42s5.54s
Total Time12.38s (± 0.35%)12.41s (± 0.30%)+0.03s (+ 0.26%)12.34s12.50s
Monaco - node (v12.1.0, x64)
Memory used344,024k (± 0.02%)346,450k (± 0.02%)+2,426k (+ 0.71%)346,315k346,645k
Parse Time1.22s (± 0.64%)1.23s (± 0.87%)+0.01s (+ 0.66%)1.21s1.25s
Bind Time0.73s (± 0.67%)0.74s (± 1.93%)+0.00s (+ 0.14%)0.72s0.79s
Check Time4.47s (± 0.36%)4.58s (± 0.52%)+0.10s (+ 2.35%)4.53s4.63s
Emit Time3.00s (± 0.79%)3.00s (± 0.73%)-0.00s (- 0.07%)2.96s3.05s
Total Time9.43s (± 0.34%)9.55s (± 0.49%)+0.12s (+ 1.23%)9.44s9.62s
TFS - node (v12.1.0, x64)
Memory used305,732k (± 0.02%)304,692k (± 0.02%)-1,040k (- 0.34%)304,587k304,823k
Parse Time0.95s (± 0.50%)0.95s (± 0.91%)+0.00s (+ 0.11%)0.93s0.97s
Bind Time0.69s (± 0.80%)0.69s (± 0.68%)-0.00s (- 0.29%)0.68s0.70s
Check Time4.12s (± 0.23%)4.14s (± 0.56%)+0.02s (+ 0.58%)4.06s4.17s
Emit Time3.10s (± 1.15%)3.07s (± 0.83%)-0.03s (- 0.94%)3.01s3.13s
Total Time8.86s (± 0.51%)8.85s (± 0.46%)-0.01s (- 0.08%)8.76s8.93s
Angular - node (v8.9.0, x64)
Memory used350,684k (± 0.01%)351,726k (± 0.01%)+1,042k (+ 0.30%)351,662k351,811k
Parse Time2.09s (± 0.47%)2.12s (± 0.78%)+0.03s (+ 1.53%)2.09s2.16s
Bind Time0.91s (± 0.73%)0.92s (± 1.09%)+0.01s (+ 1.20%)0.89s0.94s
Check Time5.38s (± 0.63%)5.34s (± 0.73%)-0.04s (- 0.71%)5.24s5.45s
Emit Time6.27s (± 0.96%)6.27s (± 0.83%)+0.00s (+ 0.06%)6.20s6.38s
Total Time14.66s (± 0.61%)14.67s (± 0.61%)+0.01s (+ 0.07%)14.44s14.83s
Monaco - node (v8.9.0, x64)
Memory used362,452k (± 0.02%)364,715k (± 0.01%)+2,263k (+ 0.62%)364,632k364,748k
Parse Time1.57s (± 0.49%)1.57s (± 0.22%)-0.00s (- 0.13%)1.56s1.57s
Bind Time0.96s (± 1.15%)0.94s (± 0.81%)-0.01s (- 1.25%)0.93s0.96s
Check Time5.28s (± 1.23%)5.45s (± 1.55%)+0.17s (+ 3.28%)5.28s5.61s
Emit Time3.43s (± 3.12%)3.30s (± 4.55%)-0.14s (- 4.02%)3.02s3.49s
Total Time11.24s (± 0.71%)11.26s (± 0.81%)+0.02s (+ 0.19%)11.06s11.43s
TFS - node (v8.9.0, x64)
Memory used322,674k (± 0.01%)321,606k (± 0.01%)-1,068k (- 0.33%)321,536k321,710k
Parse Time1.27s (± 0.54%)1.27s (± 0.51%)+0.00s (+ 0.16%)1.25s1.28s
Bind Time0.75s (± 0.91%)0.75s (± 0.63%)-0.00s (- 0.66%)0.74s0.76s
Check Time4.79s (± 0.47%)4.76s (± 0.54%)-0.03s (- 0.61%)4.71s4.81s
Emit Time3.22s (± 0.50%)3.22s (± 0.43%)-0.00s (- 0.03%)3.19s3.25s
Total Time10.04s (± 0.37%)10.00s (± 0.37%)-0.03s (- 0.35%)9.93s10.07s
Angular - node (v8.9.0, x86)
Memory used199,273k (± 0.02%)199,831k (± 0.04%)+558k (+ 0.28%)199,676k200,047k
Parse Time2.01s (± 0.64%)2.04s (± 0.52%)+0.03s (+ 1.59%)2.03s2.08s
Bind Time1.03s (± 0.35%)1.03s (± 0.58%)0.00s ( 0.00%)1.01s1.04s
Check Time4.89s (± 0.60%)4.87s (± 0.33%)-0.02s (- 0.43%)4.83s4.91s
Emit Time6.10s (± 1.93%)6.16s (± 1.25%)+0.06s (+ 1.00%)6.01s6.32s
Total Time14.03s (± 0.97%)14.10s (± 0.54%)+0.07s (+ 0.53%)13.96s14.27s
Monaco - node (v8.9.0, x86)
Memory used203,369k (± 0.02%)204,511k (± 0.01%)+1,141k (+ 0.56%)204,463k204,576k
Parse Time1.60s (± 0.35%)1.61s (± 0.72%)+0.01s (+ 0.56%)1.59s1.63s
Bind Time0.76s (± 1.35%)0.76s (± 0.77%)-0.00s (- 0.26%)0.74s0.77s
Check Time5.08s (± 1.78%)5.45s (± 1.22%)+0.36s (+ 7.14%)5.22s5.57s
Emit Time3.21s (± 2.34%)2.90s (± 3.30%)-0.31s (- 9.66%)2.83s3.28s
Total Time10.65s (± 0.33%)10.71s (± 0.56%)+0.06s (+ 0.57%)10.59s10.87s
TFS - node (v8.9.0, x86)
Memory used182,089k (± 0.02%)181,473k (± 0.02%)-616k (- 0.34%)181,416k181,569k
Parse Time1.30s (± 0.96%)1.32s (± 0.72%)+0.02s (+ 1.23%)1.30s1.34s
Bind Time0.71s (± 1.60%)0.71s (± 1.32%)-0.00s (- 0.28%)0.70s0.74s
Check Time4.52s (± 0.78%)4.54s (± 1.01%)+0.03s (+ 0.58%)4.46s4.68s
Emit Time2.99s (± 0.76%)3.01s (± 1.58%)+0.02s (+ 0.74%)2.96s3.18s
Total Time9.52s (± 0.55%)9.58s (± 0.85%)+0.06s (+ 0.68%)9.45s9.79s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory5 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
BenchmarkNameIterations
Current3601410
Baselinemaster10

@JoshuaKGoldberg

Re that On-Demand Benchmark test failure: Monaco check time went up 7.14% (line link). but emit time decreased by almost as much (31s out of 36s), and the total time went up only by 0.57%:

│ Monaco - node (v8.9.0, x86)                                                                     │
├─────────────┬────────────────────┬────────────────────┬───────────────────┬──────────┬──────────┤
│ Memory used │ 203,369k (± 0.02%) │ 204,511k (± 0.01%) │ +1,141k (+ 0.56%) │ 204,463k │ 204,576k │
│ Parse Time  │    1.60s (± 0.35%) │    1.61s (± 0.72%) │  +0.01s (+ 0.56%) │    1.59s │    1.63s │
│ Bind Time   │    0.76s (± 1.35%) │    0.76s (± 0.77%) │  -0.00s (- 0.26%) │    0.74s │    0.77s │
│ Check Time  │    5.08s (± 1.78%) │    5.45s (± 1.22%) │  +0.36s (+ 7.14%) │    5.22s │    5.57s │
│ Emit Time   │    3.21s (± 2.34%) │    2.90s (± 3.30%) │  -0.31s (- 9.66%) │    2.83s │    3.28s │
├─────────────┼────────────────────┼────────────────────┼───────────────────┼──────────┼──────────┤
│ Total Time  │   10.65s (± 0.33%) │   10.71s (± 0.56%) │  +0.06s (+ 0.57%) │   10.59s │   10.87s │

...so this feels like it's not a serious performance degradation, and this PR is still valid? 😁

@davidgomes

This is great!

@JoshuaKGoldberg I've also been toying around with implementing this. However, I was making @ts-ignore and @ts-expect-error pragmas instead of adding a new concept (Comment Directive).

I added the @ts-expect-error as a new pragma (and was going to add @ts-ignore too):

        "ts-expect-error": {
            kind: PragmaKindFlags.AnySingleLine
        }

And then I parse it in processCommentPragmas in parser.ts:

        iterateAllCommentRanges(sourceText, (range) => {
            const comment = sourceText.substring(range.pos, range.end);
            extractPragmas(pragmas, range, comment, PragmaKindFlags.AnySingleLine);
        });

(iterateAllCommentRanges is a new function I added to scanner.ts)

While I couldn't find a formal definition of "pragmas" in programming languages, in some programming languages, a "pragma" can be in places other than just the top of the file (https://dlang.org/spec/pragma.html).

Here's my in progress diff: https://gist..com/davidgomes/5cb71342b6d2cf95ffa05a767eb802c7

@rauschma

I’d love to have something more powerful:

//@ts-expect-error 2322 "Type 'number' is not assignable to type 'never'."

Maybe with the option to omit trailing characters of the message and/or the error number. The former could be achieved via regular expressions:

//@ts-expect-error 2322 /^Type 'number' is not assignable to type 'never'\.$/

Rationale: It’s not only a problem to expect errors where there aren’t any, but also to expect the wrong kind of error.

@sandersnsandersn added the For Backlog BugPRs that fix a backlog buglabel Feb 3, 2020
@orta

Re-running perf tests, I'm not really convinced this could add 7% after reading the PR

@typescript-bot perf test
@typescript-bot pack this

@typescript-bot

Heya @orta, I've started to run the perf test suite on this PR at 7a5ef8a. You can monitor the build here.

Update: The results are in!

@typescript-bot

Heya @orta, I've started to run the tarball bundle task on this PR at 7a5ef8a. You can monitor the build here.

@typescript-bot

Hey @orta, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/67018/artifacts?artifactName=tgz&fileId=5E21999D0FB04B583BB8D7FCD8E00648D55FEC3D17EA25E3229AC512A97BB1D902&fileName=/typescript-3.9.0-insiders.20200303.tgz"
    }
}

and then running npm install.


There is also a playground for this build.

@typescript-bot

@orta
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..36014

Metricmaster36014DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used334,334k (± 0.05%)333,871k (± 0.02%)-463k (- 0.14%)333,714k333,996k
Parse Time1.62s (± 0.61%)1.63s (± 0.64%)+0.01s (+ 0.62%)1.62s1.66s
Bind Time0.89s (± 0.82%)0.89s (± 0.90%)+0.00s (+ 0.45%)0.87s0.91s
Check Time4.70s (± 0.53%)4.73s (± 0.53%)+0.03s (+ 0.53%)4.67s4.79s
Emit Time5.30s (± 0.48%)5.32s (± 1.12%)+0.03s (+ 0.49%)5.22s5.46s
Total Time12.51s (± 0.28%)12.57s (± 0.54%)+0.07s (+ 0.52%)12.42s12.75s
Monaco - node (v10.16.3, x64)
Memory used335,259k (± 0.01%)335,293k (± 0.02%)+34k (+ 0.01%)335,184k335,482k
Parse Time1.25s (± 0.82%)1.26s (± 0.49%)+0.01s (+ 0.64%)1.25s1.28s
Bind Time0.78s (± 0.94%)0.78s (± 0.47%)-0.00s (- 0.26%)0.77s0.78s
Check Time4.72s (± 0.64%)4.71s (± 0.41%)-0.00s (- 0.11%)4.66s4.74s
Emit Time2.93s (± 0.71%)2.90s (± 0.52%)-0.03s (- 0.92%)2.87s2.94s
Total Time9.67s (± 0.33%)9.64s (± 0.32%)-0.03s (- 0.27%)9.58s9.72s
TFS - node (v10.16.3, x64)
Memory used299,484k (± 0.02%)299,513k (± 0.02%)+29k (+ 0.01%)299,396k299,660k
Parse Time0.94s (± 0.59%)0.94s (± 0.63%)+0.00s (+ 0.32%)0.93s0.96s
Bind Time0.74s (± 0.49%)0.75s (± 0.80%)+0.00s (+ 0.27%)0.73s0.76s
Check Time4.27s (± 0.49%)4.25s (± 0.49%)-0.02s (- 0.52%)4.20s4.28s
Emit Time3.03s (± 0.75%)3.03s (± 0.70%)+0.00s (+ 0.10%)2.98s3.07s
Total Time8.99s (± 0.37%)8.97s (± 0.32%)-0.01s (- 0.13%)8.93s9.04s
material-ui - node (v10.16.3, x64)
Memory used488,881k (± 0.01%)488,611k (± 0.02%)-269k (- 0.06%)488,423k488,854k
Parse Time1.77s (± 0.34%)1.78s (± 0.70%)+0.00s (+ 0.28%)1.75s1.82s
Bind Time0.68s (± 0.76%)0.68s (± 0.50%)+0.00s (+ 0.29%)0.68s0.69s
Check Time13.62s (± 0.93%)13.58s (± 0.86%)-0.04s (- 0.31%)13.38s13.84s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time16.08s (± 0.81%)16.04s (± 0.78%)-0.03s (- 0.21%)15.83s16.32s
Angular - node (v12.1.0, x64)
Memory used309,968k (± 0.14%)309,704k (± 0.02%)-264k (- 0.09%)309,558k309,856k
Parse Time1.58s (± 0.53%)1.58s (± 0.39%)+0.00s (+ 0.13%)1.57s1.60s
Bind Time0.87s (± 0.87%)0.87s (± 0.95%)+0.01s (+ 0.92%)0.86s0.90s
Check Time4.62s (± 0.69%)4.62s (± 0.70%)+0.00s (+ 0.06%)4.54s4.69s
Emit Time5.48s (± 1.25%)5.44s (± 0.83%)-0.03s (- 0.60%)5.38s5.54s
Total Time12.54s (± 0.75%)12.52s (± 0.59%)-0.02s (- 0.17%)12.40s12.69s
Monaco - node (v12.1.0, x64)
Memory used315,184k (± 0.01%)315,263k (± 0.02%)+79k (+ 0.03%)315,157k315,384k
Parse Time1.20s (± 0.40%)1.21s (± 0.62%)+0.01s (+ 0.91%)1.19s1.22s
Bind Time0.74s (± 1.10%)0.75s (± 0.74%)+0.00s (+ 0.67%)0.74s0.76s
Check Time4.55s (± 0.26%)4.57s (± 0.62%)+0.02s (+ 0.42%)4.53s4.66s
Emit Time2.96s (± 0.72%)2.98s (± 0.87%)+0.02s (+ 0.57%)2.92s3.03s
Total Time9.46s (± 0.28%)9.51s (± 0.51%)+0.05s (+ 0.58%)9.39s9.63s
TFS - node (v12.1.0, x64)
Memory used281,780k (± 0.02%)281,741k (± 0.02%)-39k (- 0.01%)281,586k281,833k
Parse Time0.92s (± 0.79%)0.93s (± 1.34%)+0.01s (+ 1.30%)0.91s0.96s
Bind Time0.71s (± 0.97%)0.71s (± 0.84%)+0.00s (+ 0.14%)0.69s0.72s
Check Time4.18s (± 0.72%)4.19s (± 0.48%)+0.01s (+ 0.33%)4.15s4.24s
Emit Time3.08s (± 1.35%)3.08s (± 0.87%)-0.00s (- 0.13%)3.01s3.13s
Total Time8.89s (± 0.57%)8.91s (± 0.46%)+0.03s (+ 0.30%)8.83s9.00s
material-ui - node (v12.1.0, x64)
Memory used466,312k (± 0.02%)466,106k (± 0.01%)-206k (- 0.04%)466,003k466,237k
Parse Time1.74s (± 0.33%)1.75s (± 0.42%)+0.01s (+ 0.40%)1.74s1.77s
Bind Time0.62s (± 0.95%)0.63s (± 0.54%)+0.00s (+ 0.48%)0.62s0.63s
Check Time12.05s (± 0.54%)12.08s (± 0.82%)+0.03s (+ 0.23%)11.89s12.25s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.41s (± 0.46%)14.45s (± 0.69%)+0.04s (+ 0.28%)14.26s14.63s
Angular - node (v8.9.0, x64)
Memory used329,366k (± 0.01%)328,978k (± 0.01%)-387k (- 0.12%)328,871k329,088k
Parse Time2.11s (± 0.32%)2.12s (± 1.18%)+0.01s (+ 0.66%)2.09s2.21s
Bind Time0.92s (± 0.87%)0.93s (± 0.82%)+0.00s (+ 0.43%)0.91s0.94s
Check Time5.51s (± 0.44%)5.51s (± 0.56%)-0.00s (- 0.09%)5.44s5.59s
Emit Time6.23s (± 0.90%)6.27s (± 0.90%)+0.04s (+ 0.63%)6.17s6.44s
Total Time14.78s (± 0.43%)14.82s (± 0.52%)+0.05s (+ 0.33%)14.67s15.05s
Monaco - node (v8.9.0, x64)
Memory used333,576k (± 0.02%)333,611k (± 0.01%)+35k (+ 0.01%)333,550k333,687k
Parse Time1.54s (± 0.66%)1.54s (± 0.38%)+0.01s (+ 0.52%)1.53s1.56s
Bind Time0.90s (± 0.66%)0.91s (± 1.27%)+0.01s (+ 1.23%)0.88s0.93s
Check Time5.40s (± 0.60%)5.37s (± 0.73%)-0.03s (- 0.56%)5.25s5.44s
Emit Time3.55s (± 0.56%)3.55s (± 0.65%)+0.01s (+ 0.14%)3.49s3.60s
Total Time11.38s (± 0.36%)11.37s (± 0.44%)-0.01s (- 0.08%)11.23s11.44s
TFS - node (v8.9.0, x64)
Memory used298,881k (± 0.02%)298,919k (± 0.02%)+38k (+ 0.01%)298,834k299,038k
Parse Time1.25s (± 0.53%)1.25s (± 0.27%)0.00s ( 0.00%)1.25s1.26s
Bind Time0.75s (± 0.69%)0.75s (± 1.29%)0.00s ( 0.00%)0.74s0.78s
Check Time4.83s (± 1.44%)4.87s (± 1.67%)+0.05s (+ 0.95%)4.75s5.12s
Emit Time3.34s (± 1.92%)3.29s (± 2.39%)-0.05s (- 1.53%)3.04s3.40s
Total Time10.17s (± 0.32%)10.16s (± 0.51%)-0.01s (- 0.08%)10.04s10.28s
material-ui - node (v8.9.0, x64)
Memory used494,722k (± 0.01%)494,521k (± 0.01%)-201k (- 0.04%)494,404k494,650k
Parse Time2.11s (± 0.53%)2.11s (± 0.77%)+0.00s (+ 0.24%)2.09s2.16s
Bind Time0.82s (± 1.35%)0.82s (± 1.02%)-0.00s (- 0.24%)0.80s0.83s
Check Time19.54s (± 0.47%)19.58s (± 0.77%)+0.05s (+ 0.24%)19.28s19.95s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time22.46s (± 0.47%)22.51s (± 0.65%)+0.05s (+ 0.24%)22.22s22.88s
Angular - node (v8.9.0, x86)
Memory used188,954k (± 0.03%)188,755k (± 0.03%)-199k (- 0.11%)188,624k188,855k
Parse Time2.05s (± 0.77%)2.06s (± 0.67%)+0.01s (+ 0.34%)2.03s2.10s
Bind Time1.07s (± 1.10%)1.07s (± 0.93%)+0.00s (+ 0.37%)1.06s1.09s
Check Time5.07s (± 0.95%)5.02s (± 0.55%)-0.05s (- 0.91%)4.97s5.11s
Emit Time6.19s (± 1.27%)6.15s (± 0.86%)-0.04s (- 0.69%)5.99s6.25s
Total Time14.38s (± 0.92%)14.30s (± 0.48%)-0.08s (- 0.52%)14.12s14.44s
Monaco - node (v8.9.0, x86)
Memory used189,214k (± 0.02%)189,263k (± 0.03%)+49k (+ 0.03%)189,113k189,383k
Parse Time1.58s (± 0.99%)1.59s (± 0.41%)+0.00s (+ 0.25%)1.58s1.61s
Bind Time0.77s (± 0.87%)0.77s (± 0.72%)+0.00s (+ 0.13%)0.76s0.78s
Check Time5.35s (± 1.51%)5.39s (± 1.28%)+0.03s (+ 0.64%)5.20s5.47s
Emit Time3.01s (± 3.38%)2.97s (± 3.07%)-0.04s (- 1.30%)2.84s3.22s
Total Time10.71s (± 0.33%)10.71s (± 0.41%)-0.00s (- 0.01%)10.61s10.79s
TFS - node (v8.9.0, x86)
Memory used170,430k (± 0.02%)170,441k (± 0.03%)+11k (+ 0.01%)170,334k170,531k
Parse Time1.28s (± 0.73%)1.28s (± 0.83%)+0.00s (+ 0.31%)1.27s1.32s
Bind Time0.72s (± 0.77%)0.72s (± 1.17%)+0.00s (+ 0.14%)0.70s0.74s
Check Time4.62s (± 1.13%)4.60s (± 0.65%)-0.02s (- 0.37%)4.52s4.66s
Emit Time2.99s (± 1.87%)3.01s (± 1.57%)+0.02s (+ 0.80%)2.96s3.19s
Total Time9.61s (± 0.58%)9.62s (± 0.37%)+0.01s (+ 0.10%)9.56s9.74s
material-ui - node (v8.9.0, x86)
Memory used277,168k (± 0.02%)277,026k (± 0.01%)-142k (- 0.05%)276,958k277,079k
Parse Time2.17s (± 0.38%)2.17s (± 0.59%)+0.00s (+ 0.00%)2.15s2.20s
Bind Time0.69s (± 1.16%)0.69s (± 0.75%)+0.00s (+ 0.15%)0.68s0.70s
Check Time17.72s (± 0.80%)17.57s (± 0.43%)-0.15s (- 0.85%)17.43s17.74s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time20.58s (± 0.69%)20.44s (± 0.37%)-0.15s (- 0.71%)20.30s20.59s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v8.9.0, x64)
  • material-ui - node (v8.9.0, x86)
BenchmarkNameIterations
Current3601410
Baselinemaster10

@orta

These numbers make more sense to me - basically everything is varying in the 0.x range on a plus or minus which is basically just normal noise in perf tests.

orta
orta approved these changes Mar 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, happy to merge based on your answer to the my comment above

@ExE-Boss

This would make it possible to deprecate $ExpectError in dtslint.

It would also reduce noise in IDEs, as $ExpectError still results in the error being shown in the IDE.

@JoshuaKGoldbergJoshuaKGoldberg requested a review from orta March 4, 2020 22:25
@orta

OK, this looks good to go - thanks!

I don't know if it's in TypeScript, or in vscode, but we should also get // @ts-expect-error to show up in the autocomplete in comments too, but I'm good for that to be another PR.

The playground doesn't show any of those options.

@ortaorta merged commit ffde923 into microsoft:master Mar 5, 2020
@ortaorta added the Update Docs on Next ReleaseIndicates that this PR affects docslabel Mar 5, 2020
@JoshuaKGoldbergJoshuaKGoldberg deleted the ts-expect-error branch March 5, 2020 15:45
@JoshuaKGoldberg

👍 It's in vscode, in a list of directives: microsoft/vscode#92093

@eps1lon

I love this! Does this mean we can use @ts-expect instead of the tslint expect rule and $ExpectError?

@orta

I think so, yep

@tmillr

As someone else already mentioned, I second that it would be nice to be able to specify exactly what error to expect (by its id/code etc). I've only used ts-ignore a few times but have already ran into the problem where I think I'm ignoring one error just to have it transform into another completely unrelated error however, unknowingly, since this transformation happened in "the meantime" while the ts-ignore directive was still active/in-place the whole time. So the new error that the old error "transformed into" went completely unnoticed from what I remember (until I removed the directive of course, which was when I found out about the change). Now I try to just avoid ts-ignore altogether because of such potential situations that may arise because it's just not worth taking that kind of a risk imo.

@asktree

related to @Tyler1205 's comment I would like to be able to specify number of errors, and that might be easier to handle.

@Asaf-S

related to @Tyler1205 's comment I would like to be able to specify number of errors, and that might be easier to handle.

I agree, this is really needed as you can never know if you are blocking more than 1 error, or the wrong kind of error

Sign up for free to join this conversation on . Already have an account? Sign in to comment
For Backlog BugPRs that fix a backlog bugUpdate Docs on Next ReleaseIndicates that this PR affects docs
None yet

Successfully merging this pull request may close these issues.

ts-ignore should error if next line is not an error