Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Babeljs eslint 2.x和babel eslint不';我不认识装修工_Babeljs_Eslint - Fatal编程技术网

Babeljs eslint 2.x和babel eslint不';我不认识装修工

Babeljs eslint 2.x和babel eslint不';我不认识装修工,babeljs,eslint,Babeljs,Eslint,我正在尝试升级到eslint2.x和最新版本的babel-eslint。我无法使装饰器或类属性正确地进行lint。我创建了一个最小复制,如下所示: test.js import {decorator} from 'foo'; @decorator('test') export class Test { testProperty = 'a string'; } package.json { "name": "test", "version": "1.0.0", "descrip

我正在尝试升级到
eslint
2.x和最新版本的
babel-eslint
。我无法使装饰器或类属性正确地进行lint。我创建了一个最小复制,如下所示:

test.js

import {decorator} from 'foo';

@decorator('test')
export class Test {
  testProperty = 'a string';
}
package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "test.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel": "^6.5.2",
    "babel-eslint": "^6.0.4",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2017": "^1.4.0",
    "babel-preset-stage-1": "^6.5.0",
    "eslint": "^2.10.1"
  }
}
.babelrc

{
  "presets": ["es2017", "stage-1"],
  "plugins": ["transform-decorators-legacy"]
}
.eslintrc.json
{ “解析器”:“babel eslint”, “解析选项”:{ “源类型”:“模块” }, “规则”:{ “严格”:0 } }

当我运行
eslint test.js
时,我得到以下结果:

  3:1  error  Parsing error: Unexpected character '@'

✖ 1 problem (1 error, 0 warnings)
如果我注释掉第3行,那么我会得到:

  5:16  error  Parsing error: Unexpected token =

✖ 1 problem (1 error, 0 warnings)
babel eslint似乎被用来解析文件,但没有从
.babelrc
文件中获取任何信息


如何使eslint和babel eslint成功解析并删除此文件?

这是库中的一个错误

建议降级到版本
2.9


无需降级,这已在2.10.2 AFAIK中修复。