Skip to content

Commit bb0731f

Browse files
authored
chore: use minimal settings to format test files (#3245)
1 parent 854fd2f commit bb0731f

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

packages/pug/test/__snapshots__/pug.test.js.snap

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`pug .compileClient() should support module syntax in pug.compileClient(str, options) when inlineRuntimeFunctions it false 1`] = `
4-
"var pug = require('pug-runtime');
4+
"var pug = require(\\"pug-runtime\\");
55
function template(locals) {
6-
var pug_html = '',
6+
var pug_html = \\"\\",
77
pug_mixins = {},
88
pug_interp;
99
var pug_debug_filename, pug_debug_line;
@@ -14,8 +14,8 @@ function template(locals) {
1414
pug_debug_line = 1;
1515
pug_html =
1616
pug_html +
17-
pug.escape(null == (pug_interp = self.foo) ? '' : pug_interp) +
18-
'\\\\u003C\\\\u002Fdiv\\\\u003E';
17+
pug.escape(null == (pug_interp = self.foo) ? \\"\\" : pug_interp) +
18+
\\"\\\\u003C\\\\u002Fdiv\\\\u003E\\";
1919
} catch (err) {
2020
pug.rethrow(err, pug_debug_filename, pug_debug_line);
2121
}
@@ -27,26 +27,26 @@ module.exports = template;
2727

2828
exports[`pug .compileClient() should support module syntax in pug.compileClient(str, options) when inlineRuntimeFunctions it true 1`] = `
2929
"function pug_escape(e) {
30-
var a = '' + e,
30+
var a = \\"\\" + e,
3131
t = pug_match_html.exec(a);
3232
if (!t) return e;
3333
var r,
3434
c,
3535
n,
36-
s = '';
36+
s = \\"\\";
3737
for (r = t.index, c = 0; r < a.length; r++) {
3838
switch (a.charCodeAt(r)) {
3939
case 34:
40-
n = '&quot;';
40+
n = \\"&quot;\\";
4141
break;
4242
case 38:
43-
n = '&amp;';
43+
n = \\"&amp;\\";
4444
break;
4545
case 60:
46-
n = '&lt;';
46+
n = \\"&lt;\\";
4747
break;
4848
case 62:
49-
n = '&gt;';
49+
n = \\"&gt;\\";
5050
break;
5151
default:
5252
continue;
@@ -58,32 +58,32 @@ exports[`pug .compileClient() should support module syntax in pug.compileClient(
5858
var pug_match_html = /[\\"&<>]/;
5959
function pug_rethrow(n, e, t, r) {
6060
if (!(n instanceof Error)) throw n;
61-
if (!(('undefined' == typeof window && e) || r))
62-
throw ((n.message += ' on line ' + t), n);
61+
if (!((\\"undefined\\" == typeof window && e) || r))
62+
throw ((n.message += \\" on line \\" + t), n);
6363
try {
64-
r = r || require('fs').readFileSync(e, 'utf8');
64+
r = r || require(\\"fs\\").readFileSync(e, \\"utf8\\");
6565
} catch (e) {
6666
pug_rethrow(n, null, t);
6767
}
6868
var a = 3,
69-
i = r.split('\\\\n'),
69+
i = r.split(\\"\\\\n\\"),
7070
o = Math.max(t - a, 0),
7171
h = Math.min(i.length, t + a),
7272
a = i
7373
.slice(o, h)
7474
.map(function(n, e) {
7575
var r = e + o + 1;
76-
return (r == t ? ' > ' : ' ') + r + '| ' + n;
76+
return (r == t ? \\" > \\" : \\" \\") + r + \\"| \\" + n;
7777
})
78-
.join('\\\\n');
78+
.join(\\"\\\\n\\");
7979
n.path = e;
8080
try {
81-
n.message = (e || 'Pug') + ':' + t + '\\\\n' + a + '\\\\n\\\\n' + n.message;
81+
n.message = (e || \\"Pug\\") + \\":\\" + t + \\"\\\\n\\" + a + \\"\\\\n\\\\n\\" + n.message;
8282
} catch (n) {}
8383
throw n;
8484
}
8585
function template(locals) {
86-
var pug_html = '',
86+
var pug_html = \\"\\",
8787
pug_mixins = {},
8888
pug_interp;
8989
var pug_debug_filename, pug_debug_line;
@@ -94,8 +94,8 @@ function template(locals) {
9494
pug_debug_line = 1;
9595
pug_html =
9696
pug_html +
97-
pug_escape(null == (pug_interp = self.foo) ? '' : pug_interp) +
98-
'\\\\u003C\\\\u002Fdiv\\\\u003E';
97+
pug_escape(null == (pug_interp = self.foo) ? \\"\\" : pug_interp) +
98+
\\"\\\\u003C\\\\u002Fdiv\\\\u003E\\";
9999
} catch (err) {
100100
pug_rethrow(err, pug_debug_filename, pug_debug_line);
101101
}

scripts/prettier-javascript-serializer.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
const fs = require('fs');
2-
const path = require('path');
31
const prettier = require('prettier');
42

5-
const prettierrc = require('../.prettierrc.js');
6-
const prettierOptions = Object.assign(
7-
{
8-
trailingComma:
9-
/** @type {import('prettier').ParserOptions['trailingComma']} */ ('es5'),
10-
},
11-
prettierrc,
12-
prettierrc.overrides[0].options
13-
);
3+
const prettierOptions = {parser: 'babel'};
144

155
// filename serializer that removes the basedir
166
module.exports = {

0 commit comments

Comments
 (0)