* fixesmicrosoft/TypeScript#41286
* Added period to end of deprecation message
* Search Symbol.declarations for deprecated tag instead of Symbol.valueDeclaration
* renamed arg0 to deprecatedEntity, narrowed param type
* Added different deprecation message if signature is available
* address PR comments
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Update tests
* @ begins JSDoc tag only after whitespace
Previously, inside a JSDoc tag's comment, @ would start a tag unless it
was surrounded by backticks. However, looking at real code showed that
only whitespace-preceded uses of @ were intended to start tags.
* Add AutoImportSuggestions for UMD module export declarations instead of global keywords
* Add test for scripts
* Add more comments
* Provide auto import suggestion only for modules and not scripts
* PR review #1
* PR review #1
* Add --force to npm install script for user tests
* Migrate prettier to docker
* Fix vscode Dockerfile
* Fix stack space issue in isJSLiteralType
* Use --legacy-peer-deps based on npm version
* Fix xterm.js Dockerfile
* Update and add test when typings dont change because of import name
* Update project scheduling only when typings are set
* Schedule update graph only if typings change
Fixes#39326
* Add tests for "Cannot find name 'global'. Did you mean 'global'?"
* Fix "Cannot find name 'global'. Did you mean 'global'?"
* Add an additional test case for spelling suggestions of "global".
* Name the boolean for suggestions being global scope augmentations.
* Create symlink cache when a pnpm module is found
* Keep pnpm-internal symlinks out of the symlink cache
* Filter out pnpm path from realpath module specifier too
* Optimize symlink module specifier generation
* Add trailing directory separators
* Remove unneeded change
* Fix paths losing case in cache
* Fix missing absolutification
* feat: exclude declared variable when Object literal completions
* feat: check undeclareVariable when completion
* feat: add completion test case
* feat: code optimization
* feat: support shorthand property assignment
* feat: add shorthand property assignment test case
* feat: update completionPropertyShorthandForObjectLiteral test cases
* feat: exclude completions of variable initializers
* feat: update test cases
* feat: add completionListWithoutVariableinitializer test case
* feat: perfect the completionListWithoutVariableinitializer test case
* feat: remove isIdentifier limit
* feat: update test cases
* feat: code optimization and filter out some binding cases
* feat: update test case
* feat: handle arrow function expressions without braces
* feat: add arrow function expressions without braces test case
* feat: check node.parent exist first
* feat: optimization name
* feat: optimize test cases
* chore: code formatting
* feat: perfect type
* chore: failing test for const enums and isolatedModules
* fix: const enums + isolatedModules emit invalid code
In `isolatedModules` mode, the compiler does not inline const enums,
but also decides not to `import` them, leaving invalid code that
throws a `ReferenceError` at runtime.
This code:
```
import { SomeEnum } from './bar';
sink(SomeEnum.VALUE);
```
..should compile to either:
```
var { SomeEnum } = require('./bar');
sink(SomeEnum.VALUE);
```
..or (with const enum inlining):
```
sink(1 /* VALUE */);
```
..but actually compiles to:
```
sink(SomeEnum.VALUE);
```
..with no imports, which throws a ReferenceError at runtime.
---
The compiler has already realised that the symbol is a referenced const
enum, it just doesn't use this information when it comes to deciding
whether to emit an import. This commit additionally checks that
information, if we are compiling in isolatedModules mode.
---
In my opinion, this is not the correct fix, but it is the simplest. In
`isolatedModules` mode, `const enum` should probably be a compile error
(because there are no benefits and the complexity is high, and,
apparently, buggy). If not, the compiler should not be checking whether
something is a const enum, and should just be treating it as a regular
enum, and checking as if it was?
Fixes#40499.
* chore: extra test for type-only
* feat: explicitly ban --isolatedModules --preserveConstEnums false
* feat: isolatedModules implies preserveConstEnum
* Update src/compiler/diagnosticMessages.json
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
* chore: compiler test for argument incompatibility
* Add and fix test for namespace import of const enum
* Fix additional bug with reexport of const-enum-only module
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
Co-authored-by: Andrew Branch <andrew@wheream.io>
* Create symlink cache when a pnpm module is found
* Keep pnpm-internal symlinks out of the symlink cache
* Filter out pnpm path from realpath module specifier too
* Use ignoredPaths instead of pnpm-specific path
hasNonBindableDynamicName
1. Has 'non' in the name, and is only ever used negated.
2. Is true for a case that's not reflected correctly in the name -- it's
true for non-dynamic names as well.
I considered hasEarlyOrLateBindableName, but decided to use
hasBindableName for now.
* 'in' should not operate on primitive types
* accept baselines of failing tests
* review
* update error message
* check if constraint of right type is assignable to a non primitive or instantiable non primitive
* do not throw errors where narrowing is impossible
* accept baselines
* fix test case failures
* Add more accurate comment discussion and document failing edge case in test
* Update baselines
Co-authored-by: Jonas Hübotter <jonas.huebotter@gmail.com>
* New aliases for type alias instantiations
* New aliases for conditional, mapped, and anonymous object type instantiations
* Accept new baselines
* Fix issues with re-aliasing
* Accept new baselines