Skip to content

@ts-check complains about a require of a JSON file. #21262

Closed
@egamma

Description

@egamma

The node require can also read in .json files.

In the following code the require is flagged with an error when the ´test.json´ file exists, but the code executes correctly.

//@ts-check
let test = require("./test.json")

image

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