diff --git a/lib/rules/no-restricted-v-bind.js b/lib/rules/no-restricted-v-bind.js index d15bb4caa..3cc46e715 100644 --- a/lib/rules/no-restricted-v-bind.js +++ b/lib/rules/no-restricted-v-bind.js @@ -113,7 +113,7 @@ module.exports = { type: 'array', items: { type: 'string', - enum: ['prop', 'camel', 'sync'] + enum: ['prop', 'camel', 'sync', 'attr'] }, uniqueItems: true }, diff --git a/lib/rules/valid-v-bind.js b/lib/rules/valid-v-bind.js index 5b9339c1a..6605ed1c7 100644 --- a/lib/rules/valid-v-bind.js +++ b/lib/rules/valid-v-bind.js @@ -15,7 +15,7 @@ const utils = require('../utils') // Helpers // ------------------------------------------------------------------------------ -const VALID_MODIFIERS = new Set(['prop', 'camel', 'sync']) +const VALID_MODIFIERS = new Set(['prop', 'camel', 'sync', 'attr']) // ------------------------------------------------------------------------------ // Rule Definition diff --git a/tests/lib/rules/no-restricted-v-bind.js b/tests/lib/rules/no-restricted-v-bind.js index e6dd72d59..8691b1d0e 100644 --- a/tests/lib/rules/no-restricted-v-bind.js +++ b/tests/lib/rules/no-restricted-v-bind.js @@ -147,6 +147,13 @@ tester.run('no-restricted-v-bind', rule, { `, options: [{ argument: 'foo', message: 'foo' }], errors: ['foo'] + }, + + { + filename: 'test.vue', + code: '', + options: [{ argument: 'foo', modifiers: ['attr'] }], + errors: ['Using `:foo.attr` is not allowed.'] } ] }) diff --git a/tests/lib/rules/valid-v-bind.js b/tests/lib/rules/valid-v-bind.js index b5e71af7c..24a61bba7 100644 --- a/tests/lib/rules/valid-v-bind.js +++ b/tests/lib/rules/valid-v-bind.js @@ -71,6 +71,10 @@ tester.run('valid-v-bind', rule, { filename: 'test.vue', code: "" }, + { + filename: 'test.vue', + code: "" + }, { filename: 'test.vue', code: ""