Skip to content

Commit dc7b1b2

Browse files
committed
Prettier
1 parent 7237ec6 commit dc7b1b2

File tree

7 files changed

+19
-20
lines changed

7 files changed

+19
-20
lines changed

packages/jupyterlab-preview/src/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export namespace CommandIDs {
5151
* A notebook widget extension that adds a voila preview button to the toolbar.
5252
*/
5353
class VoilaRenderButton
54-
implements DocumentRegistry.IWidgetExtension<NotebookPanel, INotebookModel>
55-
{
54+
implements DocumentRegistry.IWidgetExtension<NotebookPanel, INotebookModel> {
5655
/**
5756
* Instantiate a new VoilaRenderButton.
5857
* @param commands The command registry.
@@ -110,11 +109,11 @@ const extension: JupyterFrontEndPlugin<IVoilaPreviewTracker> = {
110109
if (restorer) {
111110
restorer.restore(tracker, {
112111
command: 'docmanager:open',
113-
args: (panel) => ({
112+
args: panel => ({
114113
path: panel.context.path,
115114
factory: factory.name
116115
}),
117-
name: (panel) => panel.context.path,
116+
name: panel => panel.context.path,
118117
when: app.serviceManager.ready
119118
});
120119
}
@@ -179,7 +178,7 @@ const extension: JupyterFrontEndPlugin<IVoilaPreviewTracker> = {
179178

180179
commands.addCommand(CommandIDs.voilaRender, {
181180
label: 'Render Notebook with Voilà',
182-
execute: async (args) => {
181+
execute: async args => {
183182
const current = getCurrent(args);
184183
let context: DocumentRegistry.IContext<INotebookModel>;
185184
if (current) {
@@ -203,7 +202,7 @@ const extension: JupyterFrontEndPlugin<IVoilaPreviewTracker> = {
203202

204203
commands.addCommand(CommandIDs.voilaOpen, {
205204
label: 'Open with Voilà in New Browser Tab',
206-
execute: async (args) => {
205+
execute: async args => {
207206
const current = getCurrent(args);
208207
if (!current) {
209208
return;
@@ -221,7 +220,7 @@ const extension: JupyterFrontEndPlugin<IVoilaPreviewTracker> = {
221220

222221
if (palette) {
223222
const category = 'Notebook Operations';
224-
[CommandIDs.voilaRender, CommandIDs.voilaOpen].forEach((command) => {
223+
[CommandIDs.voilaRender, CommandIDs.voilaOpen].forEach(command => {
225224
palette.addItem({ command, category });
226225
});
227226
}

packages/voila/src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class VoilaApp extends JupyterFrontEnd<IShell> {
9494
if (!Array.isArray(data)) {
9595
data = [data];
9696
}
97-
data.forEach((item) => {
97+
data.forEach(item => {
9898
try {
9999
this.registerPlugin(item);
100100
} catch (error) {
@@ -109,7 +109,7 @@ export class VoilaApp extends JupyterFrontEnd<IShell> {
109109
* @param mods - The plugin modules to register.
110110
*/
111111
registerPluginModules(mods: App.IPluginModule[]): void {
112-
mods.forEach((mod) => {
112+
mods.forEach(mod => {
113113
this.registerPluginModule(mod);
114114
});
115115
}

packages/voila/src/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async function main() {
118118
const federatedStylePromises: Promise<any>[] = [];
119119

120120
const extensions = await Promise.allSettled(
121-
extensionData.map(async (data) => {
121+
extensionData.map(async data => {
122122
await loadComponent(
123123
`${URLExt.join(
124124
PageConfig.getOption('fullLabextensionsUrl'),
@@ -131,7 +131,7 @@ async function main() {
131131
})
132132
);
133133

134-
extensions.forEach((p) => {
134+
extensions.forEach(p => {
135135
if (p.status === 'rejected') {
136136
// There was an error loading the component
137137
console.error(p.reason);
@@ -156,7 +156,7 @@ async function main() {
156156
const federatedExtensions = await Promise.allSettled(
157157
federatedExtensionPromises
158158
);
159-
federatedExtensions.forEach((p) => {
159+
federatedExtensions.forEach(p => {
160160
if (p.status === 'fulfilled') {
161161
for (const plugin of activePlugins(p.value)) {
162162
mods.push(plugin);
@@ -170,7 +170,7 @@ async function main() {
170170
const federatedMimeExtensions = await Promise.allSettled(
171171
federatedMimeExtensionPromises
172172
);
173-
federatedMimeExtensions.forEach((p) => {
173+
federatedMimeExtensions.forEach(p => {
174174
if (p.status === 'fulfilled') {
175175
for (const plugin of activePlugins(p.value)) {
176176
mimeExtensions.push(plugin);
@@ -183,7 +183,7 @@ async function main() {
183183
// Load all federated component styles and log errors for any that do not
184184
(await Promise.allSettled(federatedStylePromises))
185185
.filter(({ status }) => status === 'rejected')
186-
.forEach((p) => {
186+
.forEach(p => {
187187
console.error((p as PromiseRejectedResult).reason);
188188
});
189189

packages/voila/src/plugins.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ export const stopPollingPlugin: JupyterFrontEndPlugin<void> = {
6767
id: '@voila-dashboards/voila:stop-polling',
6868
autoStart: true,
6969
activate: (app: JupyterFrontEnd): void => {
70-
app.serviceManager.sessions?.ready.then((value) => {
70+
app.serviceManager.sessions?.ready.then(value => {
7171
app.serviceManager.sessions['_kernelManager']['_pollModels']?.stop();
7272
void app.serviceManager.sessions['_pollModels'].stop();
7373
});
7474

75-
app.serviceManager.kernelspecs?.ready.then((value) => {
75+
app.serviceManager.kernelspecs?.ready.then(value => {
7676
void app.serviceManager.kernelspecs.dispose();
7777
});
7878
}
@@ -131,7 +131,7 @@ export const widgetManager: JupyterFrontEndPlugin<IJupyterWidgetRegistry> = {
131131

132132
resolveManager(manager);
133133

134-
window.addEventListener('beforeunload', (e) => {
134+
window.addEventListener('beforeunload', e => {
135135
const data = new FormData();
136136
// it seems if we attach this to early, it will not be called
137137
const matches = document.cookie.match('\\b_xsrf=([^;]*)\\b');

packages/voila/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const baseConfig = require('@jupyterlab/builder/lib/webpack.config.base');
1313

1414
const data = require('./package.json');
1515

16-
const names = Object.keys(data.dependencies).filter((name) => {
16+
const names = Object.keys(data.dependencies).filter(name => {
1717
const packageData = require(path.join(name, 'package.json'));
1818
return packageData.jupyterlab !== undefined;
1919
});

ui-tests/tests/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ export async function addBenchmarkToTest(
3939
time: average(testTimeArray)
4040
})
4141
);
42-
await new Promise((r) => setTimeout(r, 500));
42+
await new Promise(r => setTimeout(r, 500));
4343
}
4444
}

ui-tests/tests/voila.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ test.describe('Voila performance Tests', () => {
112112
await page.fill('text=4.00', '8.00');
113113
await page.keyboard.down('Enter');
114114
// fetch the value of the label
115-
const value = await page.$eval('input', (el) => el.value);
115+
const value = await page.$eval('input', el => el.value);
116116

117117
expect(value).toBe('64');
118118
// wait for the final MathJax message to be hidden

0 commit comments

Comments
 (0)