# no-implicit-coercion

Rule `vue/no-implicit-coercion`. Disallow shorthand type conversions in `<template>`

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1827 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-implicit-coercion` | no | safe | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-implicit-coercion.html) |
| Biome | `complexity/noImplicitCoercions` | no | unsafe | group complexity, since 2.1.0 | [docs](https://biomejs.dev/linter/rules/no-implicit-coercions/) |

## Code examples

### Incorrect: the rule reports this

```js
!!foo;
```

```js
+foo;
```

```js
-(-foo);
```

### Correct: the rule accepts this

```js
Boolean(foo);
```

```js
Number(foo);
```

```js
String(foo);
```

Examples from the Biome documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-implicit-coercion": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "complexity": {
        "noImplicitCoercions": "error"
      }
    }
  }
}
```

## Related rules

- [eslint/no-implicit-coercion](https://lintradar.dev/rules/eslint/no-implicit-coercion.md): Disallow shorthand type conversions
- [vue/no-define-model-default](https://lintradar.dev/rules/vue/no-define-model-default.md): Disallow default values in `defineModel`
- [vue/no-multiple-objects-in-class](https://lintradar.dev/rules/vue/no-multiple-objects-in-class.md): Disallow passing multiple objects in an array to class
- [vue/no-content-outside-block](https://lintradar.dev/rules/vue/no-content-outside-block.md): Disallow content outside of the top-level blocks
- [vue/no-negated-condition](https://lintradar.dev/rules/vue/no-negated-condition.md): Disallow negated conditions in `<template>`
- [vue/no-constant-condition](https://lintradar.dev/rules/vue/no-constant-condition.md): Disallow constant expressions in conditions in `<template>`

---

Web page: https://lintradar.dev/rules/vue/no-implicit-coercion. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
