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

fix: allow void as statement in ts file #142

Merged
merged 2 commits into from Dec 16, 2022
Merged

Conversation

zanminkian
Copy link
Contributor

Description

// main.ts
/* eslint-disable @typescript-eslint/require-await */
async function test() {
  return 'test'
}

setTimeout(() => {
  void test()
})

export {}

Let's say I have code above. Run lint will cause no-void error. But after adding tsconfig.eslint.json file to project root, this error will disappear.

I think, adding tsconfig.eslint.json file to the root of project should bring more stricter rules to project. Deleting the tsconfig.eslint.json file should remove some stricter rules. But in the example above, deleting the tsconfig.eslint.json file will bring more stricter rule, which should not be.

Linked Issues

Additional context

@zanminkian
Copy link
Contributor Author

If I want to make my project stricter, I will add tsconfig.eslint.json to the root of project. But I won't add it suddenly because this will cause too many error. I will fix my code first.

When fixing some async function, I have to add void before function, which is compatible for add tsconfig.eslint.json later, but will cause error right now.

@antfu antfu merged commit 5d5b3c3 into antfu:main Dec 16, 2022
@zanminkian zanminkian deleted the zmj-no_void branch December 21, 2022 14:28
MaloLebrin added a commit to MaloLebrin/naturopathe-camion-nuxt3 that referenced this pull request Jan 29, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@antfu/eslint-config](https://togithub.com/antfu/eslint-config) |
[`^0.34.0` ->
`^0.35.0`](https://renovatebot.com/diffs/npm/@antfu%2feslint-config/0.34.0/0.35.1)
|
[![age](https://badges.renovateapi.com/packages/npm/@antfu%2feslint-config/0.35.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@antfu%2feslint-config/0.35.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@antfu%2feslint-config/0.35.1/compatibility-slim/0.34.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@antfu%2feslint-config/0.35.1/confidence-slim/0.34.0)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>antfu/eslint-config</summary>

###
[`v0.35.1`](https://togithub.com/antfu/eslint-config/releases/tag/v0.35.1)

[Compare
Source](https://togithub.com/antfu/eslint-config/compare/v0.35.0...v0.35.1)

#####    🐞 Bug Fixes

- Disable `@typescript-eslint/no-unused-vars`  -  by
[@&#8203;antfu](https://togithub.com/antfu)
[<samp>(4b576)</samp>](https://togithub.com/antfu/eslint-config/commit/4b57638)

#####     [View changes on
GitHub](https://togithub.com/antfu/eslint-config/compare/v0.35.0...v0.35.1)

###
[`v0.35.0`](https://togithub.com/antfu/eslint-config/releases/tag/v0.35.0)

[Compare
Source](https://togithub.com/antfu/eslint-config/compare/v0.34.2...v0.35.0)

#####    🚀 Features

- Auto fix for unused imports  -  by
[@&#8203;antfu](https://togithub.com/antfu)
[<samp>(f466a)</samp>](https://togithub.com/antfu/eslint-config/commit/f466ac5)

#####     [View changes on
GitHub](https://togithub.com/antfu/eslint-config/compare/v0.34.2...v0.35.0)

###
[`v0.34.2`](https://togithub.com/antfu/eslint-config/releases/tag/v0.34.2)

[Compare
Source](https://togithub.com/antfu/eslint-config/compare/v0.34.1...v0.34.2)

#####    🚀 Features

- Allow require() in cjs  -  by
[@&#8203;antfu](https://togithub.com/antfu)
[<samp>(f45a0)</samp>](https://togithub.com/antfu/eslint-config/commit/f45a0d9)

#####    🐞 Bug Fixes

- Group `&&`, ` &nbsp;-&nbsp; by ** ` and `?:`
([#&#8203;152](https://togithub.com/antfu/eslint-config/issues/152))\*\*
[<samp>()</samp>](https://togithub.com/antfu/eslint-config/commit/)

#####     [View changes on
GitHub](https://togithub.com/antfu/eslint-config/compare/v0.34.1...v0.34.2)

###
[`v0.34.1`](https://togithub.com/antfu/eslint-config/releases/tag/v0.34.1)

[Compare
Source](https://togithub.com/antfu/eslint-config/compare/v0.34.0...v0.34.1)

#####    🚀 Features

- **ts**: Enable `jest/unbound-method`  -  by
[@&#8203;zanminkian](https://togithub.com/zanminkian) in
[antfu/eslint-config#141
[<samp>(2ad35)</samp>](https://togithub.com/antfu/eslint-config/commit/2ad3503)

#####    🐞 Bug Fixes

- Allow void as statement in ts file  -  by
[@&#8203;zanminkian](https://togithub.com/zanminkian) in
[antfu/eslint-config#142
[<samp>(5d5b3)</samp>](https://togithub.com/antfu/eslint-config/commit/5d5b3c3)
- Prefer const when all variables in destructuring should be const  - 
by [@&#8203;sxzz](https://togithub.com/sxzz) in
[antfu/eslint-config#149
[<samp>(2a224)</samp>](https://togithub.com/antfu/eslint-config/commit/2a224ef)

#####     [View changes on
GitHub](https://togithub.com/antfu/eslint-config/compare/v0.34.0...v0.34.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/MaloLebrin/naturopathe-camion-nuxt3).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTYuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExNi4xIn0=-->
byyuurin added a commit to byyuurin/eslint-config that referenced this pull request Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants