Open gizembg opened 1 year ago
I notice you have it set as a warning and not an error - sometimes autofixing doesn't fix warnings. Can you try setting it to an error?
I have noticed that I have this issue only when if it is under return method of components. If it is outside of return the warning works. I need something to make it work also in return statements.
NO WARNING // I need the eslint block-spacing warning here
return (
<div
onClick = { this._onClick }>
<div className = 'pick'>
{`${name} (+${dialCode})`} - warning DOES NOT works when it is outside of return
</div>
</div>
);
WARNING // Requires a space after '{'.eslintblock-spacing
{`${name} (+${dialCode})`} - warning works when it is outside of return_
return (
<div
onClick = { this._onClick }>
<div className = 'pick'>
</div>
</div>
);
@ljharb Hey, thanks for suggestion. I've tried that too but if it is in return statement still doesn't show an error.
Is there an existing issue for this?
Description Overview
I have jsx-curly-spacing rule in my eslintlc.js file and it is working just except one condition. Is there any missing rule definition I had to add or is that a bug?
Eslint rule:
It is working formatted code example. There are spaces between curly braces.
However in that case there is no space is added after formatting:
Summary: I want to have space between curly braces and backtick(`) as I show on EXPECTED part. What I am missing here?
Expected Behavior
EXPECTED:
eslint-plugin-react version
v7.26.1
eslint version
v8.1.0
node version
v16.16.0