sort by:
Revision Author Date Message Commit Date
04c2fbd Contextual type of methods only in noImplicitAny or JSDoc 30 August 2022, 17:17:26 UTC
488d0ee Retain name and propertyName in declaration emit copies of binding patterns if property name is a keyword (#50537) * Retain name and propertyName in declaration emit copies of binding patterns if property name is a keyword * Accept baselines * Remove out of date file 30 August 2022, 16:03:02 UTC
8b482b5 Update package-lock.json 30 August 2022, 06:29:59 UTC
c89f355 Remove redundant pretest script (#50518) 29 August 2022, 19:12:32 UTC
6d170b4 Handle intersections in isGenericTypeWithoutNullableConstraint (#50497) * Handle intersections in isGenericTypeWithoutNullableConstraint * Add regression test 29 August 2022, 16:24:13 UTC
ed6889c LEGO: Merge pull request 50506 LEGO: Merge pull request 50506 29 August 2022, 10:47:42 UTC
29cbfe9 LEGO: Merge pull request 50493 LEGO: Merge pull request 50493 28 August 2022, 10:32:25 UTC
6faa291 LEGO: Merge pull request 50484 LEGO: Merge pull request 50484 27 August 2022, 10:51:23 UTC
71b2ba6 Reuse computed type of condition expressions (#49881) 27 August 2022, 08:40:13 UTC
8778c1d Update package-lock.json 27 August 2022, 06:06:30 UTC
4579245 fix(50427): allow convert function expressions (#50430) 26 August 2022, 22:43:19 UTC
cbc0b17 Push package-lock.json updates via typescript-bot token (#50476) 26 August 2022, 21:36:25 UTC
bb3a7ae fix(50415): Language server debug failure - Did not expect GetAccessor to have an Identifier in its trivia (#50470) * fix(50415): clone props for get/set accessors * add additional tests * create helpers to create name, body, modifiers, typeName * cleanup 26 August 2022, 21:33:23 UTC
3557092 Rephrase error message to be 100% technically correct (#50471) 26 August 2022, 21:22:49 UTC
71d1911 add unknown to DateTimeFormatTypes (#50402) * add unknown to DateTimeFormatTypes * move unknown to es2019.intl instead * Accepted baselines. Co-authored-by: long.ho <long.ho@cloudkitchens.com> 26 August 2022, 20:02:44 UTC
8f89599 Don't include .gitattributes in package (#50475) 26 August 2022, 19:15:30 UTC
6e8337e Optimize substitution types (#50397) * Optimize substitution type infrastructure * Accept new baselines * Preserve instantiated substitution types for type variables * Restrictive type parameters should have no constraint * Fix issues from top100 test run * Accept new baselines 26 August 2022, 19:06:06 UTC
226dd0b Fix typechecking related lints that changed post 4.8, update LKG to 4.8.2 (#50472) 26 August 2022, 18:41:45 UTC
164dddc feat(7481): Operator to ensure an expression is contextually typed by, and satisfies, some type (#46827) * feat(7481): add explicit type compatibility check with 'satisfies' expression * Add failing test for lack of intersectioned contextual type * Implement the behavior * Add test corresponding to the 'if' * Add test based on defined scenarios * remove isExpression in favor of using type casting * move tests from compiler to conformance folder * update baseline * add missing contextFlags argument * use asserted type * accept baseline Co-authored-by: Ryan Cavanaugh <ryanca@microsoft.com> 26 August 2022, 17:05:52 UTC
0715791 Update package-lock.json 26 August 2022, 06:20:06 UTC
e675ea8 Remove AUTHORS.md, .mailmap, authors.ts script (#50410) 25 August 2022, 22:38:09 UTC
38076df Fix auto import crash due to difference in `paths` handling (#50419) 25 August 2022, 20:02:48 UTC
12eb519 fix(50435): Duplicate seeming Code Actions for convert const to let (#50442) * fix(50435): omit fix all in constToLet QF * add FixAll action 25 August 2022, 20:01:46 UTC
a08b045 Jsdoc property description (#50269) * jsdocPropertyDescription * jsdocPropertyDescription * jsdocPropertyDescription * Fixes #47933 * added additional test * added additional example * fixed bug * changed function to only grab the literal type * added additional condition for literals and symbols * added additional test cases * Update src/services/symbolDisplay.ts Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> * addressed PR review * addressed new PR review Co-authored-by: Danay Fernandez Alfonso <t-danayf@microsoft.com> Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> 25 August 2022, 18:57:32 UTC
5ba22e0 Remove top level loc folder (#50421) 25 August 2022, 18:44:24 UTC
c4eb37c Update package-lock.json 25 August 2022, 06:14:30 UTC
8d7ad8c fix(50375): Errors for missing enum-named properties should attempt to preserve names (#50382) * fix(50375): preserve enum-named properties * add AllowComputedPropertyEnums option * use bit shifting * rename AllowComputedPropertyEnum -> WriteComputedProps * mark WriteComputedProps as internal * mark symbolToNode as internal 24 August 2022, 18:54:44 UTC
fb717df Discard union types before considering weak type checks on unit-like types (#50423) * Only check isUnitType when dealing with non-unions. * Add test case. * Accepted baselines. 24 August 2022, 18:39:00 UTC
b9a5bbc Syntax operations also need to ensure project is present for the open script infos since update could be pending to make sure open script info has project (#50418) Also convert one relevant test case to baseline Fixes #50131 24 August 2022, 17:28:23 UTC
1d4fbbb Update package-lock.json 24 August 2022, 06:08:31 UTC
44ce3cf fix(50224): Intellisense for strings within a type's Union doesn't work properly for JSX (#50231) * fix(50224): show string literal completions in JsxAttributeInitializer * add feedback changes 23 August 2022, 21:59:10 UTC
6ee5db9 Use package.json files array instead of .npmignore (#50408) 23 August 2022, 21:14:20 UTC
f88117d Update package-lock.json 23 August 2022, 06:14:21 UTC
12c3255 Split CI linting/playwright out into separate jobs (#50406) 23 August 2022, 00:42:29 UTC
4605d89 Use a mapped type to enforce type-safety on `forEachChild`. (#50409) 23 August 2022, 00:30:44 UTC
6362fb2 Replace eslint rulesdir with eslint-plugin-local, convert eslint rules to JS (#50380) 22 August 2022, 20:46:03 UTC
aaa4f9d Make canHaveModifiers/Decorators public (#50399) 22 August 2022, 19:01:17 UTC
3f7ff15 Update package-lock.json 22 August 2022, 06:08:09 UTC
76357ba Swap `forEachChild` to use a table of functions instead of a `switch` statement. (#50225) * Swap `forEachChild` to use an array of functions instead of a `switch` statement. * Let's see if 'new' changes anything. * Co-locate each assignment into `forEachChildTable`. * Try `push`ing undefined to create a packed Array. * Try using an unconditional no-op function. * `forEach` -> `forEachChildIn` * Remove the optional chain if we are pre-filling with no-ops. * Grab function directly to avoid possible `.call` overhead from downlevel emit. * Swap to object literal. * Lints and formatting. 22 August 2022, 00:48:45 UTC
38e91fb LEGO: Merge pull request 50389 LEGO: Merge pull request 50389 21 August 2022, 10:07:27 UTC
7cab345 Update package-lock.json 21 August 2022, 06:07:14 UTC
50041bd Update package-lock.json 20 August 2022, 06:06:43 UTC
6cbb39b Re-caret dependencies so deps like eslint continue to be bumped (#50368) 19 August 2022, 19:58:54 UTC
284837d Fixes for `decorators` property deprecations (#50343) * Change type of deprecated 'decorators' property * fix 'Invalid Arguments' error for create/update constructor in factory * Update deprecation comments * Make 'decorators' optional and 'undefined' * Rename '_decorators' to 'illegalDecorators' * Update baselines 19 August 2022, 18:27:26 UTC
ef88fbb Remove some unused deps and dead code (#50367) 19 August 2022, 16:42:14 UTC
5969ae9 fix(50075): do not strip undefined from the function class properties (#50169) 19 August 2022, 16:34:42 UTC
05d7d6b Unify default import resolution across specifier target codepaths (#49814) * Unify default import resolution across specifier target codepaths * Use differing type aliases, per request 19 August 2022, 09:25:41 UTC
cb63d46 Update package-lock.json 19 August 2022, 06:07:20 UTC
1f0f7c8 If resolvedFileName differs with realPath only in casing use the resolvedFileName before realpath so that errors can be reported with forceConsistentCasingInFileNames (#50364) * Add tests when realpath supresses the casing error * Fix when real path results in value that differs only in case Fixes #49470 * Comment 18 August 2022, 21:51:46 UTC
ea36fb3 mark Intl.LocalesArgument as readonly (#50135) 18 August 2022, 21:38:41 UTC
1592210 Add a jump-table for visitEachChild (#50266) * Add a jump-table for visitEachChild * Name each visitor function for better stack traces * Fix node tests and some minor cleanup 18 August 2022, 19:03:17 UTC
7bafbea Add fourslash function for validating syntactic classification (#50362) 18 August 2022, 18:28:08 UTC
df25b77 Run eslint at root, rather than on src and scripts individually (#50327) 18 August 2022, 18:24:10 UTC
42165a1 LEGO: Merge pull request 50353 LEGO: Merge pull request 50353 18 August 2022, 10:12:12 UTC
66d8b95 Ensure all scripts are checked, fix errors (#50326) 17 August 2022, 23:42:50 UTC
15f7b6f LEGO: Merge pull request 50337 LEGO: Merge pull request 50337 17 August 2022, 10:02:07 UTC
745da27 Update package-lock.json 17 August 2022, 06:06:59 UTC
3b80ddc fix first match in `RegExpMatchArray` being possibly undefined when `noUncheckedIndexedAccess` is enabled (#49682) * fix first match in `RegExpMatchArray` being possibly undefined when `noUncheckedIndexedAccess` is enabled * fix tests * add test Co-authored-by: DetachHead <detachhead@users.noreply.github.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> 16 August 2022, 17:12:12 UTC
330e33c Ignore related info in diagnostic deduplication (#50309) * Ignore related info in diagnostic deduplication * Add another test 16 August 2022, 16:28:59 UTC
f24f74e 🔨 Fix missing "Implement interface" code fix for mapped types with implicit `keyof T` in their definition (#49999) * ⚗️ Add test to verify code fix works when implementing a mapped type with indirect keyof Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com> * 🔨 Add property as implementation for symbols that has no declaration Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com> diff --git a/src/services/codefixes/helpers.ts b/src/services/codefixes/helpers.ts index 94b64e57..a4c11fd5 100644 --- a/src/services/codefixes/helpers.ts +++ b/src/services/codefixes/helpers.ts @@ -60,21 +60,19 @@ namespace ts.codefix { isAmbient = false, ): void { const declarations = symbol.getDeclarations(); - if (!(declarations && declarations.length)) { - return undefined; - } + const declaration = declarations ? declarations[0] : undefined; const checker = context.program.getTypeChecker(); const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); - const declaration = declarations[0]; + const kind = declaration?.kind ?? SyntaxKind.PropertySignature; const name = getSynthesizedDeepClone(getNameOfDeclaration(declaration), /*includeTrivia*/ false) as PropertyName; - const visibilityModifier = createVisibilityModifier(getEffectiveModifierFlags(declaration)); + const visibilityModifier = createVisibilityModifier(declaration ? getEffectiveModifierFlags(declaration) : ModifierFlags.None); const modifiers = visibilityModifier ? factory.createNodeArray([visibilityModifier]) : undefined; const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); const optional = !!(symbol.flags & SymbolFlags.Optional); const ambient = !!(enclosingDeclaration.flags & NodeFlags.Ambient) || isAmbient; const quotePreference = getQuotePreference(sourceFile, preferences); - switch (declaration.kind) { + switch (kind) { case SyntaxKind.PropertySignature: case SyntaxKind.PropertyDeclaration: const flags = quotePreference === QuotePreference.Single ? NodeBuilderFlags.UseSingleQuotesForStringLiteralType : undefined; @@ -88,13 +86,16 @@ namespace ts.codefix { } addClassElement(factory.createPropertyDeclaration( modifiers, - name, + declaration ? name : symbol.getName(), optional && (preserveOptional & PreserveOptionalFlags.Property) ? factory.createToken(SyntaxKind.QuestionToken) : undefined, typeNode, /*initializer*/ undefined)); break; case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: { + if (!declarations) { + break; + } let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); const allAccessors = getAllAccessorDeclarations(declarations, declaration as AccessorDeclaration); const orderedAccessors = allAccessors.secondAccessor @@ -138,6 +139,10 @@ namespace ts.codefix { // If there is more than one overload but no implementation signature // (eg: an abstract method or interface declaration), there is a 1-1 // correspondence of declarations and signatures. + if (!declarations) { + break; + } + const signatures = checker.getSignaturesOfType(type, SignatureKind.Call); if (!some(signatures)) { break; * 🔨 Improve code readability Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com> diff --git a/src/services/codefixes/helpers.ts b/src/services/codefixes/helpers.ts index 2f5c8703ab..aea0206a8a 100644 --- a/src/services/codefixes/helpers.ts +++ b/src/services/codefixes/helpers.ts @@ -60,7 +60,7 @@ namespace ts.codefix { isAmbient = false, ): void { const declarations = symbol.getDeclarations(); - const declaration = declarations ? declarations[0] : undefined; + const declaration = declarations?.[0]; const checker = context.program.getTypeChecker(); const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); const kind = declaration?.kind ?? SyntaxKind.PropertySignature; @@ -93,9 +93,7 @@ namespace ts.codefix { break; case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: { - if (!declarations) { - break; - } + Debug.assertIsDefined(declarations); let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); const allAccessors = getAllAccessorDeclarations(declarations, declaration as AccessorDeclaration); const orderedAccessors = allAccessors.secondAccessor @@ -139,10 +137,7 @@ namespace ts.codefix { // If there is more than one overload but no implementation signature // (eg: an abstract method or interface declaration), there is a 1-1 // correspondence of declarations and signatures. - if (!declarations) { - break; - } - + Debug.assertIsDefined(declarations); const signatures = type.isUnion() ? flatMap(type.types, t => t.getCallSignatures()) : type.getCallSignatures(); if (!some(signatures)) { break; * 📜 Add comment regarding mapped type children's missing declaration Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com> Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com> Co-authored-by: Andrew Branch <andrew@wheream.io> 16 August 2022, 16:27:29 UTC
90fa1c7 Update baseline after out-of-order merge (#50320) 16 August 2022, 15:54:55 UTC
9767f51 Update package-lock.json 16 August 2022, 06:06:30 UTC
4e33e0e Make literal types not comparable to weak object types without property overlap (#49865) 16 August 2022, 00:10:11 UTC
64ee1e8 Strip literal freshness of contextually typed literals (#49884) * Strip literal freshness of contextually typed literals * Add more tests 16 August 2022, 00:04:09 UTC
9c1baee On windows handle the long paths in realpathSync.native (#50306) Fixes #49470 15 August 2022, 23:57:47 UTC
e989d84 Forward intersectionState flag when comparing indexed access constraints (#50261) 15 August 2022, 23:10:32 UTC
8a873de fix(49149): remove unneeded array overload to Object.freeze (#50029) * fix(49149): remove unneeded array overload to Object.freeze * chore: commit baseline changes Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Co-authored-by: Andrew Branch <andrew@wheream.io> 15 August 2022, 23:10:02 UTC
61d8a8d fix(49629): fix crash in find-all-refs when using module.exports/export= with arrays/primitives (#50291) 15 August 2022, 22:14:26 UTC
bc52ff6 Make `React` import fix not block component import fix (#50307) * Stop React import fix from blocking component import fixes * Add additional promote-type-only test 15 August 2022, 20:13:41 UTC
fd3c46b Fix export = error message to not have redundant language (#50308) 15 August 2022, 20:13:33 UTC
9f7c0cb Run ESLint over our JS files, fix all lints (#50172) 15 August 2022, 15:42:26 UTC
03b12a6 LEGO: Merge pull request 50298 LEGO: Merge pull request 50298 14 August 2022, 10:10:53 UTC
656d6a5 Update package-lock.json 14 August 2022, 06:06:50 UTC
7f5600e LEGO: Merge pull request 50295 LEGO: Merge pull request 50295 13 August 2022, 12:07:02 UTC
adf26ff Revert "Fixed an issue with contextual type for intersection properties (#48668)" (#50279) This reverts commit 9236e39374c0ec9a1e3f9894af4fb9eb34ba0021. 12 August 2022, 17:24:50 UTC
8783da8 Update package-lock.json 12 August 2022, 06:06:46 UTC
b19741c Report aggregate statistics for solution as well as some solution perf numbers (#50267) * Report aggregate statistics for solution as well as some solution perf numbers This change under --extendedDiagnostics aggregates the diagnostics from all projects built and reports it at the end. Apart from that it also outputs some measurements for work that happens in tsc --build like finding if projects are uptodate etc. Also removes unnecessary node count per suggestion * Apply suggestions from code review Co-authored-by: Ron Buckton <ron.buckton@microsoft.com> * Fix condition * Remove extra time Co-authored-by: Ron Buckton <ron.buckton@microsoft.com> 11 August 2022, 20:20:48 UTC
075ee3d refactor: follow gh-50257 JSX.IntrinsicClassAttributes logic (#50271) 11 August 2022, 16:32:31 UTC
9189e42 Update package-lock.json 11 August 2022, 06:06:47 UTC
e2fbe19 fix: produceLKG does not work on Windows (#50140) 11 August 2022, 03:12:17 UTC
924c68c use cache for program creation on watch mode. (#49958) 10 August 2022, 23:56:54 UTC
90cfbae Make build info tolerant to json errors (#50265) * Make build info tolerant to json errors Fixes #49754 * Fix incorrect code 10 August 2022, 23:44:35 UTC
8a24fe7 Fix up code so we don't crash when TS itself is emitted with let/const (#50151) 10 August 2022, 20:38:38 UTC
b56483f Remove shims project (#50049) 10 August 2022, 18:49:59 UTC
7f1dc78 Simplify normalizeSlashes (#50154) 10 August 2022, 18:20:00 UTC
5fbf3b0 Don't treat object properties as potential JS contructors without JSDoc class tag (#49735) 10 August 2022, 18:19:19 UTC
382f0c3 fix: crashes when JSX.IntrinsicClassAttributes is an alias type close GH-50254 (#50257) 10 August 2022, 17:41:12 UTC
3c3909b update baseline (#50252) 10 August 2022, 08:52:59 UTC
5f64ae8 Update package-lock.json 10 August 2022, 06:07:48 UTC
35c6fbf JSDoc @type tag optional parameters (#48132) * JSDoc @type tag optional parameters * Don't repeat isInJSFile() condition * Exclude variable initializers * Add tests for class methods * Don't contextually type JS function declarations * Update Baselines and/or Applied Lint Fixes * Reword comment Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com> 10 August 2022, 00:03:30 UTC
2513a2d Use binary search in file system cache (#50163) * Use binary search in file system cache Previously, we were linear searching a linear number of times, resulting in too many `toLowerCaseFileName` calls on Windows. * Use SortedArray types for clarity * Use insertSorted after making it return a flat * Drop redundant undefined * Correct copy-paste error 09 August 2022, 23:47:07 UTC
af90e70 feat(49903): omit declare on type declarations (#49925) 09 August 2022, 23:38:42 UTC
b94b299 fix CFA for BindingElement. #49759 (#49836) * fix CFA for BindingElement. #49759 * fix Parameter * fix controlFlowBindingPatternOrder * fix bindParameterFlow * add tests * refactor * refactor * refactor 09 August 2022, 23:37:39 UTC
dd98c17 Merge multiple symbols even when re-exported (#49987) * Merge multiple symbols even when re-exported As far as I remember, the target of `mergeSymbol` needs to be a merged symbol, not a symbol with a mergeId that points to mergedSymbol. However, mergeSymbolTable didn't check for this. I can't remember if symbol tables may contain symbols-with-mergeId. If they can, then mergeSymbolTable needs to call getMergedSymbol on the individual targets of the merge. That's what I did in this PR. * Call getMergeSymbol eagerly On the source, not target, of mergeSymbolTable's contents 09 August 2022, 23:36:53 UTC
abc2a35 Fix System module `export import =` (#49788) * Add more SystemJS test case * Fix System module `export import =` * Update test case 09 August 2022, 23:31:02 UTC
e5b400c Fix misleading Date constructor documentation (addresses #49350) (#49649) * Update month parameter to monthIndex and add docs for Date constructor Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net> * Add baseline changes Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net> * Fix misleading Date constructor documentation (addresses #49350) (#73) * Update month parameter to monthIndex and add docs for Date constructor Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net> * Add baseline changes Signed-off-by: jmorrison152 <jmorrison152@bloomberg.net> * Update baselines 09 August 2022, 23:21:56 UTC
f70cb76 feat(49928): Provide quick fix for a missing callback function (#49930) * feat(49928): provide quick fix for a missing callback function * remove addFunctionDeclarationFromSignature. fix formatting * add tests 09 August 2022, 22:28:03 UTC
a123fc5 feat(lib/es2015): Add typed overloads to `Reflect` (#35608) Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> 09 August 2022, 22:05:33 UTC
19e2a31 feat(49834): Suggestion: filter enum member ids from their own jsdocs (#49843) * feat(49834): omit self-referenced enum declaration in JsDoc * change code style 09 August 2022, 22:02:45 UTC
6aa9b87 Bump version to 4.9. (#50239) 09 August 2022, 20:33:52 UTC
back to top