Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / tsutils / CHANGELOG.md
1 # 3.17.1
2
3 **Bugfixes:**
4
5 * `isValidJsxIdentifier`, `isValidPropertyAccess`, `isValidPropertyName`: fix unicode character width handling
6
7 # 3.17.0
8
9 **Features:**
10
11 * `isValidJsxIdentifier` added an optional parameter to specify the target ECMAScript version
12
13 **Bugfixes:**
14
15 * `isValidJsxIdentifier` now handles astral plane characters
16
17 # 3.16.0
18
19 **Features:**
20
21 * added `getIteratorYieldResultFromIteratorResult` to extract the `yield`ed type from `IteratorResult<TYield, TReturn, TNext>`
22
23 # 3.15.0
24
25 **Features:**
26
27 * `isValidIdentifier`, `isValidPropertyName`, `isValidPropertyAccess`, `isValidNumericLiteral` added an optional parameter to specify the target ECMAScript version
28
29 **Bugfixes:**
30
31 * `isValidPropertyName`, `isValidPropertyAccess` now handle astral plane characters
32
33 # 3.14.1
34
35 **Bugfixes:**
36
37 * `findImports`: fixed crash on nested namespaces
38
39 # 3.14.0
40
41 **Features:**
42
43 * added `getInstanceTypeOfClassLikeDeclaration` and `getConstructorTypeOfClassLikeDeclaration`
44 * added `AccessKind.Delete` to `getAccessKind`: `getAccessKind(node) & AccessKind.Modification` can now be used to restore the old behavior of `isReassignmentTarget(node)`
45
46 # 3.13.0
47
48 **Features:**
49
50 * `getAccessKind` determines whether an expression is read from, written to or both
51 * optimized `getPropertyOfType` for unambiguous property names to partially work around https://github.com/microsoft/TypeScript/issues/31565
52
53 **Bugfixes:**
54
55 * `isReassignmentTarget` no longer returns `true` for `DeleteExpression` as it doesn't **assign** a value to the operand
56
57 # 3.12.0
58
59 **Features:**
60
61 * `getLateBoundPropertyNamesOfPropertyName` returns all statically analyzable names of a property, method, ...
62 * `getSingleLateBoundPropertyNameOfPropertyName` returns the literal name of a property, method, ... if statically analyzable
63
64 **Bugfixes:**
65
66 * fixed circular import
67
68 # 3.11.0
69
70 **Features:**
71
72 * typeguards: `isNumericOrStringLikeLiteral`, `isTupleTypeReference`
73 * `intersectionTypeParts` as counterpart to `unionTypeParts`
74 * `someTypePart` to execute a callback for each union or intersection constituent until the callback returns true
75 * `getPropertyOfType` looks up a property by its escaped name
76 * `isPropertyReadonlyInType` determines whether a property in a given type cannot be written to
77 * `symbolHasReadonlyDeclaration` determines if a Symbol has any readonly or constant declaration
78 * `isNumericPropertyName` determines whether a property name would match an index signature
79 * `isBindableObjectDefinePropertyCall` returns true for statically analyzable forms of `Object.defineProperty(o, 'p', {value, writable})`
80 * `isReadonlyAssignmentDeclaration` determines whether an `Object.defineProperty` call is known to result in a readonly property
81 * `getLateBoundPropertyNames` returns all known property names of an expression
82 * `getPropertyNameFromType` extracts the property name of literal types
83 * `isWellKnownSymbolLiterally` to recognize expressions in the form of `Symbol.<name>`
84 * `getPropertyNameOfWellKnownSymbol` returns the escaped name for a well known symbol literal
85 * `unwrapParentheses` returns the first child expression that is not a `ParenthesizedExpression`
86
87 # 3.10.0
88
89 **Features:**
90
91 * `isCompilerOptionEnabled`: `incremental` is implicitly enabled by `composite`
92
93 **Bugfixes:**
94
95 * `collectVariableUsage`/`getUsageDomain`: no longer treat `as const` as type usage
96
97 # 3.9.1
98
99 **Bugfixes:**
100
101 * reverted invalid deprecation of `canHaveJsdoc`
102 * fixed condition in `parseJsdocOfNode`
103
104 # 3.9.0
105
106 **Features:**
107
108 * added typeguards: `isNullLiteral` and `isBooleanLiteral`
109
110 # 3.8.0
111
112 **Features:**
113
114 * exposes typeguards for typescript@3.2 by default
115 * added utilities: `isConstAssertion` and `isInConstContext`
116
117 # 3.7.0
118
119 **Features:**
120
121 * added `isBlockScopedDeclarationStatement`
122 * added `isInSingleStatementContext`
123
124 # 3.6.0
125
126 **Features:**
127
128 * added `getCheckJsDirective` utility to parse `// @ts-check` and `// @ts-nocheck` pragmas
129
130 # 3.5.2
131
132 **Bugfixes:**
133
134 * Published declaration files no longer contain `const enum`. They are now declared as regular enums instead.
135
136 # 3.5.1
137
138 **Bugfixes:**
139
140 * `isThenableType` allows `Node` instead of `Expression` as parameter
141 * `isBlockScopeBoundary` and `isScopeBoundary` consider `WithStatement` as scope boundary
142
143 # 3.5.0
144
145 **Features:**
146
147 * correctly handle BigInt literals
148   * added typeguard `isBigIntLiteral`
149   * `isLiteralType` recognises BigInt
150   * `getPropertyName` adds special handling for BigInt
151
152 # 3.4.0
153
154 **Features:**
155
156 * added utility `commentText` to get the actual text content of a comment excluding the characters needed to start and end the comment
157
158 # 3.3.1
159
160 **Bugfixes:**
161
162 * `findImports`: fixed handling of ImportEqualsDeclaration
163
164 # 3.3.0
165
166 **Features:**
167
168 * `isCompilerOptionEnabled`: recognizes `strictBindCallApply`
169 * `getTokenAtPosition`: optionally includes JSDoc during lookup
170
171 **Bugfixes:**
172
173 * `isCompilerOptionEnabled`: correctly implements logic for `allowSyntheticDefaultImports`
174 * `findImportLikeNodes`: correctly finds imports in namespaces
175 * `findImportLikeNodes` / `findImports`: finds import types in JSDoc of JS files
176
177 # 3.2.0
178
179 **Features:**
180
181 * added utility `findImportLikeNodes` that works similar to `findImports` but returns the import statement or expression instead of the module specifier and doesn't filter non-string module specifiers
182
183 # 3.1.0
184
185 **Features:**
186
187 * added utilities: `isKeywordKind` and `isValidJsxIdentifier`
188 * exposes typeguards for typescript@3.0 by default
189
190 # 3.0.0
191
192 :warning: **Breaking Changes:**
193
194 * Dropped support for `typescript@<2.8.0`
195 * Dropped support for Node.js 4
196 * Removed deprecated APIs:
197   * `getIdentifierText`, `isJsxFramgment`, `ImportOptions`
198   * deprected overloads of `isModifierFlagSet`, `findImports` and `getControlFlowEnd`
199 * control flow related symbols can no longer be imported from `'tsutils/util/util'`, import directly from `'tsutils/util/control-flow'` or `'tsutils/util'`
200 * `isFunctionScopeBoundary` and `isBlockScopeBoundary` now return a enum member of `ScopeBoundary` instead of a boolean
201 * `isFunctionScopeBoundary` no longer returns a truthy value for `InterfaceDeclaration`, `TypeAliasDeclaration`
202
203 **Features:**
204
205 * added utility `isTypeScopeBoundary` returning `ScopeBoundary.Type` or `ScopeBoundary.ConditionalType`
206 * added enum `ScopeBoundarySelector` whose members can be used to determine if a declaration belongs to a given `ScopeBoundary` by using bitwise AND
207
208 **Bugfixes:**
209
210 * `collectVariableUsage` now correctly handles `infer T` nested inside function signatures or mapped types
211 * `isCompilerOptionEnabled` correctly handles `skipDefaultLibCHeck` and `suppressImplicitAnyIndexErrors`
212
213 # 2.29.0
214
215 **Features:**
216
217 * added utility `isCompilerOptionEnabled`
218
219 # 2.28.0
220
221 Typeguards are now split into multiple submodules for each version of TypeScript (starting with 2.8.0).
222 That means you can now import directly from `"tsutils/typeguard/2.8"` to get compatible declaraton files for TypeScript@2.8.
223 For more information please read the relevant section in [README.md](README.md).
224
225 **Features:**
226
227 * added typeguards: `isTupleType`, `isOptionalTypeNode`, `isRestTypeNode`, `isSyntheticExpression` (currently available from `"tsutils/typeguard/3.0"`)
228 * added utility `isStrictCompilerOptionEnabled`
229
230 # 2.27.2
231
232 Avoid crash caused by removed function in `typescript@3.0.0`.
233
234 # 2.27.1
235
236 Added support for TypeScript@3.0.0 nightly builds.
237
238 # 2.27.0
239
240 **Features:**
241
242 * added `getIIFE` utility
243
244 # 2.26.2
245
246 **Bugfixes:**
247
248 * `forEachComment` and `forEachTokenWithTrivia` no longer duplicate comments around missing nodes
249
250 # 2.26.1
251
252 **Bugfixes:**
253
254 * fixed crash in `hasSideEffects` with tagged template literal without substitution: ``tag`template` ``
255
256 # 2.26.0
257
258 **Features:**
259
260 * added typeguard `isLiteralTypeNode`
261 * added support for type imports (`type T = import('foo')`) to `findImports` via `ImportKind.ImportType`
262
263 # 2.25.1
264
265 **Bugfixes:**
266
267 * `collectVariableUsage`: fixed name lookup in function signatures to match runtime behavior. Note that this is not completely fixed in TypeScript, yet. See: [Microsoft/TypeScript#22825](https://github.com/Microsoft/TypeScript/issues/22825) and [Microsoft/TypeScript#22769](https://github.com/Microsoft/TypeScript/issues/22769)
268
269 # 2.25.0
270
271 **Features:**
272
273 * added utilities: `isStatementInAmbientContext` and `isAmbientModuleBlock`
274
275 # 2.24.0
276
277 **Features:**
278
279 * added typeguards for typescript@2.8: `isConditionalTypeNode`, `isInferTypeNode`, `isConditionalType`, `isInstantiableType`, `isSubstitutionType`
280
281 # 2.23.0
282
283 **Features:**
284
285 * added typeguard `isForInOrOfStatement`
286
287 **Bugfixes:**
288
289 * correctly handle comments in generic JSX elements: `<MyComponent<string>/*comment*/></MyComponent>`
290 * fixed a bug with false positive trailing comments at the end of JSX self closing element: `<div><br/>/*no comment*/</div>`
291
292 # 2.22.2
293
294 **Bugfixes:**
295
296 * `collectVariableUsage`: handle ConditionalTypes and `infer T`, which will be introduced in TypeScript@2.8.0 and are already available in nightly builds
297 * `isLiteralType` no longer returns true for `ts.TypeFlags.BooleanLiteral` as this is not a `ts.LiteralType`
298
299 # 2.22.1
300
301 **Bugfixes:**
302
303 * `endsControlFlow`:
304   * handle loops that might not even run a single iteration
305   * handle constant boolean conditions in loops and if
306
307 # 2.22.0
308
309 **Features:**
310
311 * added `isFalsyType` utility
312
313 # 2.21.2
314
315 **Bugfixes:**
316
317 * fixed compile error with `typescript@2.8.0-dev`
318
319 # 2.21.1
320
321 **Bugfixes:**
322
323 * `isReassignmentTarget`: handle type assertions and non-null assertion
324
325 # 2.21.0
326
327 **Bugfixes:**
328
329 * `forEachDeclaredVariable` uses a more precise type for the callback parameter to make it useable again with typescript@2.7.1
330
331 **Features:**
332
333 * added `isUniqueESSymbolType` typeguard
334
335 # 2.20.0
336
337 **Features:**
338
339 * added `isThenableType` utility
340 * added `unionTypeParts` utility
341
342 # 2.19.1
343
344 **Bugfixes:**
345
346 * `forEachComment`, `getCommentAtPosition` and `isPositionInComment`: skip shebang (`#! something`) to not miss following comments at the start of the file
347
348 # 2.19.0
349
350 **Features:**
351
352 * added `WrappedAst` interface that models the type of a wrapped SourceFile more accurate
353 * added `getWrappedNodeAtPosition` utiltiy that takes a `NodeWrap` and returns the most deeply nested NodeWrap that contains the given position
354
355 # 2.18.0
356
357 **Features:**
358
359 * `getControlFlowEnd` accepts BlockLike as argument
360
361 **Bugfixes:**
362
363 * `getControlFlowEnd` and `endsControlFlow`: correctly handle nested LabeledStatements
364 * `endsControlFlow` removed erroneous special case when an IterationStatement is passed as argument whose parent is a LabeledStatement.
365   * if you want labels of an IterationStatement (or SwitchStatement) to be handled, you need to pass the LabeledStatement as argument.
366   * :warning: this fix may change the returned value if you relied on the buggy behavior
367
368 **Deprecations:**
369
370 * deprecated overload of `getControlFlowEnd` that contains the `label` parameter. This parameter is no longer used and should no longer be passed to the function.
371
372 # 2.17.1
373
374 **Bugfixes:**
375
376 * `getControlFlowEnd` and `endsControlFlow` (#22)
377   * ThrowStatements inside `try` are filtered out if there is a `catch` clause
378   * TryStatements with `catch` only end control flow if `try` AND `catch` definitely end control flow
379
380 # 2.17.0
381
382 **Features:**
383
384 * added `kind` property to `NodeWrap`
385 * added `getControlFlowEnd` to public API
386
387 # 2.16.0
388
389 **Features:**
390
391 * added `isDecorator` and `isCallLikeExpression` typeguards
392
393 # 2.15.0
394
395 **Features:**
396
397 * added `convertAst` utility to produce a flattened and wrapped version of the AST
398
399 # 2.14.0
400
401 **Features:**
402
403 * added `isDeleteExpression`
404 * added `getLineBreakStyle`
405
406 # 2.13.1
407
408 **Bugfixes:**
409
410 * fixed name of `isJsxFragment`
411
412 # 2.13.0
413
414 **Features:**
415
416 * added support for `JsxFragment` introduced in typescript@2.6.2
417 * added corresponding typeguard functions
418
419 # 2.12.2
420
421 **Bugfixes:**
422
423 * `endsControlFlow`
424   * added missing logic for labeled statement, iteration statements and try-catch
425   * added missing logic for `break` and `continue` with labels
426   * take all jump statements into account, not only the last statement
427 * `isValidIdentifier` and `isValidNumericLiteral` handle irregular whitespace
428 * `findImports` searches in ambient modules inside regular `.ts` files (not only `.d.ts`)
429 * `canHaveJsDoc` is now a typeguard
430
431 # 2.12.1
432
433 **Bugfixes:**
434
435 * `forEachTokenWithTrivia`
436   * handles irregular whitespace and no longer visits some tokens twice
437   * correctly calculates the range of JsxText
438
439 # 2.12.0
440
441 **API-Changes:**
442
443 * deprecated `ImportOptions` if favor of the new `ImportKind` enum
444
445 # 2.11.2
446
447 **Bugfixes:**
448
449 * `parseJsDocOfNode`: set correct `pos`, `end` and `parent` properties. Also affects `getJsDoc` of `EndOfFileToken`
450
451 # 2.11.1
452
453 **Bugfixes:**
454
455 * `collectVariableUsage`: correctly consider catch binding as block scoped declaration inside catch block
456
457 # 2.11.0
458
459 **Bugfixes:**
460
461 * `getJsDoc` now correctly returns JsDoc for `EndOfFileToken`
462
463 **Features:**
464
465 * added utility `parseJsDocOfNode`
466
467 # 2.10.0
468
469 **Features:**
470
471 * added utility `findImports` to find all kinds of imports in a source file
472
473 # 2.9.0
474
475 **Features:**
476
477 * added typeguard `isMappedTypeNode`
478 * added utilities `canHaveJsDoc` and `getJsDoc`
479
480 # 2.8.2
481
482 **Bugfixes:**
483
484 * `collectVariableUsage`: handle global augmentation like other module augmentations
485
486 # 2.8.1
487
488 **Bugfixes:**
489
490 * Support `typescript@2.5.1` with optional catch binding
491 * `collectVariableUsage` fixed a bug where method decorator had method's parameters in scope
492
493 # 2.8.0
494
495 * Compatibility with the latest typescript nightly
496 * Added `getIdentifierText` to unescape identifiers across typescript versions
497
498 # 2.7.1
499
500 **Bugfixes:**
501
502 * `isReassignmentTarget` don't return `true` for right side of assignment
503
504 # 2.7.0
505
506 **Features:**
507
508 * Added `isReassignmentTarget` utility
509
510 # 2.6.1
511
512 **Bugfixes:**
513
514 * `getDeclarationDomain` now returns `undefined` for Parameter in IndexSignature
515 * `collectVariableUsage` ignores Parameter in IndexSignature
516
517 # 2.6.0
518
519 **Bugfixes:**
520
521 * `collectVariableUsage`:
522   * don't merge imports with global declarations
523   * treat everything in a declaration file as exported if there is no explicit `export {};`
524 * `isExpressionValueUsed`: handle destructuring in `for...of`
525
526 **Features:**
527
528 * Added `getModifier` utility
529 * Added `DeclarationDomain.Import` to distinguish imports from other declarations
530
531 # 2.5.1
532
533 **Bugfixes:**
534
535 * `collectVariableUsage` ignore jump labels as in `break label;`
536
537 # 2.5.0
538
539 **Bugfixes:**
540
541 * `isFunctionWithBody` handles constructor overload correctly.
542
543 **Features:**
544
545 * Implemented `isExpressionValueUsed` to check whether the result of an expression is actually used.
546 * Implemented `getDeclarationDomain` to determine if a given declaration introduces a new symbol in the value or type domain.
547
548 **`collectVariableUses` is now usable**
549
550 * no longer ignores signatures and its parameters
551 * don't merge declarations and uses across domains
552 * no longer marks exceptions in catch clause or parameter properties as exported
553 * fixed exports of namespaces
554 * fixed scoping of ClassExpression name
555 * correcly handle ambient namespaces and module augmentations
556 * fixed how `: typeof foo` is handled for parameters and function return type
557 * **still WIP**: `export {Foo as Bar}` inside ambient namespaces and modules
558
559 # 2.4.0
560
561 **Bugfixes:**
562
563 * `getLineRanges`: `contentLength` now contains the correct line length when there are multiple consecutive line break characters
564 * `getTokenAtPosition`: don't match tokens that end at the specified position (because that's already outside of their range)
565 * deprecated the misnamed `isModfierFlagSet`, use the new `isModifierFlagSet` instead
566
567 **Features:**
568
569 * Added typeguard: `isJsDoc`
570 * Added experimental scope and usage analysis (`getUsageDomain` and `collectVariableUsage`)
571
572 # 2.3.0
573
574 **Bugfixes:**
575
576 * `forEachComment` no longer omits some comments when callback returns a truthy value
577 * `isPositionInComment` fixed false positive inside JSXText
578
579 **Features:**
580
581 * Added utility: `getCommentAtPosition`
582
583 # 2.2.0
584
585 **Bugfixes:**
586
587 * Fixed bit value of `SideEffectOptions.JsxElement` to be a power of 2
588
589 **Features:**
590
591 * Added utilities: `getTokenAtPosition` and `isPositionInComment`
592
593 # 2.1.0
594
595 **Features:**
596
597 * Added typeguard `isExpression`
598 * Added utilities: `hasSideEffects`, `getDeclarationOfBindingElement`
599
600 # 2.0.0
601
602 **Breaking Changes:**
603
604 * Dropped compatibility with `typescript@<2.1.0`
605 * Removed misnamed `isNumericliteral`, use `isNumericLiteral` instead (notice the uppercase L)
606 * Removed `isEnumLiteralType` which will cause compile errors with typescript@2.4.0
607 * Refactored directory structure: all imports that referenced subdirectories (e.g. `require('tsutils/src/typeguard')` will be broken
608
609 **Features:**
610
611 * New directory structure allows imports of typeguards or utils independently, e.g. (`require('tsutils/typeguard')`)
612
613 # 1.9.1
614
615 **Bugfixes:**
616
617 * `isObjectFlagSet` now uses the correct `objectFlags` property
618
619 # 1.9.0
620
621 **Bugfixes:**
622
623 * `getNextToken` no longer omits `EndOfFileToken` when there is no trivia before EOF. That means the only inputs where `getNextToken` returns `undefined` are `SourceFile` and `EndOfFileToken`
624
625 **Features**:
626
627 * Added typeguards for types
628 * Added utilities for flag checking: `isNodeFlagSet`, `isTypeFlagSet`, `isSymbolFlagSet`,`isObjectFlagSet`, `isModifierFlagSet`
629
630 # 1.8.0
631
632 **Features:**
633
634 * Support peer dependency of typescript nightlies of 2.4.0
635 * Added typeguards: `isJsxAttributes`, `isIntersectionTypeNode`, `isTypeOperatorNode`, `isTypePredicateNode`, `isTypeQueryNode`, `isUnionTypeNode`
636
637 # 1.7.0
638
639 **Bugfixes:**
640
641 * `isFunctionScopeBoundary` now handles Interfaces, TypeAliases, FunctionSignatures, etc
642
643 **Features:**
644
645 * Added utilities: `isThisParameter`, `isSameLine` and `isFunctionWithBody`
646
647 # 1.6.0
648
649 **Features:**
650
651 * Add `isValidPropertyAccess`, `isValidNumericLiteral` and `isValidPropertyName`
652
653 # 1.5.0
654
655 **Features:**
656
657 * Add `isValidIdentifier`
658
659 # 1.4.0
660
661 **Features:**
662
663 * Add `contentLength` property to the result of `getLineRanges`
664
665 # 1.3.0
666
667 **Bugfixes:**
668
669 * `canHaveLeadingTrivia`:
670   * Fix property access on undefined parent reference
671   * Fixes: [palantir/tslint#2330](https://github.com/palantir/tslint/issues/2330)
672 * `hasOwnThisReference`: now includes accessors on object literals
673
674 **Features:**
675
676 * Typeguards:
677   * isTypeParameterDeclaration
678   * isEnitityName
679
680 # 1.2.2
681
682 **Bugfixes:**
683
684 * `hasOwnThisReference`:
685   * exclude overload signatures of function declarations
686   * add method declarations on object literals
687
688 # 1.2.1
689
690 **Bugfixes:**
691
692 * Fix name of `isNumericLiteral`
693
694 # 1.2.0
695
696 **Features:**
697
698 * Typeguards:
699   * isEnumMember
700   * isExpressionWithTypeArguments
701   * isImportSpecifier
702 * Utilities:
703   * isJsDocKind, isTypeNodeKind
704 * Allow typescript@next in peerDependencies
705
706 # 1.1.0
707
708 **Bugfixes:**
709
710 * Fix isBlockScopeBoundary: Remove WithStatement, IfStatment, DoStatement and WhileStatement because they are no scope boundary whitout a block.
711
712 **Features:**
713
714 * Added more typeguards:
715   * isAssertionExpression
716   * isEmptyStatement
717   * isJsxAttributeLike
718   * isJsxOpeningLikeElement
719   * isNonNullExpression
720   * isSyntaxList
721 * Utilities:
722   * getNextToken, getPreviousToken
723   * hasOwnThisReference
724   * getLineRanges
725
726 # 1.0.0
727
728 **Features:**
729
730 * Initial implementation of typeguards
731 * Utilities:
732   * getChildOfKind
733   * isNodeKind, isAssignmentKind
734   * hasModifier, isParameterProperty, hasAccessModifier
735   * getPreviousStatement, getNextStatement
736   * getPropertyName
737   * forEachDestructuringIdentifier, forEachDeclaredVariable
738   * getVariableDeclarationKind, isBlockScopedVariableDeclarationList, isBlockScopedVariableDeclaration
739   * isScopeBoundary, isFunctionScopeBoundary, isBlockScopeBoundary
740   * forEachToken, forEachTokenWithTrivia, forEachComment
741   * endsControlFlow