Skip to content

checkJs too strict about module.exports assignment #15647

Description

I was trying to run with // @ts-check on a webpack config file. Unfortunately, it choked on the following simplified repro:

// @ts-check

module.exports = {
    a: 100,
    b: 200,
}

module.exports.devtool = true;

I get

severity: 'Error'
message: 'An export assignment cannot be used in a module with other exported elements.'
at: '3,1'
source: 'js'

Activity

  1. mohsen1 commented on Apr 8, 2018

    @mohsen1
    Contributor
  2. sandersn commented on Apr 9, 2018

    @sandersn
    Member

    #23228 Should fix this. Can you try typescript@next?

  3. mohsen1 commented on Apr 11, 2018

    @mohsen1
    Contributor

    Nathan Shively-Sanders (@sandersn) Your changes resolved this! Thank you!

    The only thing that's still erroring is this:

    exports = module.exports = webpack;
  4. mhegazy commented on Apr 11, 2018

    @mhegazy
    Contributor

    Mohsen Azimi (@mohsen1) #23319 should fix this. give it a try in tommrow's build.

  5. locked and limited conversation to collaborators on Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions