* wip-try get symbol of bindingelement in objectBindingPattern first
* Add fourslash tests
* Update .types baselines
* Update .symbols baselines
* Revert checker changes
* Actually lookup type for binding property name definition
* More succinct check, clarify yui's comment
* For duplicate source files of the same package, make one redirect to the other
* Add reuseProgramStructure tests
* Copy `sourceFileToPackageId` and `isSourceFileTargetOfRedirect` only if we completely reuse old structure
* Use fallthrough instead of early exit from loop
* Use a set to efficiently detect duplicate package names
* Move map setting outside of createRedirectSourceFile
* Correctly handle seenPackageNames set
* sourceFileToPackageId -> sourceFileToPackageName
* Renames
* Respond to PR comments
* Fix bug where `oldSourceFile !== newSourceFile` because oldSourceFile was a redirect
* Clean up redirectInfo
* Respond to PR comments
* Add test with bug
* Fix for import placement
* Consolidate comment recognition functions into utilities
* Add another test with all 3 kinds
* Recognize path directives as part of triple slash directives
* Also handle no-default-lib triple-slash comments
* Test for all the triple-slash kinds
* Keep import-placement logic in the quickfix, since its not really a node start; accept new baselines
* Work in not-ES6, use a real no-lib comment
* Remove no default lib triple slash comment, it disables checking and thereby quick fixes
* Copy regex rather than have a regex copy
* Include export assignment properties when looking for module exports
* Create new API function for tryGetMemberInModuleExportsAndProperties
* Cleanup based on review feedback
- We didn't locate the package.json correctly in cases where the module to be imported is in a subdirectory of the package
- We didn't look at the types element in package.json (just typings)
- We didn't remove /index.js from the path if the main module was in a subdirectory
Fixes#16963
For ?, provide two code fixes, one for jsdoc/closure semantics
(`?t -> t | null)` and one for flow semantics
(`?t -> t | null | undefined`).
The current way of doing this is the hackiest thing you can imagine, but
it was easier than lifting everything into the list monad for a code fix
that I might not actually keep.
1. Remove checkJSDocFunctionType in favour of checkSignature.
2. Check that 'new', in addition to 'this', must be the first parameter.
3. Remove prematurely added JSDoc-quickfix test.
* Completion for default export should be '.default'
* Don't include empty string in name table
* getSymbolsInScope() should return local symbols, not exported symbols
* Fix bug: getSymbolAtLocation should work for local symbol too
* Created a branded type for escaped strings
Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.
* Correctly double underscores WRT mapped types
* Add fourslash tests for other fixed issues
* use function call over cast
* Update forEachEntry type accuracy
* Just use escaped names for ActiveLabel
* Remove casts from getPropertyNameForPropertyNameNode
* This pattern has occurred a few times, could use a helper function.
* Remove duplicated helper
* Remove unneeded check, use helper
* Identifiers list is no longer escaped strings
* Extract repeated string-getting code into helper
* Rename type and associated functions
* Make getName() return UnderscoreEscapedString, add getUnescapedName()
* Add list of internal symbol names to escaped string type to cut back on casting
* Remove outdated comments
* Reassign interned values to nodes, just in case
* Swap to string enum
* Add deprecated aliases to escapeIdentifier and unescapeIdentifier
* Add temp var
* Remove unsafe casts
* Rename escaped string type as per @sandersn's suggestion, fix string enum usages
* Reorganize double underscore tests
* Remove jfreeman from TODO
* Remove unneeded parenthesis