new require("lib/Sniff/SyntaxTree/VariableDeclarationPerScopeConventions")(sourceCode, mediator)
Parameters:
Name | Type | Description |
---|---|---|
sourceCode |
module:lib/SourceCode | |
mediator |
module:lib/Mediator |
A module representing a sniffer.
Methods
-
<inner> define(factory)
-
Override AMD `define` function for RequireJS
Parameters:
Name Type Description factory
function -
<inner> run(rule, node)
-
Run the sniffer according a given rule if a given node type matches the case
Parameters:
Name Type Description rule
Object node
Object -
<protected, inner> sniff(node, actual, expected, errorCode)
-
Report to the mediator if `actual` doesn't match `expected`
Parameters:
Name Type Description node
Object actual
number expected
number errorCode
string -
<protected, inner> sniffPerScope(rule, node, fn)
-
Check node down recursevely and report to mediator if violation of a given rule found
Parameters:
Name Type Description rule
Object node
Object fn
function callback -
<protected, inner> sniffToBeFirst(scope)
-
Sniff if the var statement placed in the beginning of the scope
Parameters:
Name Type Description scope
Object[] -
<inner> validateRule(rule)
-
Check the contract
Parameters:
Name Type Description rule
Object