TypeScript/tests/cases/conformance/salsa/commonJSReexport.ts
Nathan Shively-Sanders 9fb6acf1e1
Add missed resolveSymbol in commonjs import resolution (#41479)
Fixes resolution of export aliases in the postfix-property-access case
of commonjs require:

```js
const { x } = require('./foo').nested
x
```

This program would previously fail if `x` was an export alias.

Fixes #41422
2020-11-10 11:28:49 -08:00

20 lines
322 B
TypeScript

// #41422, based on prettier's exports
// @noEmit: true
// @checkJS: true
// @filename: first.js
const hardline = { type: "hard" }
module.exports = {
hardline
}
// @filename: second.js
module.exports = {
nested: require('./first')
};
// @filename: main.js
const { hardline } = require('./second').nested;
hardline