Skip to content

onConsoleLog should be typed false | undefined or boolean | undefined #5317

@ST-DDT

Description

@ST-DDT

Clear and concise description of the problem

According to @bradzacher in typescript-eslint/typescript-eslint#8576 (comment) the current typing of the method is flawed. As the current void part of the method would indicate that you shouldn't care about the result.

Suggested solution

Change the return signature of onConsoleLog to false | undefined or boolean | undefined.

The later variant especially would allow for ternaries or simple return expressions like:

onConsoleLog(type) {
  return type != 'stderr';
}

Alternative

No response

Additional context

https://vitest.dev/config/#onconsolelog

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions