ESlint错误:意外的顶级属性" installedESLint"

时间:2018-03-20 07:01:23

标签: gitlab eslint gitlab-ci gitlab-ci-runner react-native-web

我正在尝试在我的大学项目中使用react-native-web。

当我在本地使用ESlit时,它不会出错。但是当代码在Gitlab-CI管道上运行时,它总是在执行lint时显示此错误:

image: node:8

before_script:
  - npm install

cache:
  paths:
    - node_modules/

stages:
  - test
  - build
  - deploy

test:
  stage: test
  script:
    - npm install -g codecov
    - npm run lint
    - npm test && codecov --token=<TOKEN>

build:
  stage: build
  script: ./node_modules/.bin/webpack

deploy_staging:
  stage: deploy
  script:
    - ./node_modules/.bin/webpack --config webpack.config.js
    - git remote add heroku https://heroku:<TOKEN>@git.heroku.com/<MY-APP>.git
    - git push -f heroku HEAD:master
  environment:
    name: staging
    url: https://<MY-APP>.herokuapp.com/

我已经拥有自己的.eslintrc文件,但ESlint总是引用uuid / .eslintrc.json。

这是我的gitlab-ci.yml文件:

Running with gitlab-runner 10.6.0-rc1 (0a9d5de9)
  on docker-auto-scale 72989761
Using Docker executor with image node:8 ...
Pulling docker image node:8 ...
Using docker image <DOCKER-IMAGE> for node:8 ...
Running on <RUNNER-CONCURRENT> via <OTHER-RUNNER>...
Cloning repository...
Cloning into '/builds/PPL2018csui/Kelas-A/Kel-5'...
Checking out 4a8b0c7e as group_chat_react...
Skipping Git submodules setup
Checking cache for default...
Downloading cache.zip from <CACHE-URL> 
Successfully extracted cache
$ npm install

> uglifyjs-webpack-plugin@0.4.6 postinstall /builds/PPL2018csui/Kelas-A/Kel-5/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1360 packages in 34.056s
$ npm install -g codecov
/usr/local/bin/codecov -> /usr/local/lib/node_modules/codecov/bin/codecov
+ codecov@3.0.0
added 58 packages in 2.266s
$ npm run lint

> deco@0.0.1 lint /builds/PPL2018csui/Kelas-A/Kel-5
> eslint --ext .js .

ESLint configuration in /builds/PPL2018csui/Kelas-A/Kel-5/functions/node_modules/grpc/node_modules/uuid/.eslintrc.json is invalid:
    - Unexpected top-level property "installedESLint".

Error: ESLint configuration in /builds/PPL2018csui/Kelas-A/Kel-5/functions/node_modules/grpc/node_modules/uuid/.eslintrc.json is invalid:
    - Unexpected top-level property "installedESLint".

    at validateConfigSchema (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config/config-validator.js:221:15)
    at Object.validate (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config/config-validator.js:238:5)
    at loadFromDisk (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config/config-file.js:516:19)
    at Object.load (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config/config-file.js:559:20)
    at Config.getLocalConfigHierarchy (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config.js:227:44)
    at Config.getConfigHierarchy (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config.js:179:43)
    at Config.getConfigVector (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config.js:286:21)
    at Config.getConfig (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/config.js:329:29)
    at processText (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/cli-engine.js:163:33)
    at processFile (/builds/PPL2018csui/Kelas-A/Kel-5/node_modules/eslint/lib/cli-engine.js:224:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! deco@0.0.1 lint: `eslint --ext .js .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the deco@0.0.1 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-03-20T06_38_47_590Z-debug.log
ERROR: Job failed: exit code 1

这是管道结果:

java.util.List

有没有人可以帮我解决这个错误?

1 个答案:

答案 0 :(得分:1)

您可以删除条目“ installedESLint:true”。这是一个错误,导致该条目如here

所示被放在init上