Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(javascript rule): add support for react's dangerouslySetInnerHTML #688

Merged
merged 5 commits into from
Feb 28, 2023

Conversation

vjerci
Copy link
Contributor

@vjerci vjerci commented Feb 28, 2023

Description

  1. This pr adds a rule enabling us to search for footprint of dangeroslysetInnerHTML
  2. It also adds support for template_string allowing us to use:
  • patterns like this $<ANYTHING:template_string> to search for template strings
  • patterns such as code snippet below, for searching template strings which use some sort of input in them.
`$<...>${$<...>$<_>$<...>}$<...>`
  • Combine 2 with not filter and we get a powerful rule mechanics for distinguishing various inputs.

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

Copy link
Contributor

@elsapet elsapet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 😎

@vjerci vjerci marked this pull request as ready for review February 28, 2023 15:36
@vjerci vjerci merged commit f77ca4e into main Feb 28, 2023
@vjerci vjerci deleted the feat/js-dangerously_set_inner_html branch February 28, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants