Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

getter and setter in same object cause "no-dupe-keys" #220

Closed
psiphi75 opened this issue Dec 4, 2015 · 2 comments
Closed

getter and setter in same object cause "no-dupe-keys" #220

psiphi75 opened this issue Dec 4, 2015 · 2 comments

Comments

@psiphi75
Copy link

psiphi75 commented Dec 4, 2015

I am running eslint 1.10.3 and babel-eslint 5.0.0-beta4. When I run eslint on the code below (see config below that) it causes a no-dupe-keys error. I don't expect any errors in this code, you should be able to have getters and setters. I have tried this through the standard eslint parser and it does not have any issues. I only get this error with babel-eslint.

test.js:

'use strict';
var B = {
    get x () {
        return this.ecks;
    },
    set x (ecks) {
        this.ecks = ecks;
    }
};
B.x = 1;

eslint output:

/home/me/test.js
  9:5  error  Duplicate key 'x'  no-dupe-keys

✖ 1 problem (1 error, 0 warnings)

Below is my .eslintrc configuration:

    {
      "parser": "babel-eslint",
      "rules": {
        "no-dupe-keys": [2],
      }
    }
@hzoo
Copy link
Member

hzoo commented Dec 4, 2015

Thanks - getters/setters aren't working. It's a known issue - similar to #218.

Also #199 (comment)

@hzoo
Copy link
Member

hzoo commented Dec 9, 2015

Published babel-eslint@5.0.0-beta6 which hopefully fixes this.

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

No branches or pull requests

2 participants