Skip to content

Javascript sniffer fails with function called "Function" #1191

@gsouf

Description

@gsouf

Running php code sniffer on javascript file that has the function Function will detect it as the keyword function. See the example:

var a = Function('return 1+1');

Code fixer returns this error:

Expected 1 space after FUNCTION keyword; 0 found (Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction) 

But this line is actually correct and there is no fix needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions