Skip to content
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

Merged
merged 4 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request_target:
pull_request:
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

paths-ignore:
- 'docs/**'
- '*.md'
Expand All @@ -14,10 +14,10 @@ jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

Expand All @@ -27,6 +27,7 @@ jobs:

- name: Lint code
run: |
echo 'this is an update'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

npm run lint

coverage-nix:
Expand All @@ -44,10 +45,10 @@ jobs:
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -87,9 +88,9 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- uses: actions/cache@v2
Expand Down
4 changes: 3 additions & 1 deletion types/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-misused-promises": ["error"]
"@typescript-eslint/no-misused-promises": ["error", {
"checksVoidReturn": false
}]
},
"globals": {
"NodeJS": "readonly"
Expand Down