我想在我的JS項目中使用裝飾器,但ESLint拋出一個錯誤,指出@符號是一個意外的字符。ESLint JS裝飾器的意外字符'@'
我的代碼:
@observable items = [];
我.eslintrc:
{
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"env": {
"browser": true,
"node": true,
"es6": false
},
"ecmaFeatures": {
"modules": true
},
"rules": {
"strict": [
2,
"global"
],
"quotes": [
2,
"single"
],
"indent": [
2,
4
],
"eqeqeq": [
2,
"smart"
],
"semi": [
2,
"always"
],
"max-depth": [
2,
4
],
"max-statements": [
2,
15
],
"complexity": [
2,
5
]
}
}
一些配置有在ES6沒有裝飾。 – zeroflagL