Commit Graph

1899 Commits

Author SHA1 Message Date
Andrew Branch 660bf60cca Make module, not moduleResolution, the trigger for setting impliedNodeFormat 2023-06-26 11:45:35 -07:00
Ron Buckton f9cf8216c6 Support using and await using declarations (#54505) 2023-06-22 17:02:56 -04:00
Wesley Wigham 02bb3108ad JSX namespace names should not be considered expressions (#54104) 2023-05-09 10:45:58 -07:00
Jake Bailey c333e14578 Ensure that JSDoc parsing happens within a ParsingContext (#52710) 2023-05-04 09:55:34 -07:00
Nathan Shively-Sanders 840a0bfc08 Error on template tag inside callback/overload/typedef tag (#54118) 2023-05-04 09:51:43 -07:00
Nathan Shively-Sanders 063276aac9 Bind JSDoc on SemicolonClassElement (#54044) 2023-04-27 11:47:16 -07:00
Oleksandr T c74efad46e fix(53645): JSDoc extends doesn't work with multiple lines (#53705) 2023-04-20 16:06:38 -07:00
Oleksandr T 0c5be02dcc feat(7411): JSX namespaced attribute syntax not supported (#47356) 2023-04-14 16:58:49 -07:00
Jake Bailey f243b987af Fix crash in parseJsxChild found by fuzzing (#53674) 2023-04-05 13:47:02 -07:00
Jake Bailey bebb6d0086 Disable JSX recovery hack when in unary expression context (#53666) 2023-04-05 13:04:37 -07:00
形素叢集・ぐらふぃーむ c2dc2fd9b9 fix(396): (Dis)allow Octal and Bad Escape Sequences in String and (Tagged) Template Literals (#51837) 2023-03-24 16:15:50 -07:00
Jake Bailey ac55b297b7 Upgrade "boolean-trivia" lint to new "argument-trivia" lint that uses type info, has quick fixes, etc. (#53002) 2023-03-23 16:26:39 -07:00
Jake Bailey 79a414bb5e Consistently use '...args' for diagnostic args (#53193) 2023-03-20 12:53:09 -07:00
Sheetal Nandi 7a8238d88d Refactor config file parsing such that json and jsonSourceFile api use same paths (#53331) 2023-03-20 12:00:08 -07:00
Jake Bailey 913f65c28d Remove most "import * as ts" imports, except for const enum reverse mapping and plugins (#53329) 2023-03-20 10:50:40 -07:00
Jake Bailey a727ca1571 Make perfLogger potentially undefined rather than using a noop logger (#53229) 2023-03-15 15:58:26 -07:00
Nathan Shively-Sanders 137c461bd0 Scan bigger/fewer jsdoc tokens (#53081) 2023-03-07 16:32:04 -08:00
Nathan Shively-Sanders ff1e08f859 Rename scanner token methods (#53078) 2023-03-07 13:54:44 -08:00
Daniel Rosenwasser 3f7bf69ddf Destructure common factory methods in the parser. (#52920) 2023-02-24 12:52:30 -08:00
Jake Bailey 718e63b9c9 Add links to github above big var blocks (#52925) 2023-02-22 17:01:15 -08:00
Jake Bailey 3267c76777 Fix debug assert for type assertions / JSX (#52919) 2023-02-22 11:05:50 -08:00
Daniel Rosenwasser 04637662f4 Switch let/const to var in the scanner & parser for top-levelish variables. (#52832) 2023-02-17 17:07:11 -08:00
Jake Bailey a3a4993937 Don't parse out a name for JSX fragments (#52818) 2023-02-17 10:55:56 -08:00
Ron Buckton 55eff14353 Fix crash in extract type and generate get/set refactors (#52803) 2023-02-16 16:15:54 -05:00
Ron Buckton 2c67c8f756 Enforce NLT restriction after 'accessor' keyword (#52763) 2023-02-15 12:51:25 -05:00
Ron Buckton 6c9792aa87 Decorators normative changes (#52582) 2023-02-09 14:48:45 -05:00
Jake Bailey 0ef9e8eac9 Ensure we treat "type assertions" as JSX within a unary expression (#52667) 2023-02-09 11:34:47 -08:00
João Santos fb70d44a08 fix/52457: remove extra the from TS(2809) (#52541) 2023-02-01 09:46:01 -08:00
Jake Bailey 95840557bf Prevent valid JSX from being seen as the start of a generic arrow function, fix crashes (#52450) 2023-01-31 16:55:48 -08:00
Ron Buckton 5b18979697 Implement the Stage 3 Decorators Proposal (#50820) 2023-01-19 17:54:12 -05:00
Jake Bailey 22b362ceac Enable strictFunctionTypes (#49929) 2023-01-17 17:20:51 -08:00
Oleksandr T 9c9d4b029d feat(51086): satisfies support in JSDoc (#51753) 2023-01-17 10:22:22 -08:00
Ron Buckton 9cdba994ac Remove some properties from Identifier (#52170) 2023-01-12 17:20:12 -05:00
Wesley Wigham 89e928e8b4 Add --allowArbitraryExtensions, a flag for allowing arbitrary extensions on import paths (#51435) 2023-01-09 17:12:42 -08:00
Ron Buckton 90fb764a0f Fix private name generation and missing emit for auto-accessors (#52132) 2023-01-06 21:08:51 -05:00
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
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 f8fd1fd29f.

* 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
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
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
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
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
Jake Bailey 00dc0b6674 Flip imports to case insensitive sorting (#51579) 2022-11-17 15:35:28 -08:00
Jake Bailey 2d2a4343b8 Reformat imports to be one identifier per line (#51565) 2022-11-17 13:42:18 -08:00
Sheetal Nandi c5aea89230 Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined (#51482)
* Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined

* ResolutionMode | undefined = ResolutionMode

* More
2022-11-10 16:47:46 -08:00
Jake Bailey 9f64a3a58c Remove ts.{Map,Set,ESMap,Iterator} and associated types (#51439) 2022-11-09 15:06:31 -08:00
Jake Bailey db440d8468 Directly import namespaces for improved esbuild output
I should report this upstream, if I can manage to minimize this.
2022-11-07 13:36:08 -08:00
Jake Bailey c65142244c Add dts bundling
This adds a "small" d.ts bundler script. This script is very basic,
using Node printing to produce its output. Generally speaking, this is
inadvisable as it completely disregards name shadowing, globals, etc.
However, in our case, we don't care about the globals, and we can opt to
restructure our codebase in order to avoid conflict, which we largely
had to do anyway when we were namespaces and everything was in scope.
2022-11-07 13:35:48 -08:00
Jake Bailey d12116d8da Fix all internal JSDoc comments
If these are regular comments, then they won't appear in our d.ts files.
But, now we are relying on an external d.ts bundler to produce our final
merged, so they need to be present in the "input" d.ts files, meaning
they have to be JSDoc comments.

These comments only work today because all of our builds load their TS
files from scratch, so they see the actual source files and their
non-JSDoc comments.

The comments also need to be attached to a declaration, not floating,
otherwise they won't be used by api-extractor, so move them if needed.
2022-11-07 13:34:44 -08:00
Jake Bailey 07758c08ab Generated module conversion step - inlineImports
This step converts as many explicit accesses as possible in favor of direct imports from the modules in which things were declared. This restores the code (as much as possible) back to how it looked originally before the explicitify step, e.g. instead of "ts.Node" and "ts.Symbol", we have just "Node" and "Symbol".
2022-11-07 13:33:07 -08:00
Jake Bailey b6c0538826 Generated module conversion step - stripNamespaces
This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.

The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
2022-11-07 13:32:03 -08:00