Skip to content
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

prop with getter and setter triggering vue/no-dupe-keys in data() #966

Closed
digital88 opened this issue Sep 24, 2019 · 1 comment · Fixed by #1190
Closed

prop with getter and setter triggering vue/no-dupe-keys in data() #966

digital88 opened this issue Sep 24, 2019 · 1 comment · Fixed by #1190
Labels

Comments

@digital88
Copy link

Tell us about your environment

  • ESLint version: 5.16.0
  • eslint-plugin-vue version: 5.2.3
  • Node version: v10.15.2

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ["plugin:vue/essential", "@vue/prettier"],
  rules: {
    "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
  },
  parserOptions: {
    parser: "babel-eslint"
  }
};

What did you do?

export default {
  data() {
    const _this = this;
    return {
      get selectedType() {
        return _this.filters && _this.filters.type;
      },
      set selectedType(val) {
        _this.setFilter({
          key: "type",
          value: val
        });
      },
    };
  },
}

What did you expect to happen?
no error in console output

What actually happened?

error: Duplicated key 'selectedType' (vue/no-dupe-keys) at ...

@benchik
Copy link

benchik commented Jan 1, 2020

I'm experiencing the same issue.

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

Successfully merging a pull request may close this issue.

3 participants