Skip to content

Commit 05343f4

Browse files
SimenBcpojer
authored andcommitted
Don't add trailing commas to the webapp (#3974)
1 parent b3d944e commit 05343f4

File tree

5 files changed

+43
-48
lines changed

5 files changed

+43
-48
lines changed

.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ module.exports = {
6565
'examples/**/*',
6666
'scripts/**/*',
6767
'integration_tests/*/**/*',
68-
'website/server/*',
69-
'website/layout/*',
68+
'website/*/**/*',
7069
],
7170
rules: {
7271
'prettier/prettier': [

packages/jest-matchers/src/matchers.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -544,31 +544,31 @@ const matchers: MatchersObject = {
544544

545545
const message = pass
546546
? () =>
547-
matcherHint('.not.toHaveProperty', 'object', 'path', {
548-
secondArgument: valuePassed ? 'value' : null,
549-
}) +
550-
'\n\n' +
551-
`Expected the object:\n` +
552-
` ${printReceived(object)}\n` +
553-
`Not to have a nested property:\n` +
554-
` ${printExpected(keyPath)}\n` +
555-
(valuePassed ? `With a value of:\n ${printExpected(value)}\n` : '')
547+
matcherHint('.not.toHaveProperty', 'object', 'path', {
548+
secondArgument: valuePassed ? 'value' : null,
549+
}) +
550+
'\n\n' +
551+
`Expected the object:\n` +
552+
` ${printReceived(object)}\n` +
553+
`Not to have a nested property:\n` +
554+
` ${printExpected(keyPath)}\n` +
555+
(valuePassed ? `With a value of:\n ${printExpected(value)}\n` : '')
556556
: () =>
557-
matcherHint('.toHaveProperty', 'object', 'path', {
558-
secondArgument: valuePassed ? 'value' : null,
559-
}) +
560-
'\n\n' +
561-
`Expected the object:\n` +
562-
` ${printReceived(object)}\n` +
563-
`To have a nested property:\n` +
564-
` ${printExpected(keyPath)}\n` +
565-
(valuePassed ? `With a value of:\n ${printExpected(value)}\n` : '') +
566-
(traversedPath
567-
? `Received:\n ${RECEIVED_COLOR(
568-
'object',
569-
)}.${traversedPath}: ${printReceived(lastTraversedObject)}`
570-
: '') +
571-
(diffString ? `\nDifference:\n\n${diffString}` : '');
557+
matcherHint('.toHaveProperty', 'object', 'path', {
558+
secondArgument: valuePassed ? 'value' : null,
559+
}) +
560+
'\n\n' +
561+
`Expected the object:\n` +
562+
` ${printReceived(object)}\n` +
563+
`To have a nested property:\n` +
564+
` ${printExpected(keyPath)}\n` +
565+
(valuePassed ? `With a value of:\n ${printExpected(value)}\n` : '') +
566+
(traversedPath
567+
? `Received:\n ${RECEIVED_COLOR(
568+
'object',
569+
)}.${traversedPath}: ${printReceived(lastTraversedObject)}`
570+
: '') +
571+
(diffString ? `\nDifference:\n\n${diffString}` : '');
572572
if (pass === undefined) {
573573
throw new Error('pass must be initialized');
574574
}

website/core/DocsSidebar.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ class DocsSidebar extends React.Component {
3434
if (metadata.next) {
3535
if (!articles[metadata.next]) {
3636
throw new Error(
37-
'`next: ' +
38-
metadata.next +
39-
'` in ' +
40-
metadata.id +
41-
" doesn't exist",
37+
'`next: ' + metadata.next + '` in ' + metadata.id + " doesn't exist"
4238
);
4339
}
4440
previous[articles[metadata.next].id] = metadata.id;

website/core/Marked.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ block.item = replace(block.item, 'gm')(/bull/g, block.bullet)();
4040

4141
block.list = replace(block.list)(/bull/g, block.bullet)(
4242
'hr',
43-
/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/,
43+
/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/
4444
)();
4545

4646
block._tag =
@@ -51,15 +51,15 @@ block._tag =
5151

5252
block.html = replace(block.html)('comment', /<!--[\s\S]*?-->/)(
5353
'closed',
54-
/<(tag)[\s\S]+?<\/\1>/,
54+
/<(tag)[\s\S]+?<\/\1>/
5555
)('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g, block._tag)();
5656

5757
block.paragraph = replace(block.paragraph)('hr', block.hr)(
5858
'heading',
59-
block.heading,
59+
block.heading
6060
)('lheading', block.lheading)('blockquote', block.blockquote)(
6161
'tag',
62-
'<' + block._tag,
62+
'<' + block._tag
6363
)('def', block.def)();
6464

6565
/**
@@ -79,7 +79,7 @@ block.gfm = merge({}, block.normal, {
7979

8080
block.gfm.paragraph = replace(block.paragraph)(
8181
'(?!',
82-
'(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|',
82+
'(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|'
8383
)();
8484

8585
/**
@@ -456,7 +456,7 @@ inline._href = /\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
456456

457457
inline.link = replace(inline.link)('inside', inline._inside)(
458458
'href',
459-
inline._href,
459+
inline._href
460460
)();
461461

462462
inline.reflink = replace(inline.reflink)('inside', inline._inside)();
@@ -592,7 +592,7 @@ InlineLexer.prototype.output = function(src) {
592592
this.outputLink(cap, {
593593
href: cap[2],
594594
title: cap[3],
595-
}),
595+
})
596596
);
597597
continue;
598598
}
@@ -699,7 +699,7 @@ InlineLexer.prototype.outputLink = function(cap, link) {
699699
title: link.title,
700700
target: shouldOpenInNewWindow ? '_blank' : '',
701701
},
702-
this.output(cap[1]),
702+
this.output(cap[1])
703703
);
704704
} else {
705705
return React.DOM.img(
@@ -708,7 +708,7 @@ InlineLexer.prototype.outputLink = function(cap, link) {
708708
alt: cap[1],
709709
title: link.title,
710710
},
711-
null,
711+
null
712712
);
713713
}
714714
};
@@ -836,8 +836,8 @@ Parser.prototype.tok = function() { // eslint-disable-line
836836
this.token.align[i]
837837
? {style: {textAlign: this.token.align[i]}}
838838
: null,
839-
heading,
840-
),
839+
heading
840+
)
841841
);
842842
}
843843
table.push(React.DOM.thead(null, React.DOM.tr(null, row)));
@@ -852,8 +852,8 @@ Parser.prototype.tok = function() { // eslint-disable-line
852852
this.token.align[j]
853853
? {style: {textAlign: this.token.align[j]}}
854854
: null,
855-
this.inline.output(cells[j]),
856-
),
855+
this.inline.output(cells[j])
856+
)
857857
);
858858
}
859859
body.push(React.DOM.tr(null, row));
@@ -910,7 +910,7 @@ Parser.prototype.tok = function() { // eslint-disable-line
910910
return this.options.paragraphFn
911911
? this.options.paragraphFn.call(
912912
null,
913-
this.inline.output(this.token.text),
913+
this.inline.output(this.token.text)
914914
)
915915
: React.DOM.p(null, this.inline.output(this.token.text));
916916
}

website/core/nav/HeaderNav.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class LanguageDropDown extends React.Component {
2626
<a href={'/jest/' + lang.tag}>
2727
{lang.name}
2828
</a>
29-
</li>,
29+
</li>
3030
);
3131
});
3232

@@ -35,7 +35,7 @@ class LanguageDropDown extends React.Component {
3535
<a href="https://crowdin.com/project/jest" target="_blank">
3636
Help Translate
3737
</a>
38-
</li>,
38+
</li>
3939
);
4040

4141
return (
@@ -85,7 +85,7 @@ class HeaderNav extends React.Component {
8585
makeLinks(link) {
8686
link.href = link.href.replace(
8787
/\/LANGUAGE\//,
88-
'/' + this.props.language + '/',
88+
'/' + this.props.language + '/'
8989
);
9090
return (
9191
<li key={link.section}>

0 commit comments

Comments
 (0)