mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make direct assignments to cjs exports considered literal contexts (#39816)
* Make direct assignments to cjs exports considered literal contexts * Style feedback from PR * Trailing whitespaaaaace
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// @declaration: true
|
||||
// @emitDeclarationOnly: true
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @module: commonjs
|
||||
// @target: es6
|
||||
// @filename: file.js
|
||||
const customSymbol = Symbol("custom");
|
||||
|
||||
// This is a common pattern in Node’s built-in modules:
|
||||
module.exports = {
|
||||
customSymbol,
|
||||
};
|
||||
|
||||
exports.customSymbol2 = Symbol("custom");
|
||||
@@ -16,13 +16,13 @@ goTo.file('/b.js')
|
||||
const markers = test.markers();
|
||||
verify.getInlayHints([
|
||||
{
|
||||
text: ': number',
|
||||
text: ': 1',
|
||||
position: markers[0].position,
|
||||
kind: ts.InlayHintKind.Type,
|
||||
whitespaceBefore: true
|
||||
},
|
||||
{
|
||||
text: ': number',
|
||||
text: ': 1',
|
||||
position: markers[1].position,
|
||||
kind: ts.InlayHintKind.Type,
|
||||
whitespaceBefore: true
|
||||
|
||||
Reference in New Issue
Block a user