34166 Commits

Author SHA1 Message Date
Oleksandr T
44152bc22e
fix(29648): Error message related to JSDoc for non-JSDoc syntax error (#50793)
* fix(29648): improve diagnostics of non-JSDoc syntax errors

* fix lint errors

* update tests

* change diagnostic type suggestion. fix QF for jsdoc nullable type

* move error handling from the parser to the checker

* change diagnostic message. remove speculative parsing

* update baseline
2022-12-29 16:50:57 -08:00
Oleksandr T
ba393b6b9f
fix(51760): Nullish-coalescing assignment narrows type to assigned value (#51767)
* fix(51760): skip type guard errors for narrowed nullish-coalescing assignment

* update tests
2022-12-29 16:36:59 -08:00
ronyhe
c7f49bceed
Add undefined to JSON.stringify return type (#51897)
* First attempt

* Revert "First attempt"

This reverts commit 23f641cddbcb6b55eec764eb6b3895beba731c38.

* Second try

* Accept baslines
2022-12-28 09:06:03 -08:00
TypeScript Bot
df6881725c Update package-lock.json 2022-12-28 06:06:36 +00:00
TypeScript Bot
68df4befd6 Update package-lock.json 2022-12-27 06:06:39 +00:00
Anders Hejlsberg
acf854b636
Keep track of multiple current inference contexts (#51978)
* Keep track of multiple current inference contexts

* Add regression test
2022-12-22 07:52:49 -10:00
TypeScript Bot
54a554d8af Update package-lock.json 2022-12-21 06:06:30 +00:00
Andreas Buob
8b6f8730c1
fix(51223): Go-to-definition for yield and await keyword; jump to respective function definition (#51838) 2022-12-20 13:29:59 -08:00
Oleksandr T
e73a51d5d7
fix(51820): disallow using readonly and declare with auto-accessor (#51824) 2022-12-20 13:25:33 -08:00
Oleksandr T
6f4d340458
fix(51716): find all references in imported JSDoc types (#51729) 2022-12-20 13:16:17 -08:00
Mateusz Burzyński
cf68a12d69
Improve string literal completions for property values when a partially-typed string fixes inference to a type parameter (#51770) 2022-12-20 13:08:55 -08:00
TypeScript Bot
5d8ef4bdcb Update package-lock.json 2022-12-20 06:06:31 +00:00
Andrew Branch
714d7341cf
--moduleResoltuion bunlder: Allow import assignment in ambient contexts (#51971) 2022-12-19 17:03:50 -08:00
Oleksandr T
5951ee9cff
feat(48665): tsconfig "extends" field ignores "exports" field of source package (#50955)
* feat(48665): resolve configs from the exports field of the source package

* add missed property

* rename loadFileName to loadFileNameFromPackageJsonField

* Apply suggestions from code review

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-12-19 16:40:12 -08:00
Gabriela Araujo Britto
0f5e037e1d
pass isSingle quote preference when building string literal (#51968) 2022-12-19 15:39:39 -08:00
Ron Buckton
eb1e257072
Support outlining in multiline import/export decls (#51937) 2022-12-19 15:22:43 -08:00
Jake Bailey
ef70a289b8
Go back to using explicit node verisons in CI (#51965)
Fixes https://github.com/microsoft/TypeScript/issues/51943
2022-12-19 15:20:06 -08:00
TypeScript Bot
70ee780785 Update package-lock.json 2022-12-18 06:06:23 +00:00
Anders Hejlsberg
02d5b23aae
Allow const modifiers on class expression type parameters (#51935)
* Allow `const` modifiers on class expression type parameters

* Add regression test
2022-12-17 10:32:27 -08:00
TypeScript Bot
4932c8788b Update package-lock.json 2022-12-17 06:06:43 +00:00
Anders Hejlsberg
fede84e85b
const modifier on type parameters (#51865)
* `const` modifier on type parameters + revised contextual type logic

* Accept new baselines

* Fix modifier checking

* Add tests

* Cache isConstTypeVariable check

* Revert "Cache isConstTypeVariable check"

This reverts commit f8fd1fd29f7975fcc3aeac8675c2cb107da33065.

* Fewer isConstTypeParameterContext checks

* Pay attention to cached `undefined` contextual type

* Allow `const` modifier in more places + properly print back

* Also permit `const` in method signature type parameters

* Fix parsing of `const` modifier in array expression type parameters

* Accept new baselines

* Remove unused properties from NodeLinks

* Rename `permitInvalidConstAsModifier` to `permitConstAsModifier`
2022-12-16 13:47:10 -08:00
Josh Goldberg
2484390af8
Added override keyword to codefix implemented abstract methods (#51033)
* Added override keyword to codefixed implemented abstract methods

* Only when noImplicitOverrides is true, and always check abstract modifier

* Added test on abstract/override already being there

* Added back a few test cases

* Check declaration modifier, not class modifier
2022-12-16 11:59:21 -08:00
Oleksandr T
193a8a74c8
skip optional parameters in js files (#51924) 2022-12-16 11:51:41 -08:00
Oleksandr T
645b3ddb06
fix(51920): skip TypeScript types in js files (#51922) 2022-12-16 10:35:35 -08:00
Oleksandr T
20f3060da5
Add JSDocOverloadTag to ForEachChildTable (#51907)
* add JSDocOverloadTag to ForEachChildTable

* fix tests

* change imports order
2022-12-16 08:41:32 -08:00
Anders Hejlsberg
ba793e6069
Fix excess property checking for intersections with index signatures (#51894)
* Fix excess property checking for intersections with index signatures

* Add regression tests

* Limit check to only fresh object literals on the source side
2022-12-16 06:59:23 -08:00
Oleksandr T
ff919e3b76
Remove isJSDocOptionalParameter and isOptionalDeclaration from public API (#51908) 2022-12-15 11:45:17 -08:00
Ron Buckton
44e8244dd9
Move auto-generated identifier info into separate object (#51900) 2022-12-15 13:59:57 -05:00
Oleksandr T
fe185272cf
feat(51000) - Flag Deprecation Plan (#51424)
* feat(51000): add ignoreDeprecations option

* use constants of versions

* change the ignoreDeprecations type to allow only one value - '5.0'

* add tests

* update baseline

* add typeScriptVersion to CreateProgramOptions

* update baseline

* change diagnostic message
2022-12-15 10:44:06 -08:00
Andrew Branch
e0bfac531b
Rename module resolution option node to node10 (preserving backward-compatible alias) (#51901)
* Rename `node` to `node10` (preserving alias)

* Revert dogfooding change because of LKG

* Update baselines
2022-12-15 10:07:33 -08:00
Ron Buckton
2993ea8eaa
Monomorphic Symbol access (#51880) 2022-12-15 10:44:24 -05:00
TypeScript Bot
b9aa8a4096 Update package-lock.json 2022-12-15 06:06:25 +00:00
Tomasz Lenarcik
aa2781d44f
Add missing type argument constraints check (#51766)
* Add missing type argument constraints check

* Leverage existing routine for obtaining typeParameters
2022-12-14 11:20:57 -08:00
TypeScript Bot
eb9252ed9e Update package-lock.json 2022-12-14 06:06:59 +00:00
Tomasz Lenarcik
e4816ed44c
JSDoc overload tag (#51234)
* Add support for JSDocOverloadTag

* Use overload tag to determine function type

* Update baselines

* Add new tests along with baselines

* Add tests for all @overload tags in one comment

* Add tests for find-all-ref and rename operations

* Add tests for alternative uses of @overload tag

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-12-13 15:10:40 -08:00
Andrew Branch
4076ff8fd6
Add option for organize imports case sensitivity (#51733)
* Add ignore case option to organizeImports

* Adopt in auto-imports, use same case-insensitive comparison as eslint

* Fix build/lint

* Mark functions internal

* Update affected auto import test

* Update API baseline

* Update protocol

* Update API baseline

* Short-circuit comparisons that have already failed
2022-12-13 14:37:29 -08:00
Andrew Branch
a5dde88dce
--moduleResolution bundler (formerly known as hybrid) (#51669)
* WIP

* Add extension error back unless noEmit is set

* Add non-relative tests

* Add error for importing from declaration file

* Update unit test

* Add explicit flag for importing from .ts extensions

* Add module specifier resolution changes

* Add auto-import tests

* Disallow relative imports into node_modules

* Ensure auto-imports don’t suggest ./node_modules;

* Test a non-portable declaration emit issue

* Test auto-importing TSX file

* Update path completions

* Fix lint due to merge

* Remove minimal-specific stuff

* Remove minimal tests

* Update unit tests

* Add options

* Add customConditions option

* Add first tests

* CJS constructs are not allowed

* Add another test

* Fix extension adding/replacing priority

* Update test to reflect the choice not to block on unrecognized extensions

* Add auto-imports and string completions tests

* Revamp string completions ending preferences

* Comment test

* Auto-imports of declaration files cannot use .ts extension

* Have declaration file auto imports default to extensionless instead

* Add test for custom conditions

* Fix indentation

* Add baseline showing resolvePackageJsonImports/Exports compatibility

* Fix test and prevent CJS require from resolving

* Update unit test baselines

* Fix bad merge conflict resolution

* Make resolvedUsingTsExtension optional

* Update missed baselines

* Revert now-unnecessary API implementation changes

* Clean up

* Update baselines to es5 emit

* Rename to `bundler`
2022-12-13 13:35:16 -08:00
Gabriela Araujo Britto
ad354c2d75
Don't include already-covered cases in switch completions (#51790)
* WIP: filter existing values in case completions

* filter existing enum symbols

* add comment

* fix lint errors

* update baselines

* add comment
2022-12-13 13:01:52 -08:00
Jake Bailey
0c23344a1e
Update esbuild to v0.16.5 and use new --packages=external option (#51877) 2022-12-13 12:47:36 -08:00
Ron Buckton
6d41964fd0
Reduce polymorphism resulting from unstable Node shapes (#51682)
* Move .symbol to Declaration

* simplify some factories

* Move localSymbol to Declaration

* Ensure JSDocContainer types are properly initialized

* Move contextualType from Node to NodeLinks

* Move 'locals' and 'nextContainer' out of Node

* Move 'flowNode' out of 'Node'

* Pre-define endFlowNode/returnFlowNode

* Pre-define some SourceFile properties and a more stable cloneNode

* Don't add excess properties to type nodes in typeToTypeNode

* Refactor wrapSymbolTrackerToReportForContext to improve perf
2022-12-13 15:11:10 -05:00
navya9singh
7267fcaeb9
Fix(29118): tsconfig.extends as array (#50403)
* tsconfig.extends as array

* Updated baselines

* Changes for pr

* Changes for pr comments

* Fixed formatting and edited a test

* Resolved errors after a merge conflict

* Added "string | list" type implentation

* Removed string | list type implementation

* Fixed formatting

* Added compiler test

* Resolving programUpdate errors

* Fixing commandLineParser error
2022-12-13 11:16:07 -08:00
Jake Bailey
a3802c1e7b
Remove excluded CodeQL rules, fix reference to Gulpfile (#51878)
Fixes https://github.com/microsoft/TypeScript/issues/51401
2022-12-13 11:01:27 -08:00
TypeScript Bot
41fa4d7edd Update package-lock.json 2022-12-13 06:07:58 +00:00
Oleksandr T
790c03d7b0
fix(47954): Auto implementation of interface with a constructor prop causes error (#50709)
* fix(47954): convert constructor property to computed name

* handle more nodes with constructor name
2022-12-12 15:28:03 -08:00
Oleksandr T
8f2a38f44b
fix(50117): Using @extends in JavaScript + JSDoc removes method documentations (#50256)
* fix(50117): show jsdoc from an inherited members

* show jsdoc from inherited members from class expressions
2022-12-12 15:22:03 -08:00
Oleksandr T
d54f52e0de
fix(50089): JSDoc/TSDoc @link with custom display text incorrectly shows vertical bar (#50106)
* fix(50089): omit | from jsdoc linkTag text

* change finding for the end pos of a link
2022-12-12 15:16:29 -08:00
Oleksandr T
708a522ddf
fix(49080): --exactOptionalPropertyTypes seems to be ignored for JSDoc types (#49910)
* fix(49080): handle JSDocPropertyTag as optional prop

* move condition to utility function isOptionalDeclaration

* add additional tests

* update baseline
2022-12-12 15:03:49 -08:00
Oleksandr T
355991c806
feat(49323): Render JSDoc @throws {type} as a link (#49891)
* feat(49323): add support throws jsdoc tag

* change "name" to "typeExpression". parse "exception" as a synonym for "throws"

* include typeExpression from the throws tag in the quick info

* add JSDocThrowsTag to ForEachChildNodes
2022-12-12 14:44:38 -08:00
TypeScript Bot
f1288c33a1 Update package-lock.json 2022-12-12 06:06:46 +00:00
TypeScript Bot
3be1a67f82 Update package-lock.json 2022-12-11 06:06:29 +00:00