Bump Prettier dependency to 3.0.0
This commit is contained in:
1 parent
151cc2c4f2
commit
fa48415617
338 files changed
+1483
-1434
No files matched your search
@@ -42,7 +42,7 @@
|
||||
copyButton.setAttribute("aria-label", ARIA_LABEL);
|
||||
copyButton.disabled = false;
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
actionsContainer.appendChild(copyButton);
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
html body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
||||
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
||||
font-family:
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
Segoe UI,
|
||||
Roboto,
|
||||
Oxygen,
|
||||
Ubuntu,
|
||||
Cantarell,
|
||||
Fira Sans,
|
||||
Droid Sans,
|
||||
Helvetica Neue,
|
||||
sans-serif;
|
||||
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,11 @@ header h1 {
|
||||
}
|
||||
|
||||
label {
|
||||
font-family: Consolas, Courier New, Courier, monospace;
|
||||
font-family:
|
||||
Consolas,
|
||||
Courier New,
|
||||
Courier,
|
||||
monospace;
|
||||
margin: 10px 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
importScripts("lib/package-manifest.js");
|
||||
importScripts(
|
||||
"https://cdnjs.cloudflare.com/ajax/libs/sw-toolbox/3.6.0/sw-toolbox.js"
|
||||
"https://cdnjs.cloudflare.com/ajax/libs/sw-toolbox/3.6.0/sw-toolbox.js",
|
||||
);
|
||||
|
||||
const plugins = prettierPackageManifest.builtinPlugins.map(
|
||||
({ file }) => `lib/${file}`
|
||||
({ file }) => `lib/${file}`,
|
||||
);
|
||||
|
||||
toolbox.precache([
|
||||
|
||||
@@ -16,7 +16,7 @@ const docExplorerPlugin = {
|
||||
parse: (text) =>
|
||||
new Function(
|
||||
`{ ${Object.keys(prettier.doc.builders)} }`,
|
||||
`const result = (${text || "''"}\n); return result;`
|
||||
`const result = (${text || "''"}\n); return result;`,
|
||||
)(prettier.doc.builders),
|
||||
astFormat: "doc-explorer",
|
||||
},
|
||||
@@ -49,7 +49,7 @@ function serializeAst(ast) {
|
||||
: typeof value === "symbol"
|
||||
? String(value)
|
||||
: value,
|
||||
2
|
||||
2,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ async function handleFormatMessage(message) {
|
||||
const formatResult = await formatCode(
|
||||
message.code,
|
||||
options,
|
||||
message.debug.rethrowEmbedErrors
|
||||
message.debug.rethrowEmbedErrors,
|
||||
);
|
||||
|
||||
const response = {
|
||||
@@ -117,7 +117,7 @@ async function handleFormatMessage(message) {
|
||||
const parsed = await prettier.__debug.parse(
|
||||
message.code,
|
||||
options,
|
||||
isPrettier2 ? false : { preprocessForPrint }
|
||||
isPrettier2 ? false : { preprocessForPrint },
|
||||
);
|
||||
ast = serializeAst(parsed.ast);
|
||||
} catch (e) {
|
||||
@@ -139,7 +139,7 @@ async function handleFormatMessage(message) {
|
||||
try {
|
||||
response.debug.doc = await prettier.__debug.formatDoc(
|
||||
await prettier.__debug.printToDoc(message.code, options),
|
||||
{ plugins }
|
||||
{ plugins },
|
||||
);
|
||||
} catch {
|
||||
response.debug.doc = "";
|
||||
|
||||
Reference in new issue
Block a user