gpt4 book ai didi

gitlab - ESLint 错误 : Unexpected top-level property "installedESLint"

转载 作者:行者123 更新时间:2023-12-04 16:04:15 26 4
gpt4 key购买 nike

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

当我在本地使用 ESlit 进行 lint 时,不会出现错误。但是当代码运行在Gitlab-CI pipeline上的时候,在做lint的时候总是显示这个错误:

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".

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

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

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/

这是管道结果:

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

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

最佳答案

您可以删除条目“installedESLint:true”。如前所述here,这是一个将条目放在 init 上的错误。

关于gitlab - ESLint 错误 : Unexpected top-level property "installedESLint",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49378089/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com