Eslint-plugin-react: Template string with special character are getting inappropriately autofix to quoted string

Created on 16 Oct 2017  路  2Comments  路  Source: yannickcr/eslint-plugin-react

<input placeholder={`line1\nline2`} ></input> gets autofix into
<input placeholder="line1\nline2" /> which treats the \n literally.

Versions:
"eslint-config-airbnb": "^16.0.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0"

bug help wanted

Most helpful comment

@ljharb Thanks for tagging me! I think this bug will be fixed in this PR because, with this update, the rule will identify the backslash and bail out instead of incorrectly fixing the code.

All 2 comments

cc @jackyho112

@ljharb Thanks for tagging me! I think this bug will be fixed in this PR because, with this update, the rule will identify the backslash and bail out instead of incorrectly fixing the code.

Was this page helpful?
0 / 5 - 0 ratings