Skip to content

vue/no-mutating-props not flagging .sync usage #1714

Closed
@douglasg14b

Description

@douglasg14b

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 6.7.2
  • eslint-plugin-vue version: : 7.19.1
  • Node version: : 14 (I think?)
  • Operating System: : Windows 10

Please show your full configuration:

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint'
  },
  env: {
    browser: true,
    node: true,
    'jest/globals': true
  },
  extends: [
    'standard',
    'plugin:vue/recommended',
    'plugin:vuetify/base',
    'plugin:vuetify/recommended'
  ],
  plugins: [
    'vue',
    'jest',
    'import'
  ],
  settings: {
    'import/resolver': {
      alias: {
        map: [
          ['@', './src']
        ],
        extensions: ['.vue', '.js', '.gql']
      }
    }
  },
  rules: {
    'import/extensions': [
      'error',
      {
        'vue': 'always',
        'mixin': 'never',
        'js': 'never',
        'gql': 'always'
      }
    ],
    'no-console': 'off',
    'no-debugger': 'warn',
    'no-return-await': 'off',

    'vue/v-slot-style': [
      'warn',
      {
        atComponent: 'v-slot',
        default: 'longform',
        named: 'longform'
      }
    ],

    'vue/html-closing-bracket-newline': [
      'error',
      {
        singleline: 'never',
        multiline: 'never'
      }
    ],
    'vue/html-self-closing': [
      'error',
      {
        html: {
          void: 'always',
          normal: 'never',
          component: 'never'
        },
        svg: 'always',
        math: 'always'
      }
    ]
  },
  globals: {}
}

What did you do?

<template>
    <account-details-form :customer-number.sync="customerNumber"></account-details-form>
</template>

<script>
import AccountDetailsForm from '@/components/Accounts/AccountDetailsForm.vue'

export default {
  name: 'AccountDetailsDialog',
  components: {
    AccountDetailsForm
  },
  props: {
    customerNumber: {
      type: [Number, String],
      required: true
    }
  },
  data () {
    return {
      isDialogOpen: false,
      form: {}
    }
  }
}
</script>

What did you expect to happen?

That eslint would flag the :customer-number.sync="customerNumber" as an error for mutating a prop

What actually happened?

It does not

Repository to reproduce this issue

The repo seems unnecessary, eslint isn't breaking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions