Skip to content

ES6 jsconfig.json error #54

@r25s

Description

@r25s

I am incorrectly getting the following error, "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".

Furthermore, I think I may have stumbled upon a weird case where if the start of the file name is "temp" as in "temp.js", "temporary.js", or "temp123.js" it will cause this error.

To reproduce:
Create a file called temp.js with some ES6 code, such as:

let x = 10

The above error is now showing. To fix it, create the jsconfig.json file which sets the target to ES6:

{
    "compilerOptions": {
        "target": "ES6"
    }
}

The error is still showing, now incorrectly.

If I rename "temp.js" to "test.js" (or anything that doesn't start with 'temp') the error goes away. Or, if I create a files array in jsconfig.json which lists "temp.js", the error goes away:

{
    "compilerOptions": {
        "target": "ES6"
    },
    "files": [
        "temp.js"
    ]
}

I don't want to have to do this for every file in my project.

I'm running on Windows 7, 64-bit.

Thanks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions