LoginSignup
16
14

More than 5 years have passed since last update.

Vueのインスタンス作成がESLintのno-newに抵触するのを避ける方法

Posted at

ESLintのDisallow new For Side Effects (no-new)ルールが"error"に設定されている場合、次の書き方だとエラーになる。

new Vue({
  el: '#app',
  ...
})

次のように$mountを使ってマウントすれば、その問題を回避できる。

const app = new Vue({
  ...
})

app.$mount('#app')
16
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
14