New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental Decorators error present with option set in config #28097

Closed
dbaeumer opened this Issue Jun 6, 2017 · 11 comments

Comments

Projects
None yet
8 participants
@dbaeumer
Member

dbaeumer commented Jun 6, 2017

From @cfrank on May 22, 2017 14:37

Version 1.13.0-insider
Commit 3bb9b5314ef50bd8225aba0565cadc6ca19bc821
Date 2017-05-18T06:26:49.576Z
Shell 1.6.6
Renderer 56.0.2924.87
Node 7.4.0
Linux

Error

This error appears even after adding the experimentalDecorators flag in .eslintrc

"parserOptions": {
    "ecmaVersion": 7,
    "ecmaFeatures": {
        "experimentalObjectRestSpread": true,
        "experimentalDecorators": true,
        "jsx": true
    },
    "sourceType": "module"
},

Copied from original issue: Microsoft/vscode-eslint#244

@dbaeumer

This comment has been minimized.

Member

dbaeumer commented Jun 6, 2017

The error message comes from the JS support in VS Code (see [js] in the error message). ESlint errors are prefixed with [eslint].

@mjbvz

This comment has been minimized.

Contributor

mjbvz commented Jun 6, 2017

@cfrank Yes this issue is coming from our JS support.

To fix it, please try creating a jsconfig.json file at the root of your project with the contents:

{
  "compilerOptions": {
      "experimentalDecorators": true
  }
}
@mwarger

This comment has been minimized.

mwarger commented Jul 26, 2017

@mjbvz This solution doesn't work for me. Any thoughts?

@mjbvz

This comment has been minimized.

Contributor

mjbvz commented Jul 27, 2017

@mwarger Are you sure the file is part of your jsconfig or tsconfig. Try running the Go to project configuration command in the file to double check

@noahtallen

This comment has been minimized.

noahtallen commented Aug 5, 2017

Just wanted to comment that this solution did work for me. The error went away after adding the file and restarting VS Code.

@ghost

This comment has been minimized.

ghost commented Aug 7, 2017

I have the same problem.

@MikeKovarik

This comment has been minimized.

MikeKovarik commented Sep 10, 2017

So this is still a problem and the issue should not have been closed. I just today tried switching to VS Code with a project that uses decorators a lot. Adding jsconfig.json did not help, nor did restarting VSC. So my code keeps lighting up in red. For now I'm sticking to Sublime Text.

VSC version: 1.16.0
My jsconfig.json

{
    "compilerOptions": {
        "allowSyntheticDefaultImports": true,
        "experimentalDecorators": true
    },
    "include": [
        "src/**/*"
    ]
}
@mjbvz

This comment has been minimized.

Contributor

mjbvz commented Sep 11, 2017

@MikeKovarik In a JS file that has this error, try running the JavaScript: Go to project configuration command. Does this open the jsconfig.json file? If not, please open a new issue so that we can investigate this

@kenta88

This comment has been minimized.

kenta88 commented Sep 13, 2017

after created the jsconfig.json dont forget to restart vsc. This should fix ;)

@itLead797

This comment has been minimized.

itLead797 commented Sep 19, 2017

I saw the problem consistently with this combination
"compilerOptions": {
"experimentalDecorators": true,
"target": "es6",
}

The problem was resolved with this combination
"compilerOptions": {
"experimentalDecorators": true,
"target": "es5",
}

@ProteanDev

This comment has been minimized.

ProteanDev commented Nov 15, 2017

still getting the [eslint] Parsing error: Unexpected character '@'

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.