Skip to content

Over-restrictive regex for function definitions? #37

@mekhami

Description

@mekhami

In the regex for function definitions (specifically looked at arrow functions but could also apply to others, didn't look):

--regex-javascript=/^[ \t]*var[ \t]\{1,\}\([a-z_$][A-Za-z0-9_$]\{1,\}\)[ \t]*=.\{1,\}=>/\1/F,Function,Functions/b
--regex-javascript=/^[ \t]*let[ \t]\{1,\}\([a-z_$][A-Za-z0-9_$]\{1,\}\)[ \t]*=.\{1,\}=>/\1/F,Function,Functions/b
--regex-javascript=/^[ \t]*const[ \t]\{1,\}\([a-z_$][A-Za-z0-9_$]\{1,\}\)[ \t]*=.\{1,\}=>/\1/F,Function,Functions/b

Why does the first character of the function need to be lower cased? I specifically have a React component definition:

const MyModal = ({ prop1, prop2 }) => {

}

export default MyModal

This definition is skipped because of the capital case component function name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions