镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

In JS, importing JSON should not give an error #23712

Description

We don't have to give a good type, but there should not be an error.

Search terms: import require json

const version = require('./package.json').version

Expected behavior:
No error and maybe even version: string

Actual behavior:
Error and version: any.

Activity

  1. mhegazy commented on Apr 26, 2018

    @mhegazy
    Contributor

    Duplicate of #7071. Should be fixed by #22167

  2. sandersn commented on Apr 26, 2018

    @sandersn
    MemberAuthor

    OK, I updated #7071's title to be searchable.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions