]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/tests/lib/rules/key-spacing.js
dd0fcbc4dcf68c43e40d654409873860ba82ed3a
2 * @fileoverview Tests for key-spacing rule.
3 * @author Brandon Mills
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
12 const rule
= require("../../../lib/rules/key-spacing"),
13 { RuleTester
} = require("../../../lib/rule-tester");
15 //------------------------------------------------------------------------------
17 //------------------------------------------------------------------------------
19 const ruleTester
= new RuleTester();
21 ruleTester
.run("key-spacing", rule
, {
23 valid
: ["({\n})", "({\na: b\n})", {
25 options
: [{ align
: "colon" }]
28 options
: [{ align
: "value" }]
30 code
: "var obj = { key: value };",
33 code
: "var obj = { [(a + b)]: value };",
35 parserOptions
: { ecmaVersion
: 6 }
37 code
: "var foo = { a:bar };",
43 code
: "var foo = { a: bar };",
49 code
: "foo({ 'default': function(){}});",
55 code
: "function foo() { return {\n key: (foo === 4)\n}; }",
61 code
: "var obj = {'key' :42 };",
67 code
: "({a : foo, b : bar})['a'];",
83 parserOptions
: { ecmaVersion
: 6 }
89 " [compute] :'value'",
97 parserOptions
: { ecmaVersion
: 6 }
102 " 'foobar': 'value',",
103 " bat: function() {",
133 " // different group",
163 code
: "obj = { key :longName };",
170 code
: "var obj = { get fn() { return 42; } };",
173 code
: "({ get fn() {} })",
174 options
: [{ align
: "colon" }]
176 code
: "var obj = {foo: 'fee', bar: 'bam'};",
177 options
: [{ align
: "colon" }]
179 code
: "var obj = {a: 'foo', bar: 'bam'};",
180 options
: [{ align
: "colon" }]
188 options
: [{ align
: "colon" }]
196 options
: [{ align
: "colon", beforeColon
: true }]
204 options
: [{ align
: "colon" }]
215 options
: [{ align
: "value" }],
216 parserOptions
: { ecmaVersion
: 6, sourceType
: "module" }
225 parserOptions
: { ecmaVersion
: 6 }
234 options
: [{ align
: "value" }],
235 parserOptions
: { ecmaVersion
: 6 }
244 options
: [{ align
: "value" }],
245 parserOptions
: { ecmaVersion
: 6 }
253 parserOptions
: { ecmaVersion
: 6 }
262 options
: [{ align
: "value" }],
263 parserOptions
: { ecmaVersion
: 6 }
272 options
: [{ align
: "value" }],
273 parserOptions
: { ecmaVersion
: 6 }
284 options
: [{ align
: "value" }],
285 parserOptions
: { ecmaVersion
: 6 }
294 options
: [{ align
: "colon" }]
297 "var obj = { foo : foo",
302 options
: [{ align
: "colon" }]
317 // https://github.com/eslint/eslint/issues/4763
319 code
: "({a : foo, ...x, b : bar})['a'];",
324 parserOptions
: { ecmaVersion
: 2018 }
330 " foobar : 'value',",
337 parserOptions
: { ecmaVersion
: 2018 }
344 " 'another' :false,",
345 " [compute] :'value'",
353 parserOptions
: { ecmaVersion
: 2018 }
359 " 'foobar': 'value',",
360 " bat: function() {",
369 parserOptions
: { ecmaVersion
: 2018 }
379 " // different group",
389 parserOptions
: { ecmaVersion
: 2018 }
392 // https://github.com/eslint/eslint/issues/4792
397 " get b() { return 42; }",
417 " get b() { return 42; },",
429 " get b() { return 42; },",
444 " get b() { return 42; },",
447 " obj : {a: 1, b: 2, c: 3}",
465 " get b() { return 42; },",
468 " def : {a: 1, b: 2, c: 3}",
503 // https://github.com/eslint/eslint/issues/5724
505 code
: "({...object})",
509 parserOptions
: { ecmaVersion
: 2018 }
512 // https://github.com/eslint/eslint/issues/5613
514 { // if `align` is an object, but `on` is not declared, `on` defaults to `colon`
531 parserOptions
: { ecmaVersion
: 6 }
550 parserOptions
: { ecmaVersion
: 6 }
568 parserOptions
: { ecmaVersion
: 6 }
584 parserOptions
: { ecmaVersion
: 6 },
602 parserOptions
: { ecmaVersion
: 6 }
620 parserOptions
: { ecmaVersion
: 6 }
624 " func: function() {",
630 " func2 : function() {",
631 " var test2 = true;",
654 parserOptions
: { ecmaVersion
: 6 }
658 " func: function() {",
664 " func2: function() {",
665 " var test2 = true;",
685 parserOptions
: { ecmaVersion
: 6 }
692 " stateName : 'NY',",
693 " borough : 'Brooklyn',",
695 " f2 : function() {",
696 " var test2 = true;",
713 parserOptions
: { ecmaVersion
: 6 }
738 parserOptions
: { ecmaVersion
: 6 }
763 parserOptions
: { ecmaVersion
: 6 }
767 " foo : 1, 'bar' : 2, baz : 3, longlonglong : 4",
784 " foo: 1, 'bar': 2, baz: 3",
823 code
: "var obj = { foo:1, 'bar':2, baz:3, longlonglong:4 }",
837 " 'bar' : 2, baz : 3, longlonglong: 4",
853 " 'bar': 2, baz: 3, longlonglong: 4",
869 " 'bar' : 2, baz : 3,",
886 " 'bar': 2, baz: 3,",
901 // https://github.com/eslint/eslint/issues/15914
935 "🌷": "bar", // 2 code points
936 "🎁": "baz", // 2 code points
937 "🇮🇳": "qux", // 4 code points
938 "🏳️🌈": "xyz", // 6 code points
959 parserOptions
: { ecmaVersion
: 6 }
973 parserOptions
: { ecmaVersion
: 6 }
976 code
: "var a ={'key' : value };",
977 output
: "var a ={'key':value };",
986 messageId
: "extraKey",
987 data
: { computed
: "", key
: "key" },
995 messageId
: "extraValue",
996 data
: { computed
: "", key
: "key" },
1004 code
: "var a ={'key' :value };",
1005 output
: "var a ={'key': value };",
1014 messageId
: "extraKey",
1015 data
: { computed
: "", key
: "key" },
1023 messageId
: "missingValue",
1024 data
: { computed
: "", key
: "key" },
1032 code
: "var a ={'key'\n : \nvalue };",
1033 output
: "var a ={'key':value };",
1042 messageId
: "extraKey",
1043 data
: { computed
: "", key
: "key" },
1051 messageId
: "extraValue",
1052 data
: { computed
: "", key
: "key" },
1060 code
: "var bat = function() { return { foo:bar, 'key': value }; };",
1061 output
: "var bat = function() { return { foo:bar, 'key':value }; };",
1068 messageId
: "extraValue",
1069 data
: { computed
: "", key
: "key" },
1078 code
: "var obj = { [ (a + b) ]:value };",
1079 output
: "var obj = { [ (a + b) ]: value };",
1081 parserOptions
: { ecmaVersion
: 6 },
1082 errors
: [{ messageId
: "missingValue", data
: { computed
: "computed ", key
: "a + b" }, type
: "Identifier", line
: 1, column
: 25 }]
1084 code
: "fn({ foo:bar, 'key' :value });",
1085 output
: "fn({ foo:bar, 'key':value });",
1090 errors
: [{ messageId
: "extraKey", data
: { computed
: "", key
: "key" }, type
: "Literal", line
: 1, column
: 20, endLine
: 1, endColumn
: 21 }]
1092 code
: "var obj = {prop :(42)};",
1093 output
: "var obj = {prop : (42)};",
1098 errors
: [{ messageId
: "missingValue", data
: { computed
: "", key
: "prop" }, type
: "Literal", line
: 1, column
: 18 }]
1100 code
: "({'a' : foo, b: bar() }).b();",
1101 output
: "({'a' : foo, b : bar() }).b();",
1106 errors
: [{ messageId
: "missingKey", data
: { computed
: "", key
: "b" }, type
: "Identifier", line
: 1, column
: 14 }]
1108 code
: "({'a' :foo(), b: bar() }).b();",
1109 output
: "({'a' : foo(), b : bar() }).b();",
1115 { messageId
: "extraKey", data
: { computed
: "", key
: "a" }, type
: "Literal", line
: 1, column
: 6, endLine
: 1, endColumn
: 8 },
1116 { messageId
: "missingValue", data
: { computed
: "", key
: "a" }, type
: "CallExpression", line
: 1, column
: 9, endLine
: 1, endColumn
: 12 },
1117 { messageId
: "missingKey", data
: { computed
: "", key
: "b" }, type
: "Identifier", line
: 1, column
: 16, endLine
: 1, endColumn
: 17 },
1118 { messageId
: "extraValue", data
: { computed
: "", key
: "b" }, type
: "CallExpression", line
: 1, column
: 17, endLine
: 1, endColumn
: 20 }
1121 code
: "bar = { key:value };",
1122 output
: "bar = { key: value };",
1127 errors
: [{ messageId
: "missingValue", data
: { computed
: "", key
: "key" }, type
: "Identifier", line
: 1, column
: 13 }]
1147 { messageId
: "missingKey", data
: { computed
: "", key
: "key" }, type
: "Identifier", line
: 2, column
: 5 },
1148 { messageId
: "extraValue", data
: { computed
: "", key
: "key" }, type
: "Identifier", line
: 2, column
: 8 },
1149 { messageId
: "missingValue", data
: { computed
: "", key
: "foobar" }, type
: "CallExpression", line
: 3, column
: 12 }
1174 { messageId
: "extraValue", data
: { computed
: "", key
: "a" }, type
: "Identifier", line
: 2, column
: 9 },
1175 { messageId
: "missingKey", data
: { computed
: "", key
: "foo" }, type
: "Identifier", line
: 3, column
: 5 },
1176 { messageId
: "extraKey", data
: { computed
: "", key
: "b" }, type
: "Identifier", line
: 4, column
: 6 }
1200 parserOptions
: { ecmaVersion
: 6 },
1202 { messageId
: "extraValue", data
: { computed
: "", key
: "a" }, type
: "CallExpression", line
: 2, column
: 6 },
1203 { messageId
: "extraKey", data
: { computed
: "", key
: "b" }, type
: "Literal", line
: 3, column
: 8 },
1204 { messageId
: "missingValue", data
: { computed
: "", key
: "foo" }, type
: "Identifier", line
: 4, column
: 9 },
1205 { messageId
: "extraKey", data
: { computed
: "computed ", key
: "a" }, type
: "Identifier", line
: 6, column
: 8 }
1230 { messageId
: "missingKey", data
: { computed
: "", key
: "a" }, type
: "Identifier", line
: 2, column
: 5 },
1231 { messageId
: "extraValue", data
: { computed
: "", key
: "bar" }, type
: "CallExpression", line
: 5, column
: 9 }
1256 { messageId
: "missingKey", data
: { computed
: "", key
: "a" }, type
: "Identifier", line
: 2, column
: 5 },
1257 { messageId
: "missingKey", data
: { computed
: "", key
: "e" }, type
: "Identifier", line
: 5, column
: 5 },
1258 { messageId
: "missingValue", data
: { computed
: "", key
: "fg" }, type
: "Literal", line
: 6, column
: 8 }
1266 " :anotherLongValue",
1271 " key:longValueName,",
1272 " key2:anotherLongValue",
1280 { messageId
: "extraValue", data
: { computed
: "", key
: "key" }, type
: "Identifier", line
: 2, column
: 8 },
1281 { messageId
: "extraKey", data
: { computed
: "", key
: "key2" }, type
: "Identifier", line
: 4, column
: 9 }
1287 " // still the same group",
1291 " key123: 'forty two'",
1297 " // still the same group",
1301 " key123: 'forty two'",
1308 { messageId
: "missingValue", data
: { computed
: "", key
: "key1" }, type
: "Literal" },
1309 { messageId
: "missingValue", data
: { computed
: "", key
: "key12" }, type
: "Literal" }
1312 code
: "foo = { key:(1+2) };",
1313 output
: "foo = { key: (1+2) };",
1315 { messageId
: "missingValue", data
: { computed
: "", key
: "key" }, line
: 1, column
: 13, type
: "BinaryExpression" }
1318 code
: "foo = { key:( ( (1+2) ) ) };",
1319 output
: "foo = { key: ( ( (1+2) ) ) };",
1321 { messageId
: "missingValue", data
: { computed
: "", key
: "key" }, line
: 1, column
: 13, type
: "BinaryExpression" }
1324 code
: "var obj = {a : 'foo', bar: 'bam'};",
1325 output
: "var obj = {a: 'foo', bar: 'bam'};",
1326 options
: [{ align
: "colon" }],
1328 { messageId
: "extraKey", data
: { computed
: "", key
: "a" }, line
: 1, column
: 13, type
: "Identifier" }
1343 options
: [{ align
: "colon" }],
1345 { messageId
: "extraKey", data
: { computed
: "", key
: "b" }, line
: 3, column
: 6, type
: "Identifier" }
1360 options
: [{ align
: "colon", beforeColon
: true }],
1362 { messageId
: "missingKey", data
: { computed
: "", key
: "b" }, line
: 3, column
: 11, type
: "Identifier" }
1378 { messageId
: "extraValue", data
: { computed
: "", key
: "key" }, line
: 2, column
: 2, type
: "Identifier" }
1395 options
: [{ align
: "value" }],
1396 parserOptions
: { ecmaVersion
: 6 },
1398 { messageId
: "missingValue", data
: { computed
: "", key
: "baz" }, line
: 4, column
: 10, type
: "Literal" }
1415 options
: [{ align
: "value" }],
1416 parserOptions
: { ecmaVersion
: 6 },
1418 { messageId
: "extraValue", data
: { computed
: "", key
: "foobar" }, line
: 2, column
: 11, type
: "Literal" }
1435 options
: [{ align
: "value" }],
1436 parserOptions
: { ecmaVersion
: 6 },
1438 { messageId
: "missingValue", data
: { computed
: "", key
: "baz" }, line
: 4, column
: 10, type
: "Literal" }
1455 options
: [{ align
: "value" }],
1456 parserOptions
: { ecmaVersion
: 6 },
1458 { messageId
: "extraValue", data
: { computed
: "", key
: "foobar" }, line
: 2, column
: 11, type
: "Literal" }
1479 options
: [{ align
: "value" }],
1480 parserOptions
: { ecmaVersion
: 6 },
1482 { messageId
: "extraValue", data
: { computed
: "", key
: "baz" }, line
: 6, column
: 8, type
: "Literal" }
1497 options
: [{ align
: "colon" }],
1499 { messageId
: "missingKey", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 5, type
: "Identifier" }
1514 options
: [{ align
: "colon" }],
1516 { messageId
: "extraValue", data
: { computed
: "", key
: "cats" }, line
: 3, column
: 9, type
: "Identifier" }
1520 "var obj = { foo: foo",
1525 "var obj = { foo : foo",
1529 options
: [{ align
: "colon" }],
1531 { messageId
: "missingKey", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 13, type
: "Identifier" }
1535 "var obj = { foo : foo",
1540 "var obj = { foo : foo",
1544 options
: [{ align
: "colon" }],
1546 { messageId
: "extraKey", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 16, type
: "Identifier" }
1550 "var obj = { foo :foo",
1555 "var obj = { foo : foo",
1559 options
: [{ align
: "colon" }],
1561 { messageId
: "missingValue", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 18, type
: "Identifier" }
1565 "var obj = { foo : foo",
1570 "var obj = { foo : foo",
1574 options
: [{ align
: "colon" }],
1576 { messageId
: "extraValue", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 17, type
: "Identifier" }
1580 "var obj = { foo : foo",
1585 "var obj = { foo : foo",
1589 options
: [{ align
: "colon" }],
1591 { messageId
: "extraValue", data
: { computed
: "", key
: "cats" }, line
: 2, column
: 17, type
: "Identifier" }
1595 // https://github.com/eslint/eslint/issues/4763
1605 " // different group",
1620 " // different group",
1627 options
: [{ align
: "colon" }],
1628 parserOptions
: { ecmaVersion
: 2018 },
1630 { messageId
: "missingKey", data
: { computed
: "", key
: "a" }, line
: 3, column
: 5, type
: "Identifier" },
1631 { messageId
: "extraKey", data
: { computed
: "", key
: "f" }, line
: 12, column
: 6, type
: "Identifier" }
1635 // https://github.com/eslint/eslint/issues/4792
1640 " get b() { return 42; }",
1646 " get b() { return 42; }",
1653 { messageId
: "extraKey", data
: { computed
: "", key
: "a" }, line
: 2, column
: 6, type
: "Identifier" }
1658 " set a(b) { b; },",
1664 " set a(b) { b; },",
1672 { messageId
: "extraKey", data
: { computed
: "", key
: "c" }, line
: 3, column
: 6, type
: "Identifier" }
1678 " get b() { return 42; },",
1679 " set c(v) { v; },",
1686 " get b() { return 42; },",
1687 " set c(v) { v; },",
1695 { messageId
: "missingKey", data
: { computed
: "", key
: "a" }, line
: 2, column
: 5, type
: "Identifier" }
1701 " get b() { return 42; },",
1702 " set c(v) { v; },",
1704 " def2 : {a1: 1, b1:2, c1:3}",
1710 " get b() { return 42; },",
1711 " set c(v) { v; },",
1713 " def2 : {a1:1, b1:2, c1:3}",
1729 { messageId
: "extraValue", data
: { computed
: "", key
: "a1" }, line
: 6, column
: 15, type
: "Literal" }
1735 " get b() { return 42; },",
1736 " set c(v) { v; },",
1738 " de1: {a2: 1, b2 : 2, c2 : 3}",
1744 " get b() { return 42; },",
1745 " set c(v) { v; },",
1747 " de1: {a2 : 1, b2 : 2, c2 : 3}",
1762 { messageId
: "missingKey", data
: { computed
: "", key
: "a2" }, line
: 6, column
: 11, type
: "Identifier" }
1767 " get fx() { return 'f'; },",
1768 " get gx() { return 'g'; },",
1774 " get fx() { return 'f'; },",
1775 " get gx() { return 'g'; },",
1786 { messageId
: "missingValue", data
: { computed
: "", key
: "ex" }, line
: 4, column
: 7, type
: "Identifier" }
1791 " get fx() { return 'f'; },",
1792 " get gx() { return 'g'; },",
1798 " get fx() { return 'f'; },",
1799 " get gx() { return 'g'; },",
1810 { messageId
: "extraKey", data
: { computed
: "", key
: "ex" }, line
: 4, column
: 6, type
: "Identifier" }
1816 " get b() { return 43; },",
1817 " set c(v) { v; },",
1824 " get b() { return 43; },",
1825 " set c(v) { v; },",
1836 { messageId
: "missingKey", data
: { computed
: "", key
: "aInv" }, line
: 2, column
: 5, type
: "Identifier" },
1837 { messageId
: "missingValue", data
: { computed
: "", key
: "aInv" }, line
: 2, column
: 11, type
: "Literal" }
1841 // https://github.com/eslint/eslint/issues/5724
1843 code
: "({ a:b, ...object, c : d })",
1844 output
: "({ a: b, ...object, c: d })",
1845 options
: [{ align
: "colon" }],
1846 parserOptions
: { ecmaVersion
: 2018 },
1848 { messageId
: "missingValue", data
: { computed
: "", key
: "a" }, line
: 1, column
: 6, type
: "Identifier" },
1849 { messageId
: "extraKey", data
: { computed
: "", key
: "c" }, line
: 1, column
: 21, type
: "Identifier" }
1853 // https://github.com/eslint/eslint/issues/5613
1877 parserOptions
: { ecmaVersion
: 6 },
1879 { messageId
: "missingKey", data
: { computed
: "", key
: "longName" }, line
: 2, column
: 5, type
: "Identifier" },
1880 { messageId
: "missingValue", data
: { computed
: "", key
: "longName" }, line
: 2, column
: 14, type
: "Literal" },
1881 { messageId
: "missingValue", data
: { computed
: "", key
: "small" }, line
: 3, column
: 15, type
: "Literal" },
1882 { messageId
: "missingKey", data
: { computed
: "", key
: "xs" }, line
: 4, column
: 5, type
: "Identifier" }
1887 " func:function() {",
1888 " var test = true;",
1893 " func2 : function() {",
1894 " var test2 = true;",
1901 " func: function() {",
1902 " var test = true;",
1907 " func2 : function() {",
1908 " var test2 = true;",
1925 parserOptions
: { ecmaVersion
: 6 },
1927 { messageId
: "missingValue", data
: { computed
: "", key
: "func" }, line
: 2, column
: 10, type
: "FunctionExpression" },
1928 { messageId
: "missingKey", data
: { computed
: "", key
: "longName" }, line
: 5, column
: 5, type
: "Identifier" },
1929 { messageId
: "missingKey", data
: { computed
: "", key
: "small" }, line
: 6, column
: 5, type
: "Identifier" },
1930 { messageId
: "extraKey", data
: { computed
: "", key
: "xs" }, line
: 7, column
: 7, type
: "Identifier" },
1931 { messageId
: "extraKey", data
: { computed
: "", key
: "singleLine" }, line
: 11, column
: 15, type
: "Identifier" }
1936 " func:function() {",
1937 " var test = false;",
1942 " func2 : function() {",
1943 " var test2 = true;",
1950 " func: function() {",
1951 " var test = false;",
1956 " func2 :function() {",
1957 " var test2 = true;",
1974 parserOptions
: { ecmaVersion
: 6 },
1976 { messageId
: "missingValue", data
: { computed
: "", key
: "func" }, line
: 2, column
: 10, type
: "FunctionExpression" },
1977 { messageId
: "missingKey", data
: { computed
: "", key
: "small" }, line
: 6, column
: 5, type
: "Identifier" },
1978 { messageId
: "extraKey", data
: { computed
: "", key
: "xs" }, line
: 7, column
: 7, type
: "Identifier" },
1979 { messageId
: "extraValue", data
: { computed
: "", key
: "xs" }, line
: 7, column
: 19, type
: "Literal" },
1980 { messageId
: "extraValue", data
: { computed
: "", key
: "func2" }, line
: 8, column
: 14, type
: "FunctionExpression" },
1981 { messageId
: "extraKey", data
: { computed
: "", key
: "singleLine" }, line
: 11, column
: 15, type
: "Identifier" }
2016 parserOptions
: { ecmaVersion
: 6 },
2018 { messageId
: "extraValue", data
: { computed
: "", key
: "key2" }, line
: 4, column
: 9, type
: "Literal" },
2019 { messageId
: "extraValue", data
: { computed
: "", key
: "key3" }, line
: 5, column
: 9, type
: "Literal" }
2054 parserOptions
: { ecmaVersion
: 6 },
2056 { messageId
: "extraValue", data
: { computed
: "", key
: "key2" }, line
: 4, column
: 9, type
: "Literal" },
2057 { messageId
: "extraValue", data
: { computed
: "", key
: "key3" }, line
: 5, column
: 9, type
: "Literal" }
2061 // https://github.com/eslint/eslint/issues/7603
2062 code
: "({ foo/* comment */ : bar })",
2063 output
: "({ foo/* comment */: bar })",
2064 errors
: [{ messageId
: "extraKey", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 20, type
: "Identifier" }]
2066 code
: "({ foo: /* comment */bar })",
2067 output
: "({ foo:/* comment */bar })",
2068 options
: [{ afterColon
: false }],
2069 errors
: [{ messageId
: "extraValue", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 7, type
: "Identifier" }]
2072 code
: "({ foo/*comment*/:/*comment*/bar })",
2073 output
: "({ foo/*comment*/ : /*comment*/bar })",
2074 options
: [{ beforeColon
: true, afterColon
: true }],
2076 { messageId
: "missingKey", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 7, type
: "Identifier" },
2077 { messageId
: "missingValue", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 19, type
: "Identifier" }
2082 " foo:1, 'bar':2, baz:3",
2087 " foo : 1, 'bar' : 2, baz : 3",
2102 { messageId
: "missingKey", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 5, type
: "Identifier" },
2103 { messageId
: "missingValue", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 9, type
: "Literal" },
2104 { messageId
: "missingKey", data
: { computed
: "", key
: "bar" }, line
: 2, column
: 12, type
: "Literal" },
2105 { messageId
: "missingValue", data
: { computed
: "", key
: "bar" }, line
: 2, column
: 18, type
: "Literal" },
2106 { messageId
: "missingKey", data
: { computed
: "", key
: "baz" }, line
: 2, column
: 21, type
: "Identifier" },
2107 { messageId
: "missingValue", data
: { computed
: "", key
: "baz" }, line
: 2, column
: 25, type
: "Literal" }
2112 " foo : 1, 'bar' : 2, baz : 3, longlonglong : 4",
2117 " foo: 1, 'bar': 2, baz: 3, longlonglong: 4",
2126 { messageId
: "extraKey", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 8, type
: "Identifier" },
2127 { messageId
: "extraKey", data
: { computed
: "", key
: "bar" }, line
: 2, column
: 19, type
: "Literal" },
2128 { messageId
: "extraKey", data
: { computed
: "", key
: "baz" }, line
: 2, column
: 28, type
: "Identifier" },
2129 { messageId
: "extraKey", data
: { computed
: "", key
: "longlonglong" }, line
: 2, column
: 46, type
: "Identifier" }
2152 { messageId
: "missingValue", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 9, type
: "Literal" }
2175 { messageId
: "missingValue", data
: { computed
: "", key
: "bar" }, line
: 2, column
: 9, type
: "Literal" }
2178 code
: "var obj = { foo: 1, 'bar': 2, baz :3, longlonglong :4 }",
2179 output
: "var obj = { foo:1, 'bar':2, baz:3, longlonglong:4 }",
2190 { messageId
: "extraValue", data
: { computed
: "", key
: "foo" }, line
: 1, column
: 16, type
: "Literal" },
2191 { messageId
: "extraValue", data
: { computed
: "", key
: "bar" }, line
: 1, column
: 26, type
: "Literal" },
2192 { messageId
: "extraKey", data
: { computed
: "", key
: "baz" }, line
: 1, column
: 34, type
: "Identifier" },
2193 { messageId
: "extraKey", data
: { computed
: "", key
: "longlonglong" }, line
: 1, column
: 51, type
: "Identifier" }
2199 " 'bar': 2, baz: 3, longlonglong: 4",
2205 " 'bar' : 2, baz : 3, longlonglong: 4",
2218 { messageId
: "missingKey", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 5, type
: "Identifier" },
2219 { messageId
: "missingKey", data
: { computed
: "", key
: "bar" }, line
: 3, column
: 5, type
: "Literal" },
2220 { messageId
: "missingKey", data
: { computed
: "", key
: "baz" }, line
: 3, column
: 15, type
: "Identifier" }
2226 " 'bar' : 2, baz : 3,",
2233 " 'bar' : 2, baz : 3,",
2247 { messageId
: "missingKey", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 5, type
: "Identifier" },
2248 { messageId
: "missingKey", data
: { computed
: "", key
: "bar" }, line
: 3, column
: 5, type
: "Literal" },
2249 { messageId
: "missingKey", data
: { computed
: "", key
: "baz" }, line
: 3, column
: 16, type
: "Identifier" }
2255 " 'bar': 2, baz: 3,",
2262 " 'bar': 2, baz: 3,",
2276 { messageId
: "missingValue", data
: { computed
: "", key
: "foo" }, line
: 2, column
: 10, type
: "Literal" },
2277 { messageId
: "missingValue", data
: { computed
: "", key
: "bar" }, line
: 3, column
: 12, type
: "Literal" },
2278 { messageId
: "missingValue", data
: { computed
: "", key
: "baz" }, line
: 3, column
: 20, type
: "Literal" }
2299 parserOptions
: { ecmaVersion
: 6 },
2301 { messageId
: "missingValue", data
: { computed
: "", key
: "a" }, line
: 3, column
: 22, type
: "Literal" }
2322 parserOptions
: { ecmaVersion
: 6 },
2324 { messageId
: "missingKey", data
: { computed
: "", key
: "a" }, line
: 3, column
: 17, type
: "Literal" }
2345 parserOptions
: { ecmaVersion
: 6 },
2347 { messageId
: "extraValue", data
: { computed
: "", key
: "a" }, line
: 3, column
: 20, type
: "Literal" }
2353 "🌷": "bar", // 2 code points
2354 "🎁": "baz", // 2 code points
2355 "🇮🇳": "qux", // 4 code points
2356 "🏳️🌈": "xyz", // 6 code points
2361 "🌷": "bar", // 2 code points
2362 "🎁": "baz", // 2 code points
2363 "🇮🇳": "qux", // 4 code points
2364 "🏳️🌈": "xyz", // 6 code points
2373 { messageId
: "extraValue", data
: { computed
: "", key
: "🌷" }, line
: 3, column
: 21, type
: "Literal" },
2374 { messageId
: "extraValue", data
: { computed
: "", key
: "🎁" }, line
: 4, column
: 21, type
: "Literal" },
2375 { messageId
: "extraValue", data
: { computed
: "", key
: "🇮🇳" }, line
: 5, column
: 23, type
: "Literal" }