TypeScript/tests/cases/conformance/jsdoc/jsdocTypeFromChainedAssignment2.ts
Nathan Shively-Sanders 5ea4d3b2bb
No error for require, module.exports or exports in Javascript (#23743)
* No error for require

Still errors for module and exports, and require's type is now
incorreclty 'any'; I broke module resolution somehow. Needs
investigation.

* module/exports symbols+update isCommonJsRequire

Everything passes the tests but the code can be improved

* Update baselines

* Cleanup

* Update baselines of new tests

* Get rid of exports symbol

It wasn't doing anything anyway.
2018-04-30 15:47:59 -07:00

22 lines
393 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @Filename: mod.js
/** @param {number} n */
exports.f = exports.g = function fg(n) {
return n + 1
}
/** @param {string} mom */
module.exports.h = module.exports.i = function hi(mom) {
return `hi, ${mom}!`;
}
// @Filename: use.js
var mod = require('./mod');
mod.f('no')
mod.g('also no')
mod.h(0)
mod.i(1)