Skip to content

Commit ebcdf8a

Browse files
committed
Run Prettier on all files
This will change all existing files to match Prettier formatting. The command used is `npm run format`.
1 parent f41ca1a commit ebcdf8a

File tree

384 files changed

+22109
-14409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+22109
-14409
lines changed
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import type { StorybookConfig } from '@storybook/core-common';
1+
import type { StorybookConfig } from "@storybook/core-common";
22

33
const config: StorybookConfig = {
4-
stories: [
5-
'../src/**/*.stories.mdx',
6-
'../src/**/*.stories.@(js|jsx|ts|tsx)'
7-
],
4+
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
85
addons: [
9-
'@storybook/addon-links',
10-
'@storybook/addon-essentials',
11-
'@storybook/addon-interactions',
12-
'./vscode-theme-addon/preset.ts',
6+
"@storybook/addon-links",
7+
"@storybook/addon-essentials",
8+
"@storybook/addon-interactions",
9+
"./vscode-theme-addon/preset.ts",
1310
],
14-
framework: '@storybook/react',
11+
framework: "@storybook/react",
1512
core: {
16-
builder: '@storybook/builder-webpack5'
17-
}
13+
builder: "@storybook/builder-webpack5",
14+
},
1815
};
1916

2017
module.exports = config;

extensions/ql-vscode/.storybook/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { addons } from '@storybook/addons';
2-
import { themes } from '@storybook/theming';
1+
import { addons } from "@storybook/addons";
2+
import { themes } from "@storybook/theming";
33

44
addons.setConfig({
55
theme: themes.dark,
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { themes } from '@storybook/theming';
2-
import { action } from '@storybook/addon-actions';
1+
import { themes } from "@storybook/theming";
2+
import { action } from "@storybook/addon-actions";
33

44
// Allow all stories/components to use Codicons
5-
import '@vscode/codicons/dist/codicon.css';
5+
import "@vscode/codicons/dist/codicon.css";
66

77
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
88
export const parameters = {
99
// All props starting with `on` will automatically receive an action as a prop
10-
actions: { argTypesRegex: '^on[A-Z].*' },
10+
actions: { argTypesRegex: "^on[A-Z].*" },
1111
// All props matching these names will automatically get the correct control
1212
controls: {
1313
matchers: {
@@ -22,10 +22,10 @@ export const parameters = {
2222
backgrounds: {
2323
// The background is injected by our theme CSS files
2424
disable: true,
25-
}
25+
},
2626
};
2727

2828
(window as any).acquireVsCodeApi = () => ({
29-
postMessage: action('post-vscode-message'),
30-
setState: action('set-vscode-state'),
29+
postMessage: action("post-vscode-message"),
30+
setState: action("set-vscode-state"),
3131
});

extensions/ql-vscode/.storybook/vscode-theme-addon/ThemeSelector.tsx

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
1-
import * as React from 'react';
2-
import { FunctionComponent, useCallback } from 'react';
1+
import * as React from "react";
2+
import { FunctionComponent, useCallback } from "react";
33

4-
import { useGlobals } from '@storybook/api';
5-
import { IconButton, Icons, WithTooltip, TooltipLinkList, Link, WithHideFn } from '@storybook/components';
4+
import { useGlobals } from "@storybook/api";
5+
import {
6+
IconButton,
7+
Icons,
8+
WithTooltip,
9+
TooltipLinkList,
10+
Link,
11+
WithHideFn,
12+
} from "@storybook/components";
613

7-
import { themeNames, VSCodeTheme } from './theme';
14+
import { themeNames, VSCodeTheme } from "./theme";
815

916
export const ThemeSelector: FunctionComponent = () => {
1017
const [{ vscodeTheme }, updateGlobals] = useGlobals();
1118

12-
const changeTheme = useCallback((theme: VSCodeTheme) => {
13-
updateGlobals({
14-
vscodeTheme: theme,
15-
});
16-
}, [updateGlobals]);
17-
18-
const createLinks = useCallback((onHide: () => void): Link[] => Object.values(VSCodeTheme).map((theme) => ({
19-
id: theme,
20-
onClick() {
21-
changeTheme(theme);
22-
onHide();
19+
const changeTheme = useCallback(
20+
(theme: VSCodeTheme) => {
21+
updateGlobals({
22+
vscodeTheme: theme,
23+
});
2324
},
24-
title: themeNames[theme],
25-
value: theme,
26-
active: vscodeTheme === theme,
27-
})), [vscodeTheme, changeTheme]);
25+
[updateGlobals],
26+
);
27+
28+
const createLinks = useCallback(
29+
(onHide: () => void): Link[] =>
30+
Object.values(VSCodeTheme).map((theme) => ({
31+
id: theme,
32+
onClick() {
33+
changeTheme(theme);
34+
onHide();
35+
},
36+
title: themeNames[theme],
37+
value: theme,
38+
active: vscodeTheme === theme,
39+
})),
40+
[vscodeTheme, changeTheme],
41+
);
2842

2943
return (
3044
<WithTooltip
3145
placement="top"
3246
trigger="click"
3347
closeOnClick
3448
tooltip={({ onHide }: WithHideFn) => (
35-
<TooltipLinkList
36-
links={createLinks(onHide)}
37-
/>
49+
<TooltipLinkList links={createLinks(onHide)} />
3850
)}
3951
>
4052
<IconButton

extensions/ql-vscode/.storybook/vscode-theme-addon/manager.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import * as React from 'react';
2-
import { addons, types } from '@storybook/addons';
3-
import { ThemeSelector } from './ThemeSelector';
1+
import * as React from "react";
2+
import { addons, types } from "@storybook/addons";
3+
import { ThemeSelector } from "./ThemeSelector";
44

5-
const ADDON_ID = 'vscode-theme-addon';
5+
const ADDON_ID = "vscode-theme-addon";
66

77
addons.register(ADDON_ID, () => {
88
addons.add(ADDON_ID, {
9-
title: 'VSCode Themes',
9+
title: "VSCode Themes",
1010
type: types.TOOL,
1111
match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
1212
render: () => <ThemeSelector />,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function config(entry = []) {
2-
return [...entry, require.resolve('./preview.ts')];
2+
return [...entry, require.resolve("./preview.ts")];
33
}
44

55
export function managerEntries(entry = []) {
6-
return [...entry, require.resolve('./manager.tsx')];
6+
return [...entry, require.resolve("./manager.tsx")];
77
}

extensions/ql-vscode/.storybook/vscode-theme-addon/preview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { withTheme } from './withTheme';
2-
import { VSCodeTheme } from './theme';
1+
import { withTheme } from "./withTheme";
2+
import { VSCodeTheme } from "./theme";
33

44
export const decorators = [withTheme];
55

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export enum VSCodeTheme {
2-
Dark = 'dark',
3-
Light = 'light',
2+
Dark = "dark",
3+
Light = "light",
44
}
55

66
export const themeNames: { [key in VSCodeTheme]: string } = {
7-
[VSCodeTheme.Dark]: 'Dark+',
8-
[VSCodeTheme.Light]: 'Light+',
7+
[VSCodeTheme.Dark]: "Dark+",
8+
[VSCodeTheme.Light]: "Light+",
99
};

extensions/ql-vscode/.storybook/vscode-theme-addon/withTheme.ts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,45 @@
1-
import { useEffect, useGlobals } from '@storybook/addons';
2-
import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';
1+
import { useEffect, useGlobals } from "@storybook/addons";
2+
import type {
3+
AnyFramework,
4+
PartialStoryFn as StoryFunction,
5+
StoryContext,
6+
} from "@storybook/csf";
37

4-
import { VSCodeTheme } from './theme';
8+
import { VSCodeTheme } from "./theme";
59

610
const themeFiles: { [key in VSCodeTheme]: string } = {
7-
// eslint-disable-next-line @typescript-eslint/no-var-requires
8-
[VSCodeTheme.Dark]: require('!file-loader?modules!../../src/stories/vscode-theme-dark.css').default,
9-
// eslint-disable-next-line @typescript-eslint/no-var-requires
10-
[VSCodeTheme.Light]: require('!file-loader?modules!../../src/stories/vscode-theme-light.css').default,
11+
[VSCodeTheme.Dark]:
12+
// eslint-disable-next-line @typescript-eslint/no-var-requires
13+
require("!file-loader?modules!../../src/stories/vscode-theme-dark.css")
14+
.default,
15+
[VSCodeTheme.Light]:
16+
// eslint-disable-next-line @typescript-eslint/no-var-requires
17+
require("!file-loader?modules!../../src/stories/vscode-theme-light.css")
18+
.default,
1119
};
1220

1321
export const withTheme = (
1422
StoryFn: StoryFunction<AnyFramework>,
15-
context: StoryContext<AnyFramework>
23+
context: StoryContext<AnyFramework>,
1624
) => {
1725
const [{ vscodeTheme }] = useGlobals();
1826

1927
useEffect(() => {
2028
const styleSelectorId =
21-
context.viewMode === 'docs'
29+
context.viewMode === "docs"
2230
? `addon-vscode-theme-docs-${context.id}`
23-
: 'addon-vscode-theme-theme';
31+
: "addon-vscode-theme-theme";
2432

25-
const theme = Object.values(VSCodeTheme).includes(vscodeTheme) ? vscodeTheme as VSCodeTheme : VSCodeTheme.Dark;
33+
const theme = Object.values(VSCodeTheme).includes(vscodeTheme)
34+
? (vscodeTheme as VSCodeTheme)
35+
: VSCodeTheme.Dark;
2636

2737
document.getElementById(styleSelectorId)?.remove();
2838

29-
const link = document.createElement('link');
39+
const link = document.createElement("link");
3040
link.id = styleSelectorId;
3141
link.href = themeFiles[theme];
32-
link.rel = 'stylesheet';
42+
link.rel = "stylesheet";
3343

3444
document.head.appendChild(link);
3545
}, [vscodeTheme]);
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
import * as gulp from 'gulp';
1+
import * as gulp from "gulp";
22
// eslint-disable-next-line @typescript-eslint/no-var-requires
3-
const replace = require('gulp-replace');
3+
const replace = require("gulp-replace");
44

55
/** Inject the application insights key into the telemetry file */
66
export function injectAppInsightsKey() {
77
if (!process.env.APP_INSIGHTS_KEY) {
88
// noop
9-
console.log('APP_INSIGHTS_KEY environment variable is not set. So, cannot inject it into the application.');
9+
console.log(
10+
"APP_INSIGHTS_KEY environment variable is not set. So, cannot inject it into the application.",
11+
);
1012
return Promise.resolve();
1113
}
1214

1315
// replace the key
14-
return gulp.src(['out/telemetry.js'])
16+
return gulp
17+
.src(["out/telemetry.js"])
1518
.pipe(replace(/REPLACE-APP-INSIGHTS-KEY/, process.env.APP_INSIGHTS_KEY))
16-
.pipe(gulp.dest('out/'));
19+
.pipe(gulp.dest("out/"));
1720
}

0 commit comments

Comments
 (0)