Eslint-plugin-vue: How to prevent `vue/valid-v-on` on custom modifiers?

Created on 11 Jul 2018  路  2Comments  路  Source: vuejs/eslint-plugin-vue

Having set
Vue.config.keyCodes = { 'enter-strict': 13 }
Gives me the vue/valid-v-on error for enter-strict. How can prevent this?

Best regards,

enhancement question

Most helpful comment

I am facing this as well.

Whats the right way to disable this rule? setting vue/valid-v-on: 0 is not working for me :(

eslint-disable is not working either

<!-- eslint-disable -->
      <GlobalEvents
        v-if="!selected"
        @keyup.digit1="select(1)"
        @keyup.digit2="select(2)"
        @keyup.digit3="select(3)"
        @keyup.digit4="select(4)"
        @keyup.digit5="select(5)"
        @keyup.digit6="select(6)"
        @keyup.digit7="select(7)"
      />

All 2 comments

Hey @mesqueeb

At this moment you can either use built-in enter modifier, or disable this rule.

You can also create a PR with an extra option to extend allowed modifiers with a custom list :)

I am facing this as well.

Whats the right way to disable this rule? setting vue/valid-v-on: 0 is not working for me :(

eslint-disable is not working either

<!-- eslint-disable -->
      <GlobalEvents
        v-if="!selected"
        @keyup.digit1="select(1)"
        @keyup.digit2="select(2)"
        @keyup.digit3="select(3)"
        @keyup.digit4="select(4)"
        @keyup.digit5="select(5)"
        @keyup.digit6="select(6)"
        @keyup.digit7="select(7)"
      />
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rodneyrehm picture rodneyrehm  路  4Comments

xiGUAwanOU picture xiGUAwanOU  路  3Comments

apertureless picture apertureless  路  4Comments

armano2 picture armano2  路  4Comments

lichnow picture lichnow  路  3Comments