russplaysguitar / navel

Working towards a linter for cfscript
MIT License
2 stars 0 forks source link

parameterExists() #25

Open russplaysguitar opened 11 years ago

russplaysguitar commented 11 years ago

use of parameterExists() should fail lint. structKeyExists() should be used instead.

cfjedimaster commented 11 years ago

Disagree. parameterExists() is deprecated in favor of isDefined. Yes, many people use structKeyExists instead, BUT, that only applies when you are truly looking for a key in a scope. Of course, every variable is now in a scope. I don't know - I just feel like you should be more explicit.

russplaysguitar commented 11 years ago

Is isDefined() still valid if all variables have scopes now?

I'm thinking that the linter will have options so that if you want to use discouraged functions you can specify that. Ideally, you'd be able to specify it for function scopes, at the file level, or as a parsing option for the linter itself.

adamcameron commented 11 years ago

isDefined() should be actively discouraged almost as much as parameterExists(), in my book. It's prone to false positives due to scope-searching.

atuttle commented 11 years ago

I agree with @russplaysguitar and @adamcameroncoldfusion