我有一个看起来像这样的工作流
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install
- run: npm run lint由于某些原因,lint阶段失败并产生以下错误
> eslint . --ext .js,.jsx,.ts,.tsx
/home/runner/work/ABC/ABC/src/components/folder/Folder.tsx
##[error] 6:20 error Missing file extension for "../../styles/Colors" import/extensions
##[error] 6:20 error Unable to resolve path to module '../../styles/Colors' import/no-unresolved
/home/runner/work/ABC/ABC/src/components/todo/header/Heading.tsx
##[error] 4:20 error Missing file extension for "../../../styles/Colors" import/extensions
##[error] 4:20 error Unable to resolve path to module '../../../styles/Colors' import/no-unresolved
/home/runner/work/ABC/ABC/src/screens/TodoScreen.tsx
##[error] 3:20 error Missing file extension for "../styles/Colors" import/extensions
##[error] 3:20 error Unable to resolve path to module '../styles/Colors' import/no-unresolved
✖ 6 problems (6 errors, 0 warnings)当我在本地运行npm run lint时,它成功通过。
我先试着运行npm ci,然后再试着运行npm run lint,但还是通过了
发布于 2020-01-07 13:03:16
原来这是一个文件大小写敏感的问题。
我之前将../../styles/Colors重命名为../../styles/colors (小写)
然而,出于某种原因,git并没有注意到这一点。我不得不使用git mv手动完成此操作
https://stackoverflow.com/questions/59547481
复制相似问题