Skip to content

skipAttributesThatMatchRegex config needs to use strings in JSON #228

@hmajoros

Description

@hmajoros

When trying to use

skipAttributesThatMatchRegex: [/data-/gim, /aria-/gim],

in your config file, this is invalid JSON and the codemod will complain.

When changing this to be valid JSON, like

skipAttributesThatMatchRegex: ["/data-/gim", "/aria-/gim"],

now the rx.test() no longer works since String.test() is not a function

return config.skipAttributesThatMatchRegex.some(rx => rx.test(key));

I think we should be parsing the RegExp from a string in the code snippet above, and changing the README to ensure that regexp's are passed as a string value

@suchitadoshi1987 FYI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions