ESLint unexpected character '@' for JS decorators

前端 未结 3 733
无人共我
无人共我 2021-01-11 11:27

I\'m trying to use decorators in my JS project, however ESLint is throwing an error stating that the @ symbol is a unexpected character.

My code:

@o         


        
3条回答
  •  生来不讨喜
    2021-01-11 11:53

    If you using Visual Code it will not always work. You need to add into User Settings (or Workspace Settings) following parameter: { ... "eslint.options": { "experimentalDecorators": true } ... }
    Somehow this option wins anything you put into .eslintrc .

提交回复
热议问题