Skip to content

Rule Change: add more suggestions and detailed message for no-console when there is allow option #19229

Open
@rakleed

Description

What rule do you want to change?

no-console

What change do you want to make?

Implement suggestions

How do you think the change should be implemented?

A new default behavior

Example code

/* eslint no-console: ["error", { allow: ["warn", "error"] }] */

console.log('Hello, World!');

What does the rule currently do for this code?

There is a suggestion to just remove console.log() completely (#17493).

Image

The message also says that console.log() is simply not allowed.

Image

What will the rule do after it's changed?

Additionally, there are suggestions to replacing console.log() with the options specified in allow.

And the message indicates which options are allowed.

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementThis change enhances an existing feature of ESLintruleRelates to ESLint's core rules

    Type

    No type

    Projects

    • Status

      Feedback Needed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions