We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CLI: Version: 1.7.3 Color support: true Platform: CPU Architecture: x86_64 OS: windows Environment: BIOME_LOG_DIR: unset NO_COLOR: unset TERM: unset JS_RUNTIME_VERSION: "v22.0.0" JS_RUNTIME_NAME: "node" NODE_PACKAGE_MANAGER: unset Biome Configuration: Status: Loaded successfully Formatter disabled: false Linter disabled: false Organize imports disabled: false VCS disabled: true Linter: Recommended: true All: false Rules: suspicious/noConfusingVoidType = "off" suspicious/noExplicitAny = "off" Workspace: Open Documents: 0
noConfusingVoidType
https://biomejs.dev/playground/?code=ZgB1AG4AYwB0AGkAbwBuACAAYwByAGUAYQB0AGUATABpAHMAdABlAG4AZQByACgAYwBhAGwAbABiAGEAYwBrADoAIAAoACkAIAA9AD4AIAAoACgAKQAgAD0APgAgAHYAbwBpAGQAKQAgAHwAIAB2AG8AaQBkACkAewAKACAAIAByAGUAdAB1AHIAbgAgAG4AdQBsAGwACgB9AA%3D%3D
Sometimes I have a callback that can optionally return a disposer
function createListener(callback: (e) => (() => void) | void))
The text was updated successfully, but these errors were encountered:
I think that the function could better be typed with undefined because you are likely to check if the result is not undefined.
undefined
function createListener(callback: (e) => (() => void) | undefined)) {}
Sorry, something went wrong.
I think we should not address this, because the function returns something. undefined should be used instead of void here.
void
No branches or pull requests
Environment information
Rule name
noConfusingVoidType
Playground link
https://biomejs.dev/playground/?code=ZgB1AG4AYwB0AGkAbwBuACAAYwByAGUAYQB0AGUATABpAHMAdABlAG4AZQByACgAYwBhAGwAbABiAGEAYwBrADoAIAAoACkAIAA9AD4AIAAoACgAKQAgAD0APgAgAHYAbwBpAGQAKQAgAHwAIAB2AG8AaQBkACkAewAKACAAIAByAGUAdAB1AHIAbgAgAG4AdQBsAGwACgB9AA%3D%3D
Expected result
Sometimes I have a callback that can optionally return a disposer
Code of Conduct
The text was updated successfully, but these errors were encountered: