Commit Graph
1361 Commits
Author SHA1 Message Date
Sheetal Nandi dde2085d0d Add check for actually present directories to make sure projects with config file can still share resolutions if they are not hoisting their own node_modules
This is still problem because every npm install will create new source files depending on how and when we do project update and program is not reused
2023-09-15 15:38:43 -07:00
c0b39c6967 Skip parsing JSDoc when not needed (#52921)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2023-09-13 15:58:20 -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
Sheetal Nandi 9261ca7a13 Share redirects cache key calculation between multiple caches used for module resolution and type reference directive (#55376) 2023-08-14 18:46:55 -07:00
Josh Goldberg ✨andJake Bailey 0ae8ca11d2 Updated typescript-eslint to v6 (#54693)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
2023-07-14 15:36:10 -07:00
Sheetal Nandi 5464403848 ParseConfigHost needs to extend ModuleResolutionHost (#54922) 2023-07-10 11:40:40 -07:00
Joshua Chen e4cc532e14 Make bodiless declarations an error in JS (#54439) 2023-06-30 16:53:51 -07:00
Oleksandr T de6e6abbac fix(54465): Broken emit with private field in class decorator (#54679) 2023-06-23 17:09:48 -04:00
Ron Buckton f9cf8216c6 Support using and await using declarations (#54505) 2023-06-22 17:02:56 -04:00
Andrew Branch d90eb0d731 Require module/moduleResolution to match when either is node16/nodenext (#54567) 2023-06-22 13:35:52 -07:00
Jack Works e60cf121ae Add check for reference-compared literals to JS files (#49164) 2023-06-12 16:02:25 -07:00
Sheetal Nandi 3c4c060dff Adds tests and fixes issues by verifying incremental project updates are handling language service ref counting correctly (#54504) 2023-06-06 11:11:14 -07:00
Sheetal Nandi 8b825f7aaa Handle module node found error reporting in incremental and watch scneario (#54115) 2023-05-09 13:42:26 -07:00
Sheetal Nandi ddd5084659 Add resolveLibrary method on hosts and store resolvedLibraries in program so that resolutions can be reused (#53877) 2023-04-20 13:50:22 -07:00
Sheetal Nandi bd4f40317c Library resolution should happen from config file directory if present just like auto type reference directive resolution (#53899) 2023-04-18 14:40:20 -07:00
Sheetal Nandi ece33b7b59 Trace lib resolutions if resolving using options.traceResolution (#53898) 2023-04-18 10:56:57 -07:00
Ryan Cavanaugh c89f87f66a Detect malformed UTF-8 files and refuse to engage further (#53667) 2023-04-07 12:51:47 -07:00
Andrew Branch f4be5b1321 Remove error on redundant isolatedModules/verbatimModuleSyntax combination (#53611) 2023-04-05 15:08:28 -07:00
Andrew Branch 9052ef895a Fix Go To Source Definition in --moduleResolution bundler (#53613) 2023-03-31 15:50:11 -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
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
Jake Bailey 79a414bb5e Consistently use '...args' for diagnostic args (#53193) 2023-03-20 12:53:09 -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 868331f2be Fix deprecations, improve messaging (#52993) 2023-03-07 09:39:45 -08:00
Jake Bailey 6fe711f85a Remove unused eslint-disable directives (#52987) 2023-02-27 11:01:37 -08:00
Daniel Rosenwasser 4374ffd628 Bump version to 5.1, fix 'ignoreDeprecations', and update baselines. (#52975) 2023-02-26 20:56:07 -08:00
Andrew Branch e9868e96e8 --moduleResolution bundler: Require ESM for module and remove node from hard-coded conditions (#52940) 2023-02-24 15:49:08 -08:00
Jake Bailey 8adc460c3c Modify ignoreDeprecation diagnostic to be copy/pastable (#52900) 2023-02-21 15:41:35 -08:00
Andrew Branch 99927cad95 Replace all instances of compilerOptions.isolatedModules with function considering verbatimModuleSyntax (#52746) 2023-02-13 16:03:02 -08:00
Ron Buckton 6c9792aa87 Decorators normative changes (#52582) 2023-02-09 14:48:45 -05:00
Gabriela Araujo Britto 4775381811 Ensure projects are updated for find all references (#52583) 2023-02-06 15:42:05 -08:00
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 e474b3df69 Mark APIs related to prepend option deprecated (#52344) 2023-01-20 15:25:19 -08:00
Sheetal Nandi e5515164eb Remove older deprecated APIs (#52338) 2023-01-20 12:55:04 -08:00
Sheetal Nandi 181cf21b68 Deprecate prepend option on project reference (#52312) 2023-01-20 12:10:18 -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
Wesley Wigham 89e928e8b4 Add --allowArbitraryExtensions, a flag for allowing arbitrary extensions on import paths (#51435) 2023-01-09 17:12:42 -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
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
George Manning 65bf850a20 Fix #51437 Duplicate "Duplicate identifier" errors (#51594)
* retroactive approach to remove duplicate diagnostics

* use code instead of messageText, update test

* use existing de-dupe function

* rename test and baselines

* add fourslash test for better assertion of fix

* review feedback: move deduplicate to getDiagnosticsHelper

* accept baseline with sorted diagnostics

* remove newline
2022-12-08 19:21:41 -08:00
Sheetal Nandi a77a79fe4b Remove some unnecessary createGetCanonicalFileName by exposing one from program (#51796) 2022-12-07 09:17:52 -08:00
Sheetal Nandi 38f33ade06 Use non relative name cache for type reference resolutions and API updates (#51732)
* Make the non relative name resolution cache generic

* Add cache for non relative type reference resolution

* Add getter only methods so we can use these in future for sharing resolutions across the projects

* Mark existing non relative module name cache getOrCreate as deprecated

* Prefer getters for getting directory results
2022-12-06 14:22:03 -08:00