Skip to content

vue/no-unused-properties does not detect usages in watch handlers #1245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scp-mb opened this issue Jul 15, 2020 · 1 comment · Fixed by #1255
Closed

vue/no-unused-properties does not detect usages in watch handlers #1245

scp-mb opened this issue Jul 15, 2020 · 1 comment · Fixed by #1255
Labels

Comments

@scp-mb
Copy link

scp-mb commented Jul 15, 2020

Tell us about your environment

  • ESLint version :6.8.0
  • eslint-plugin-vue version: 7.0.0-alpha.9
  • Node version:11.5.0

Please show your full configuration:

module.exports = {
  env: {
    node: true
  },
  extends: [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  parser: 'vue-eslint-parser',
  parserOptions: {
    parser: 'babel-eslint'
  },
  root: true,
  rules: {
    /* omitted other rules */
    'vue/no-unused-properties': [ 'warn', {
      'groups': ['props', 'data', 'computed', 'methods', 'setup']
    }]
  }
}

What did you do?

Calls to methods within watch handlers do not get picked up as being used by vue/no-unused-properties. GetMoreData will be highlighted as unused

watch: {
  someData: {
    handler: 'GetMoreData',
    immediate: true
  }
},

......


methods: {
  GetMoreData () {
    /* business logic here */
  }
}

What did you expect to happen?
GetMoreData is not flagged as unused

What actually happened?

'GetMoreData' of method found, but never used. eslint(vue/no-unused-properties)

@ota-meshi
Copy link
Member

Thank you for this issue!

It looks like a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants