Vize

vue/eqeqeq

テンプレート式で厳密等価演算子を使います。

既定の重大度 プリセット 自動修正 オプション
warning なし なし なし

適用範囲:Vue SFC のテンプレートと各ブロック。ルールに必要な script の文脈も例に含めています。

悪い例

抽象等価はオペランドを暗黙に変換します。

<template>
  <p>{{ value == null }}</p>
</template>

良い例

厳密等価は暗黙の変換なしで比較します。

<template>
  <p>{{ value === null }}</p>
</template>

設定(Vite+)

import { defineConfig } from "@vizejs/vite-plugin/vite-plus";

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "vue/eqeqeq": "warn"
    }
  },
});

設定したら vp run lint を実行します。

関連ページ