Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rule Proposal: vue/no-implicit-coercion #2638

Copy link
Copy link
Closed
@lozinsky

Description

@lozinsky
Issue body actions

Please describe what the rule should do:

It would be nice to make the core rule no-implicit-coercion work in <template> expressions.

What category should the rule belong to?

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

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

<template>
  <div :data-foo="!!foo" />
  <div :data-foo="~foo.indexOf('.')" />
  <div :data-foo="+foo" />
  <div :data-foo="1 * foo" />
  <div :data-foo="'' + foo" />
  <div :data-foo="`` + foo" />
  <!-- if the `disallowTemplateShorthand` option is enabled -->
  <div :data-foo="`${foo}`" />
</template>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.