Commit Graph

897 Commits

Author SHA1 Message Date
vuittont60 2e660bc174 Fix typos (#56115) 2023-10-16 09:37:15 -07:00
Sheetal Nandi ec1414f627 Source files not affected by all module resolution options (#55790) 2023-09-20 16:45:32 -07:00
Jake Bailey 1a68590c9c Mark more options as affecting errors/resolution (#53403)
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2023-09-19 15:11:21 -07:00
Sheetal Nandi 3ade5022d7 Fix file matching with tsx and dts of same name are included by include patterns (#55690) 2023-09-12 13:10:34 -07:00
Jake Bailey b5b6048bb3 Clean up helpers which are always present in ES2020 (#55515) 2023-08-28 12:26:22 -07:00
Sampo Kivistö ec2bd4e252 perf: replace String and Array indexOf method calls with includes method call (#55482) 2023-08-25 11:27:55 -07:00
Jake Bailey 5e8c261b6a dprint the codebase (#54820) 2023-08-16 14:26:38 -07:00
Jake Bailey 3b43d841d1 Enable eslint rules prefer-rest-params and prefer-spread (#55181) 2023-08-11 15:07:06 -07:00
Oleksandr T 30fe6ada02 fix(55227): useUnknownInCatchVariables sets default value differently to other strict commandline options (#55230) 2023-08-02 11:32:46 -07:00
Andrew Branch 5932420b0f Fix self-name input linking for --allowJs --declaration projects (#54819)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-07-03 11:17:07 -07:00
Oleksandr T bc91920cc6 feat(53461): Implement decorator metadata proposal (#54657) 2023-06-23 10:55:22 -04:00
Ron Buckton f9cf8216c6 Support using and await using declarations (#54505) 2023-06-22 17:02:56 -04:00
leoelm eeed72171f Type definitions for 'Symbols as WeakMap keys' (#76) (#54195)
Signed-off-by: Leo Elmecker <lelmeckerpla@bloomberg.net>
2023-06-09 14:20:26 -04:00
João Nuno Mota 0d262616f3 Add extra Date.UTC signature to reflect ES2017 changes (#54125) 2023-05-22 16:23:08 -07:00
Andrew Branch b29ed18466 Ignore allowImportingTsExtensions in transpileModule to suppress option validation error with noEmit (#53599) 2023-03-31 09:10:49 -07:00
David Sherret 1761a67ff8 perf: ensure compiler options affecting semantic diagnostics get included in build info (#53423) 2023-03-22 09:54:17 -07:00
Sheetal Nandi 377c4ce32f Refactor config file syntax search to callback model instead of constructing arrays to iterate over (#53416) 2023-03-21 11:23:36 -07:00
Sheetal Nandi 8814f6da48 Report error if commanline only option is specified in tsconfig (#53397) 2023-03-20 13:26:04 -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 86f8114404 Revert PR #53301 (#53366) 2023-03-19 21:29:17 -07:00
Mateusz Burzyński d458e30a06 Rewrite getPropFromRaw slightly to surface T in the parameters (#53301) 2023-03-19 20:01:16 -07:00
Jake Bailey 6b75ce23ce Completely remove Push type (#52133) 2023-03-01 09:34:59 -08:00
Jake Bailey d63d081e37 Mark allowArbitraryExtensions as affectsProgramStructure (#52437) 2023-01-26 13:40:19 -08:00
Ryan Cavanaugh ff92ab0ac9 Change default newLine, forceConsistentCasingInFileNames (#52298)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2023-01-20 17:20:26 -08:00
Sheetal Nandi a097d55f81 Remove long deprecated typingOptions and enableAutoDiscovery (#52339) 2023-01-20 15:39:57 -08:00
Andrew Branch cfe1842adf Add verbatimModuleSyntax, deprecate importsNotUsedAsValues and preserveValueImports (#52203) 2023-01-19 16:56:30 -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
Andrew Branch 436833aba1 Allow allowImportingTsExtensions to be set in any module resolution mode (#52230) 2023-01-17 15:13:17 -08:00
navya9singh f6fc444b33 Fix(51828): extends field in tsconfig.json does nothing with empty string (#51981) 2023-01-17 12:31:23 -08:00
Mykola Basov cb4c7689e6 Add Array.prototype.findLast() and Array.prototype.findLastIndex() (#49636)
Signed-off-by: mbasov2 <mbasov2@bloomberg.net>
2023-01-13 15:35:50 -08:00
Wesley Wigham 89e928e8b4 Add --allowArbitraryExtensions, a flag for allowing arbitrary extensions on import paths (#51435) 2023-01-09 17:12:42 -08:00
Jake Bailey f1ff0de943 Use native generators/iterables, remove helper cruft (#51921) 2023-01-06 14:40:56 -08:00
Jake Bailey bfeb927d43 Remove Push from public API (#52122) 2023-01-05 16:18:53 -08:00
Ron Buckton f43cd0acca Add RegExp indices and hasIndices (#52085)
* Add RegExp indices
* update --lib message
* newlines
* implement changes
* Fix failing tests

Thanks @xiBread!
2023-01-03 15:20:10 -05: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
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
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
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
Ryan Cavanaugh 4978b3ebeb Properly detect explicitly-set targets (#51834) 2022-12-09 10:31:51 -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
Jake Bailey 9f64a3a58c Remove ts.{Map,Set,ESMap,Iterator} and associated types (#51439) 2022-11-09 15:06:31 -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
Jake Bailey 9a0b85ce2a Generated module conversion step - explicitify
This step makes all implicit namespace accesses explicit, e.g. "Node" turns into "ts.Node".
2022-11-07 13:29:05 -08:00