aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJackson Ray Hamilton2015-10-30 23:55:24 -0700
committerJackson Ray Hamilton2015-10-31 13:02:36 -0700
commit958da7ff63d1d647f45fd649654136da78529324 (patch)
treed971bf4c54fef8741bf4f11912508f4dd40162cb /test
parent65a3808fcf0afbd90d3ae512ff1ae4395bb2ee69 (diff)
downloademacs-958da7ff63d1d647f45fd649654136da78529324.tar.gz
emacs-958da7ff63d1d647f45fd649654136da78529324.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/indent/js-jsx.js85
1 files changed, 85 insertions, 0 deletions
diff --git a/test/indent/js-jsx.js b/test/indent/js-jsx.js
new file mode 100644
index 00000000000..7401939d282
--- /dev/null
+++ b/test/indent/js-jsx.js
@@ -0,0 +1,85 @@
1// -*- mode: js-jsx; -*-
2
3var foo = <div></div>;
4
5return (
6 <div>
7 </div>
8 <div>
9 <div></div>
10 <div>
11 <div></div>
12 </div>
13 </div>
14);
15
16React.render(
17 <div>
18 <div></div>
19 </div>,
20 {
21 a: 1
22 },
23 <div>
24 <div></div>
25 </div>
26);
27
28return (
29 // Sneaky!
30 <div></div>
31);
32
33return (
34 <div></div>
35 // Sneaky!
36);
37
38React.render(
39 <input
40 />,
41 {
42 a: 1
43 }
44);
45
46return (
47 <div>
48 {array.map(function () {
49 return {
50 a: 1
51 };
52 })}
53 </div>
54);
55
56return (
57 <div attribute={array.map(function () {
58 return {
59 a: 1
60 };
61
62 return {
63 a: 1
64 };
65
66 return {
67 a: 1
68 };
69 })}>
70 </div>
71);
72
73// Local Variables:
74// indent-tabs-mode: nil
75// js-indent-level: 2
76// End:
77
78// The following test has intentionally unclosed elements and should
79// be placed below all other tests to prevent awkward indentation.
80
81return (
82 <div>
83 {array.map(function () {
84 return {
85 a: 1