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

jsx-no-target-blank usage with jsx-curly-brace-presence #2508

Closed
probwebdev opened this issue Nov 30, 2019 · 2 comments · Fixed by #2544
Closed

jsx-no-target-blank usage with jsx-curly-brace-presence #2508

probwebdev opened this issue Nov 30, 2019 · 2 comments · Fixed by #2544

Comments

@probwebdev
Copy link

eslint: 6.7.2
eslint-plugin-react: 7.17.0
eslint config: https://gist.github.com/robertgorbul/414e99899a12b56fef8d6ec9db4bf72e

29:11 Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener
  27 |         href={'https://www.gatsbyjs.org'}
  28 |         aria-label={'Gatsby.js - Blazing fast modern site generator for React'}
> 29 |         target={'_blank'}
     |         ^
  30 |         rel={'noopener noreferrer'}
  31 |         >
  32 |         Gatsby
30:15 Need to wrap this literal in a JSX expression.
    28 |    aria-label={'Gatsby.js - Blazing fast modern site generator for React'}
    29 |    target={'_blank'}
  > 30 |    rel='noopener noreferrer'
       |    ^
    31 |    >
    32 |      Gatsby
    33 |    </a>
@ljharb
Copy link
Member

ljharb commented Nov 30, 2019

Looks like jsx-no-target-blank could add an exception for a string literal inside curly braces. (i suspect nobody ran into it since a curly-brace-presence of always for props is an exceedingly rare convention)

@probwebdev
Copy link
Author

Btw it's started throwing error with 7.17.0, versions prior to that is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants