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

Setting length #1

Open
danielearwicker opened this issue Nov 7, 2017 · 1 comment
Open

Setting length #1

danielearwicker opened this issue Nov 7, 2017 · 1 comment

Comments

@danielearwicker
Copy link

An array’s length property can be set, eg. to shorten the array. This should be allowed.

@leroydev
Copy link
Owner

leroydev commented Nov 8, 2017

I agree, I think the best way to fix this is to implement a whitelist option, in which users can define properties that will be ignored by this rule, like this:

"no-setting-array-properties": {
    "options": {
        "whitelist": ["length"]
    }
}

With as default I'd guess:
["length", "prototype", "__proto__"]

What do you think about this? :) @danielearwicker

@leroydev leroydev self-assigned this Nov 8, 2017
@leroydev leroydev removed their assignment Oct 29, 2019
@leroydev leroydev pinned this issue Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants