Skip to content

Commit 7bfec10

Browse files
committed
Upgrade Prettier code formatter
Upgrade to the latest version of the Prettier code formatter, and run 'yarn fmt' to reformat source code. This commit should not change behavior.
1 parent a3ae1f5 commit 7bfec10

File tree

10 files changed

+158
-158
lines changed

10 files changed

+158
-158
lines changed

plugin/vscode-lsp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
"vscode-languageclient": "^6.1.3"
4242
},
4343
"devDependencies": {
44-
"prettier": "2.1.2"
44+
"prettier": "^2.3.0"
4545
}
4646
}

plugin/vscode-lsp/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# yarn lockfile v1
33

44

5-
prettier@2.1.2:
6-
version "2.1.2"
7-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
8-
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
5+
prettier@^2.3.0:
6+
version "2.3.0"
7+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
8+
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
99

1010
semver@^6.3.0:
1111
version "6.3.0"

plugin/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"devDependencies": {
3939
"colors": "1.4.0",
40-
"prettier": "2.1.2",
40+
"prettier": "^2.3.0",
4141
"tape": "5.0.1",
4242
"vscode-test": "1.4.1"
4343
},

plugin/vscode/test/other-tests.js

Lines changed: 110 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -353,101 +353,100 @@ let tests = {
353353
}
354354
},
355355

356-
"concurrent edits are applied in order of calls, with exhaustive fault injection": async ({
357-
addCleanup,
358-
}) => {
359-
let coinFlips;
360-
let rng = new ExhaustiveRNG();
361-
function maybeInjectFaultWithExhaustiveRNG() {
362-
let shouldCrash = rng.nextCoinFlip();
363-
coinFlips.push(shouldCrash);
364-
if (shouldCrash) {
365-
throw new qljs.ProcessCrashed("(injected fault)");
356+
"concurrent edits are applied in order of calls, with exhaustive fault injection":
357+
async ({ addCleanup }) => {
358+
let coinFlips;
359+
let rng = new ExhaustiveRNG();
360+
function maybeInjectFaultWithExhaustiveRNG() {
361+
let shouldCrash = rng.nextCoinFlip();
362+
coinFlips.push(shouldCrash);
363+
if (shouldCrash) {
364+
throw new qljs.ProcessCrashed("(injected fault)");
365+
}
366366
}
367-
}
368367

369-
let oldMaybeInjectFault = qljs.maybeInjectFault;
370-
addCleanup(() => {
371-
qljs.maybeInjectFault = oldMaybeInjectFault;
372-
});
368+
let oldMaybeInjectFault = qljs.maybeInjectFault;
369+
addCleanup(() => {
370+
qljs.maybeInjectFault = oldMaybeInjectFault;
371+
});
373372

374-
while (!rng.isDone()) {
375-
coinFlips = [];
376-
let diagnosticCollection = new FakeDiagnosticCollection();
377-
let linters = new extension.DocumentLinterCollection(
378-
diagnosticCollection
379-
);
373+
while (!rng.isDone()) {
374+
coinFlips = [];
375+
let diagnosticCollection = new FakeDiagnosticCollection();
376+
let linters = new extension.DocumentLinterCollection(
377+
diagnosticCollection
378+
);
380379

381-
try {
382-
let document = new MockDocument("hello.js", "const x;");
383-
let linter = linters.getLinter(document);
384-
let shouldOpenEditorBeforeChanges = rng.nextCoinFlip();
385-
if (shouldOpenEditorBeforeChanges) {
386-
await linter.editorChangedVisibilityAsync();
387-
}
380+
try {
381+
let document = new MockDocument("hello.js", "const x;");
382+
let linter = linters.getLinter(document);
383+
let shouldOpenEditorBeforeChanges = rng.nextCoinFlip();
384+
if (shouldOpenEditorBeforeChanges) {
385+
await linter.editorChangedVisibilityAsync();
386+
}
388387

389-
qljs.maybeInjectFault = maybeInjectFaultWithExhaustiveRNG;
390-
let promises = [];
391-
for (let charactersToType of ["const ", "x;"]) {
392-
let changes = [
393-
{
394-
range: new vscode.Range(
395-
new vscode.Position(0, document._text.length),
396-
new vscode.Position(0, document._text.length)
397-
),
398-
rangeOffset: 0,
399-
rangeLength: 0,
400-
text: charactersToType,
401-
},
402-
];
403-
document._text += charactersToType;
404-
promises.push(linter.textChangedAsync(changes));
405-
}
388+
qljs.maybeInjectFault = maybeInjectFaultWithExhaustiveRNG;
389+
let promises = [];
390+
for (let charactersToType of ["const ", "x;"]) {
391+
let changes = [
392+
{
393+
range: new vscode.Range(
394+
new vscode.Position(0, document._text.length),
395+
new vscode.Position(0, document._text.length)
396+
),
397+
rangeOffset: 0,
398+
rangeLength: 0,
399+
text: charactersToType,
400+
},
401+
];
402+
document._text += charactersToType;
403+
promises.push(linter.textChangedAsync(changes));
404+
}
406405

407-
let textChangedResults = await Promise.allSettled(promises);
408-
let firstChangeFailed = textChangedResults[0].status !== "fulfilled";
409-
let lastChangeFailed = textChangedResults[1].status !== "fulfilled";
406+
let textChangedResults = await Promise.allSettled(promises);
407+
let firstChangeFailed = textChangedResults[0].status !== "fulfilled";
408+
let lastChangeFailed = textChangedResults[1].status !== "fulfilled";
410409

411-
let diags = normalizeDiagnostics(
412-
diagnosticCollection.get(document.uri)
413-
);
414-
if (firstChangeFailed && lastChangeFailed) {
415-
// No changes were applied. The linted document was "const x;".
416-
assert.deepStrictEqual(
417-
diags.map((diag) => diag.message),
418-
[]
419-
);
420-
} else if (!firstChangeFailed && lastChangeFailed) {
421-
// Partial changes were applied. The linted document was either
422-
// "const x;const " (if the first change finished before the second
423-
// change started) or "const x; const x;" (if the second change failed
424-
// before the first change started).
425-
let messages = diags.map((diag) => diag.message);
426-
assert.strictEqual(messages.length, 1, messages);
427-
assert.ok(
428-
messages[0] === "let with no bindings" ||
429-
messages[0] === "const with no bindings" ||
430-
messages[0] === "var with no bindings" ||
431-
messages[0] === "redeclaration of variable: x",
432-
messages
433-
);
434-
} else {
435-
// Because the last call to textChangedAsync succeeded, all changes
436-
// were applied. The linted document was "const x;const x;".
437-
assert.deepStrictEqual(
438-
diags.map((diag) => diag.message),
439-
["redeclaration of variable: x"]
410+
let diags = normalizeDiagnostics(
411+
diagnosticCollection.get(document.uri)
440412
);
413+
if (firstChangeFailed && lastChangeFailed) {
414+
// No changes were applied. The linted document was "const x;".
415+
assert.deepStrictEqual(
416+
diags.map((diag) => diag.message),
417+
[]
418+
);
419+
} else if (!firstChangeFailed && lastChangeFailed) {
420+
// Partial changes were applied. The linted document was either
421+
// "const x;const " (if the first change finished before the second
422+
// change started) or "const x; const x;" (if the second change failed
423+
// before the first change started).
424+
let messages = diags.map((diag) => diag.message);
425+
assert.strictEqual(messages.length, 1, messages);
426+
assert.ok(
427+
messages[0] === "let with no bindings" ||
428+
messages[0] === "const with no bindings" ||
429+
messages[0] === "var with no bindings" ||
430+
messages[0] === "redeclaration of variable: x",
431+
messages
432+
);
433+
} else {
434+
// Because the last call to textChangedAsync succeeded, all changes
435+
// were applied. The linted document was "const x;const x;".
436+
assert.deepStrictEqual(
437+
diags.map((diag) => diag.message),
438+
["redeclaration of variable: x"]
439+
);
440+
}
441+
} finally {
442+
await linters.disposeAsync();
441443
}
442-
} finally {
443-
await linters.disposeAsync();
444-
}
445444

446-
console.log(`coinFlips: ${coinFlips}`);
447-
rng.lap();
448-
qljs.maybeInjectFault = oldMaybeInjectFault;
449-
}
450-
},
445+
console.log(`coinFlips: ${coinFlips}`);
446+
rng.lap();
447+
qljs.maybeInjectFault = oldMaybeInjectFault;
448+
}
449+
},
451450

452451
"ExhaustiveRNG: exhaust with no calls": () => {
453452
let rng = new ExhaustiveRNG();
@@ -480,39 +479,41 @@ let tests = {
480479
);
481480
},
482481

483-
"ExhaustiveRNG: coin flip and maybe another coin flip (if true) per lap": () => {
484-
let rng = new ExhaustiveRNG();
482+
"ExhaustiveRNG: coin flip and maybe another coin flip (if true) per lap":
483+
() => {
484+
let rng = new ExhaustiveRNG();
485485

486-
assert.strictEqual(rng.nextCoinFlip(), false);
487-
rng.lap();
486+
assert.strictEqual(rng.nextCoinFlip(), false);
487+
rng.lap();
488488

489-
assert.strictEqual(rng.nextCoinFlip(), true);
490-
assert.strictEqual(rng.nextCoinFlip(), false);
491-
rng.lap();
489+
assert.strictEqual(rng.nextCoinFlip(), true);
490+
assert.strictEqual(rng.nextCoinFlip(), false);
491+
rng.lap();
492492

493-
assert.strictEqual(rng.nextCoinFlip(), true);
494-
assert.strictEqual(rng.nextCoinFlip(), true);
495-
rng.lap();
493+
assert.strictEqual(rng.nextCoinFlip(), true);
494+
assert.strictEqual(rng.nextCoinFlip(), true);
495+
rng.lap();
496496

497-
assert.ok(rng.isDone());
498-
},
497+
assert.ok(rng.isDone());
498+
},
499499

500-
"ExhaustiveRNG: coin flip and maybe another coin flip (if false) per lap": () => {
501-
let rng = new ExhaustiveRNG();
500+
"ExhaustiveRNG: coin flip and maybe another coin flip (if false) per lap":
501+
() => {
502+
let rng = new ExhaustiveRNG();
502503

503-
assert.strictEqual(rng.nextCoinFlip(), false);
504-
assert.strictEqual(rng.nextCoinFlip(), false);
505-
rng.lap();
504+
assert.strictEqual(rng.nextCoinFlip(), false);
505+
assert.strictEqual(rng.nextCoinFlip(), false);
506+
rng.lap();
506507

507-
assert.strictEqual(rng.nextCoinFlip(), false);
508-
assert.strictEqual(rng.nextCoinFlip(), true);
509-
rng.lap();
508+
assert.strictEqual(rng.nextCoinFlip(), false);
509+
assert.strictEqual(rng.nextCoinFlip(), true);
510+
rng.lap();
510511

511-
assert.strictEqual(rng.nextCoinFlip(), true);
512-
rng.lap();
512+
assert.strictEqual(rng.nextCoinFlip(), true);
513+
rng.lap();
513514

514-
assert.ok(rng.isDone());
515-
},
515+
assert.ok(rng.isDone());
516+
},
516517

517518
"ExhaustiveRNG: exhaust with three nextCoinFlip calls per lap": () => {
518519
let expectedOutcomesPerLap = [

plugin/vscode/test/vscode-tests.js

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -315,41 +315,40 @@ tests = {
315315
await waitUntilNoDiagnosticsAsync(helloURI);
316316
},
317317

318-
"changing previously-edited document while editor is closed lints when reopening editor": async ({
319-
addCleanup,
320-
}) => {
321-
let scratchDirectory = makeScratchDirectory({ addCleanup });
322-
let helloFilePath = path.join(scratchDirectory, "hello.js");
323-
fs.writeFileSync(helloFilePath, "/* empty file */\n");
324-
let helloURI = vscode.Uri.file(helloFilePath);
325-
326-
let helloDocument = await vscode.workspace.openTextDocument(helloURI);
327-
let _originalHelloEditor = await vscode.window.showTextDocument(
328-
helloDocument,
329-
vscode.ViewColumn.One
330-
);
331-
await loadExtensionAsync({ addCleanup });
332-
// Wait for possible linting to take effect.
333-
await sleepAsync(100);
318+
"changing previously-edited document while editor is closed lints when reopening editor":
319+
async ({ addCleanup }) => {
320+
let scratchDirectory = makeScratchDirectory({ addCleanup });
321+
let helloFilePath = path.join(scratchDirectory, "hello.js");
322+
fs.writeFileSync(helloFilePath, "/* empty file */\n");
323+
let helloURI = vscode.Uri.file(helloFilePath);
334324

335-
// Close _originalHelloEditor.
336-
let otherURI = vscode.Uri.parse("untitled:other.txt");
337-
let otherDocument = await vscode.workspace.openTextDocument(otherURI);
338-
let _otherEditor = await vscode.window.showTextDocument(
339-
otherDocument,
340-
vscode.ViewColumn.One
341-
);
325+
let helloDocument = await vscode.workspace.openTextDocument(helloURI);
326+
let _originalHelloEditor = await vscode.window.showTextDocument(
327+
helloDocument,
328+
vscode.ViewColumn.One
329+
);
330+
await loadExtensionAsync({ addCleanup });
331+
// Wait for possible linting to take effect.
332+
await sleepAsync(100);
333+
334+
// Close _originalHelloEditor.
335+
let otherURI = vscode.Uri.parse("untitled:other.txt");
336+
let otherDocument = await vscode.workspace.openTextDocument(otherURI);
337+
let _otherEditor = await vscode.window.showTextDocument(
338+
otherDocument,
339+
vscode.ViewColumn.One
340+
);
342341

343-
fs.writeFileSync(helloFilePath, "let x;let x;");
344-
// Wait for possible linting to take effect.
345-
await sleepAsync(100);
342+
fs.writeFileSync(helloFilePath, "let x;let x;");
343+
// Wait for possible linting to take effect.
344+
await sleepAsync(100);
346345

347-
let _newHelloEditor = await vscode.window.showTextDocument(
348-
helloDocument,
349-
vscode.ViewColumn.Two
350-
);
351-
await waitUntilAnyDiagnosticsAsync(helloURI);
352-
},
346+
let _newHelloEditor = await vscode.window.showTextDocument(
347+
helloDocument,
348+
vscode.ViewColumn.Two
349+
);
350+
await waitUntilAnyDiagnosticsAsync(helloURI);
351+
},
353352

354353
"opening editor for existing documents lints": async ({ addCleanup }) => {
355354
let scratchDirectory = makeScratchDirectory({ addCleanup });

plugin/vscode/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,10 @@ path-parse@^1.0.6:
428428
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
429429
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
430430

431-
prettier@2.1.2:
432-
version "2.1.2"
433-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
434-
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
431+
prettier@^2.3.0:
432+
version "2.3.0"
433+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
434+
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
435435

436436
quick-lint-js-wasm@../../wasm:
437437
version "0.0.0"

wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"fmt": "prettier --write '*.js' '*.json'"
66
},
77
"devDependencies": {
8-
"prettier": "2.1.2"
8+
"prettier": "^2.3.0"
99
}
1010
}

wasm/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# yarn lockfile v1
33

44

5-
prettier@2.1.2:
6-
version "2.1.2"
7-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
8-
integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==
5+
prettier@^2.3.0:
6+
version "2.3.0"
7+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
8+
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"axios": "^0.21.1",
2424
"colors": "^1.4.0",
2525
"jasmine": "^3.7.0",
26-
"prettier": "2.3.0"
26+
"prettier": "^2.3.0"
2727
}
2828
}

0 commit comments

Comments
 (0)