New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop @typescript-eslint/no-misused-promises #3741
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried
"@typescript-eslint/no-misused-promises": ["error", {
"checksVoidReturn": false
}]
But it doesn't work for github ci. So I think we need to update the package version for github ci
I'm landing this as a I have a theory that the pull-request-target check is now run from the main branch |
@@ -5,7 +5,7 @@ on: | |||
paths-ignore: | |||
- 'docs/**' | |||
- '*.md' | |||
pull_request_target: | |||
pull_request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use pull_request_target
. It was added to avoid exposing secrets to forks:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
This event runs in the context of the base of the pull request, rather than in the context of the merge commit, as the pull_request event does. This prevents execution of unsafe code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. This event allows your workflow to do things like label or comment on pull requests from forks. Avoid using this event if you need to build or run code from the pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's broken. It's running the code from the main branch and not the target branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. The "base branch" is main
. That's exactly what it is supposed to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The full code that it runs is main, there is nothing of the current PR that is checkout or run. The code and workflow is now identical to main so it's kind of useless for this specific job where we need the current code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out #3737, apparently the updates to package.json and config files where not picked up.
@@ -27,6 +27,7 @@ jobs: | |||
|
|||
- name: Lint code | |||
run: | | |||
echo 'this is an update' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Alternative to #3737.
I looked at the actual problem and the typescript rule has a serious bug.
Apparently it cannot figure out anymore that
fastify/test/types/hooks.test-d.ts
Lines 142 to 146 in b2ce3d5
Given this is correct code and we should get the CI green again, I'll land this as soon as it pass. If somebody can open an issue against the typescript-eslint project, that would be awesome.
Checklist
npm run test
andnpm run benchmark
and the Code of conduct