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

Rule Improvement: 'ban' should be able to ban object reference #2290

Closed
usuyama opened this issue Mar 2, 2017 · 7 comments
Closed

Rule Improvement: 'ban' should be able to ban object reference #2290

usuyama opened this issue Mar 2, 2017 · 7 comments

Comments

@usuyama
Copy link
Contributor

usuyama commented Mar 2, 2017

Suggestion

Add a new option disallow-object-reference to Rule: ban

Motivation

Rule: ban only catches function calls. We stumbled upon a need of catching specific object reference, which is 'self' in our case.

Without local declaration, self refers to window.self. While removing an old convention, var self = this;, we noticed it's prone to overlook because the compiler doesn't throw error because self is still valid.

@Zzzen
Copy link
Contributor

Zzzen commented Mar 21, 2018

window.name is annoying too.

@NN---
Copy link
Contributor

NN--- commented Jun 24, 2018

Is there any solution ?
I need to disallow using a specific global object.

@Zzzen
Copy link
Contributor

Zzzen commented Jun 25, 2018

you can ban global object If this PR is merged.

@NN---
Copy link
Contributor

NN--- commented Jun 26, 2018

Which PR should I vote for ?

@Zzzen
Copy link
Contributor

Zzzen commented Jun 26, 2018

Sorry, this one. #3824

@NN---
Copy link
Contributor

NN--- commented Jun 26, 2018

I see the build is failing, perhaps you should fix it first.

@JoshuaKGoldberg
Copy link
Contributor

Duplicate of #922, which that PR addresses.

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

4 participants