Avoid crash caused by removed function in typescript@3.0.0
.
Added support for TypeScript@3.0.0 nightly builds.
Features:
getIIFE
utilityBugfixes:
forEachComment
and forEachTokenWithTrivia
no longer duplicate comments around missing nodesBugfixes:
hasSideEffects
with tagged template literal without substitution: tag`template`
Features:
isLiteralTypeNode
type T = import('foo')
) to findImports
via ImportKind.ImportType
Bugfixes:
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 and Microsoft/TypeScript#22769Features:
isStatementInAmbientContext
and isAmbientModuleBlock
Features:
isConditionalTypeNode
, isInferTypeNode
, isConditionalType
, isInstantiableType
, isSubstitutionType
Features:
isForInOrOfStatement
Bugfixes:
<MyComponent<string>/*comment*/></MyComponent>
<div><br/>/*no comment*/</div>
Bugfixes:
collectVariableUsage
: handle ConditionalTypes and infer T
, which will be introduced in TypeScript@2.8.0 and are already available in nightly buildsisLiteralType
no longer returns true for ts.TypeFlags.BooleanLiteral
as this is not a ts.LiteralType
Bugfixes:
endsControlFlow
:
Features:
isFalsyType
utilityBugfixes:
typescript@2.8.0-dev
Bugfixes:
isReassignmentTarget
: handle type assertions and non-null assertionBugfixes:
forEachDeclaredVariable
uses a more precise type for the callback parameter to make it useable again with typescript@2.7.1Features:
isUniqueESSymbolType
typeguardFeatures:
isThenableType
utilityunionTypeParts
utilityBugfixes:
forEachComment
, getCommentAtPosition
and isPositionInComment
: skip shebang (#! something
) to not miss following comments at the start of the fileFeatures:
WrappedAst
interface that models the type of a wrapped SourceFile more accurategetWrappedNodeAtPosition
utiltiy that takes a NodeWrap
and returns the most deeply nested NodeWrap that contains the given positionFeatures:
getControlFlowEnd
accepts BlockLike as argumentBugfixes:
getControlFlowEnd
and endsControlFlow
: correctly handle nested LabeledStatementsendsControlFlow
removed erroneous special case when an IterationStatement is passed as argument whose parent is a LabeledStatement.
Deprecations:
getControlFlowEnd
that contains the label
parameter. This parameter is no longer used and should no longer be passed to the function.Bugfixes:
getControlFlowEnd
and endsControlFlow
(#22)
try
are filtered out if there is a catch
clausecatch
only end control flow if try
AND catch
definitely end control flowFeatures:
kind
property to NodeWrap
getControlFlowEnd
to public APIFeatures:
isDecorator
and isCallLikeExpression
typeguardsFeatures:
convertAst
utility to produce a flattened and wrapped version of the ASTFeatures:
isDeleteExpression
getLineBreakStyle
Bugfixes:
isJsxFragment
Features:
JsxFragment
introduced in typescript@2.6.2Bugfixes:
endsControlFlow
break
and continue
with labelsisValidIdentifier
and isValidNumericLiteral
handle irregular whitespacefindImports
searches in ambient modules inside regular .ts
files (not only .d.ts
)canHaveJsDoc
is now a typeguardBugfixes:
forEachTokenWithTrivia
API-Changes:
ImportOptions
if favor of the new ImportKind
enumBugfixes:
parseJsDocOfNode
: set correct pos
, end
and parent
properties. Also affects getJsDoc
of EndOfFileToken
Bugfixes:
collectVariableUsage
: correctly consider catch binding as block scoped declaration inside catch blockBugfixes:
getJsDoc
now correctly returns JsDoc for EndOfFileToken
Features:
parseJsDocOfNode
Features:
findImports
to find all kinds of imports in a source fileFeatures:
isMappedTypeNode
canHaveJsDoc
and getJsDoc
Bugfixes:
collectVariableUsage
: handle global augmentation like other module augmentationsBugfixes:
typescript@2.5.1
with optional catch bindingcollectVariableUsage
fixed a bug where method decorator had method's parameters in scopegetIdentifierText
to unescape identifiers across typescript versionsBugfixes:
isReassignmentTarget
don't return true
for right side of assignmentFeatures:
isReassignmentTarget
utilityBugfixes:
getDeclarationDomain
now returns undefined
for Parameter in IndexSignaturecollectVariableUsage
ignores Parameter in IndexSignatureBugfixes:
collectVariableUsage
:
export {};
isExpressionValueUsed
: handle destructuring in for...of
Features:
getModifier
utilityDeclarationDomain.Import
to distinguish imports from other declarationsBugfixes:
collectVariableUsage
ignore jump labels as in break label;
Bugfixes:
isFunctionWithBody
handles constructor overload correctly.Features:
isExpressionValueUsed
to check whether the result of an expression is actually used.getDeclarationDomain
to determine if a given declaration introduces a new symbol in the value or type domain.collectVariableUses
is now usable
: typeof foo
is handled for parameters and function return typeexport {Foo as Bar}
inside ambient namespaces and modulesBugfixes:
getLineRanges
: contentLength
now contains the correct line length when there are multiple consecutive line break charactersgetTokenAtPosition
: don't match tokens that end at the specified position (because that's already outside of their range)isModfierFlagSet
, use the new isModifierFlagSet
insteadFeatures:
isJsDoc
getUsageDomain
and collectVariableUsage
)Bugfixes:
forEachComment
no longer omits some comments when callback returns a truthy valueisPositionInComment
fixed false positive inside JSXTextFeatures:
getCommentAtPosition
Bugfixes:
SideEffectOptions.JsxElement
to be a power of 2Features:
getTokenAtPosition
and isPositionInComment
Features:
isExpression
hasSideEffects
, getDeclarationOfBindingElement
Breaking Changes:
typescript@<2.1.0
isNumericliteral
, use isNumericLiteral
instead (notice the uppercase L)isEnumLiteralType
which will cause compile errors with typescript@2.4.0require('tsutils/src/typeguard')
will be brokenFeatures:
require('tsutils/typeguard')
)Bugfixes:
isObjectFlagSet
now uses the correct objectFlags
propertyBugfixes:
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
Features:
isNodeFlagSet
, isTypeFlagSet
, isSymbolFlagSet
,isObjectFlagSet
, isModifierFlagSet
Features:
isJsxAttributes
, isIntersectionTypeNode
, isTypeOperatorNode
, isTypePredicateNode
, isTypeQueryNode
, isUnionTypeNode
Bugfixes:
isFunctionScopeBoundary
now handles Interfaces, TypeAliases, FunctionSignatures, etcFeatures:
isThisParameter
, isSameLine
and isFunctionWithBody
Features:
isValidPropertyAccess
, isValidNumericLiteral
and isValidPropertyName
Features:
isValidIdentifier
Features:
contentLength
property to the result of getLineRanges
Bugfixes:
canHaveLeadingTrivia
:
hasOwnThisReference
: now includes accessors on object literalsFeatures:
Bugfixes:
hasOwnThisReference
:
Bugfixes:
isNumericLiteral
Features:
Bugfixes:
Features:
Features: