Skip to content

[New Rule] vue/no-console #2155

Closed
Closed
@wenfangdu

Description

@wenfangdu

Please describe what the rule should do:

Since Vue ^3.3 now supports console in the template, a vue/no-console rule is needed to regulate its usage.

vue/no-console should work exactly the same as no-console but in the template.

What category should the rule belong to?

[ ] Enforces code style (layout)
[x] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

With 'vue/no-console': 'error', the following code should throw:

<template>
  <button @click="console.log"></button>
</template>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions