mozilla / scanjs

[DEPRECATED] Static analysis tool for javascript code.
Other
429 stars 39 forks source link

Rule for values inside object? #176

Closed amotmot closed 9 years ago

amotmot commented 9 years ago

Is it possible to write a rule to detect that bar is set to 'string' in the below object? Ideally, I would like to detect both below use cases?

jsvar dboptions = {
    foo: {
        bar: 'string'
    }
}

or db.connect(dbconnect, { foo: { bar: 'string'} } )

mozfreddyb commented 9 years ago

Is it possible to write a rule to detect that foo is to to bar inside a given object?

Sorry, but I don't understand what you want to detect. Can you rephrase?

dpnishant commented 9 years ago

Hi @mozfreddyb ,

To me, it seems @gellerb is trying to detect if the "source" or "sink" is an attribute of an object.

amotmot commented 9 years ago

@dpnishant & @mozfreddyb I'm new to ESLint but are the above test cases better suited for ESLint?

Also, I updated my initial comment.