1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00
emacs/test/indent/js-jsx.js
Jackson Ray Hamilton 958da7ff63 Add JSX indentation via js-jsx-mode. (Bug#21799)
* progmodes/js.el: Add JSX indentation support.
(js-jsx-indent-line)
(js-jsx-mode): New functions.
2015-10-31 13:02:36 -07:00

86 lines
994 B
JavaScript

// -*- mode: js-jsx; -*-
var foo = <div></div>;
return (
<div>
</div>
<div>
<div></div>
<div>
<div></div>
</div>
</div>
);
React.render(
<div>
<div></div>
</div>,
{
a: 1
},
<div>
<div></div>
</div>
);
return (
// Sneaky!
<div></div>
);
return (
<div></div>
// Sneaky!
);
React.render(
<input
/>,
{
a: 1
}
);
return (
<div>
{array.map(function () {
return {
a: 1
};
})}
</div>
);
return (
<div attribute={array.map(function () {
return {
a: 1
};
return {
a: 1
};
return {
a: 1
};
})}>
</div>
);
// Local Variables:
// indent-tabs-mode: nil
// js-indent-level: 2
// End:
// The following test has intentionally unclosed elements and should
// be placed below all other tests to prevent awkward indentation.
return (
<div>
{array.map(function () {
return {
a: 1