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

Inline if incompatible with jsx curly spacing. #1763

Closed
fpoirier1 opened this issue Apr 9, 2018 · 6 comments
Closed

Inline if incompatible with jsx curly spacing. #1763

fpoirier1 opened this issue Apr 9, 2018 · 6 comments

Comments

@fpoirier1
Copy link

fpoirier1 commented Apr 9, 2018

With this rule :
"react/jsx-curly-spacing": ["error", "never", {"allowMultiline": true}]

This will fail with error :
<div className={ this.state.renderInfo ? "infoPanel col-xs-12" : "unToggled col-xs-12" } >

sourceCode.getCommentsAfter is not a function
TypeError: sourceCode.getCommentsAfter is not a function at Object.fix (/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js:231:42)

This will pass :
<div className={this.state.renderInfo ? "infoPanel col-xs-12" : "unToggled col-xs-12"} >

@ljharb
Copy link
Member

ljharb commented Apr 10, 2018

This was fixed in #1565 and #1414. I'll add your test case to master to be sure.

@ljharb ljharb closed this as completed in 512b410 Apr 10, 2018
@alexhalf
Copy link

Has the same error with version 7.7.0

@alexhalf
Copy link

alexhalf commented Apr 27, 2018

<XXXXX
  ...other attrs
  atr={ a && b(c) }
>
...
</XXXX>

@ljharb
Copy link
Member

ljharb commented Apr 27, 2018

@alexhalf could you file a new issue for that?

@alexhalf
Copy link

const Fail = () => {
	const a = true;
	return <div attr={ a} />;
};

const Success = () => {
	const a = true;
	return <div attr={a} />;
};

@ljharb
Copy link
Member

ljharb commented Apr 28, 2018

@alexhalf a new issue, meaning, not this closed one :-)

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

No branches or pull requests

3 participants