【发布时间】:2020-02-04 02:49:39
【问题描述】:
我的项目包含一个具有自己的.eslintrc 的子项目(即在./path/to/subproject 下)
我正在尝试运行lint,但它要么进入根项目.eslintrc 文件,要么找不到.eslintrc 文件
我在package.json中尝试了以下配置:
cd path/to/subproject
和:
"lint": "tsc && eslint -c .eslintrc.js ./**/*.ts --"
或
"lint": "tsc && eslint -c ./.eslintrc.js ./**/*.ts --"
也在根目录中尝试过:
"lint": "tsc && eslint -c path/to/subproject/.eslintrc.js ./**/*.ts --"
或
"lint": "tsc && eslint -c .eslintrc.js ./**/*.ts --"
与
npm run lint --prefix path/to/subproject/
但它一直引用根项目.eslintrc文件:
Oops! Something went wrong! :(
ESLint: 6.4.0.
ESLint couldn't find the config "configname" to extend from. Please check that the name of the config is correct.
The config "configname" was referenced from the config file in "/home/vsts/work/1/s/.eslintrc.js". <-- this is the wrong .eslintrc
环境是带有 Ubuntu 16.04 的 Azure DevOps 管道
【问题讨论】:
-
eslint 不是 json 文件吗?喜欢
eslint -c ~/my-eslint.json file.js -
也可以是
js文件,见这里:eslint.org/docs/user-guide/…
标签: javascript azure-devops devops eslint eslintrc