Skip to content

Commit d4f76db

Browse files
committed
chore: update prettier to v3 (v3.0.3)
Signed-off-by: Florent Benoit <[email protected]>
1 parent 80704c4 commit d4f76db

23 files changed

+122
-57
lines changed

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"arrowParens": "avoid",
99
"printWidth": 120,
1010
"trailingComma": "all",
11+
"plugins": ["prettier-plugin-svelte"]
1112
}
1213

extensions/compose/src/cli-run.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ const macosExtraPath = '/usr/local/bin:/opt/homebrew/bin:/opt/local/bin';
4141
const localBinDir = '/usr/local/bin';
4242

4343
export class CliRun {
44-
constructor(private readonly extensionContext: extensionApi.ExtensionContext, private os: OS) {}
44+
constructor(
45+
private readonly extensionContext: extensionApi.ExtensionContext,
46+
private os: OS,
47+
) {}
4548

4649
getPath(): string {
4750
const env = process.env;

extensions/compose/src/compose-wrapper-generator.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import batMustacheTemplate from './templates/podman-compose.bat.mustache?raw';
2626

2727
// Generate the script to run docker-compose by setting up all environment variables
2828
export class ComposeWrapperGenerator {
29-
constructor(private os: OS, private binFolder: string) {}
29+
constructor(
30+
private os: OS,
31+
private binFolder: string,
32+
) {}
3033

3134
protected async generateContent(connection: extensionApi.ProviderContainerConnection): Promise<string> {
3235
// take first one

extensions/compose/src/detect.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export class Detect {
2626
static readonly WINDOWS_SOCKET_PATH = '//./pipe/docker_engine';
2727
static readonly UNIX_SOCKET_PATH = '/var/run/docker.sock';
2828

29-
constructor(private cliRun: CliRun, private os: OS, private storagePath: string) {}
29+
constructor(
30+
private cliRun: CliRun,
31+
private os: OS,
32+
private storagePath: string,
33+
) {}
3034

3135
// search if docker-compose is available in the path (+ include storage/bin folder)
3236
async checkForDockerCompose(): Promise<boolean> {

extensions/kind/src/kind-installer.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ export class KindInstaller {
5959

6060
private assetPromise: Promise<AssetInfo>;
6161

62-
constructor(private readonly storagePath: string, private telemetryLogger: extensionApi.TelemetryLogger) {
62+
constructor(
63+
private readonly storagePath: string,
64+
private telemetryLogger: extensionApi.TelemetryLogger,
65+
) {
6366
this.assetNames.set(WINDOWS_X64_PLATFORM, WINDOWS_X64_ASSET_NAME);
6467
this.assetNames.set(LINUX_X64_PLATFORM, LINUX_X64_ASSET_NAME);
6568
this.assetNames.set(LINUX_ARM64_PLATFORM, LINUX_ARM64_ASSET_NAME);

extensions/podman/src/podman-install.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export interface PodmanInfo {
4545
}
4646

4747
export class PodmanInfoImpl implements PodmanInfo {
48-
constructor(private podmanInfo: PodmanInfo, private readonly storagePath: string) {
48+
constructor(
49+
private podmanInfo: PodmanInfo,
50+
private readonly storagePath: string,
51+
) {
4952
if (!podmanInfo) {
5053
this.podmanInfo = { lastUpdateCheck: 0 } as PodmanInfo;
5154
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
"nock": "^13.3.3",
122122
"playwright": "1.37.1",
123123
"postcss-import": "^15.1.0",
124-
"prettier": "^2.8.8",
125-
"prettier-plugin-svelte": "^2.10.1",
124+
"prettier": "^3.0.3",
125+
"prettier-plugin-svelte": "^3.0.3",
126126
"typescript": "5.2.2",
127127
"validator": "^13.11.0",
128128
"vite": "^4.4.9",

packages/main/src/plugin/autostart-engine.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import type { ConfigurationRegistry, IConfigurationNode } from './configuration-
2020
import type { ProviderRegistry } from './provider-registry.js';
2121

2222
export class AutostartEngine {
23-
constructor(private configurationRegistry: ConfigurationRegistry, private providerRegistry: ProviderRegistry) {}
23+
constructor(
24+
private configurationRegistry: ConfigurationRegistry,
25+
private providerRegistry: ProviderRegistry,
26+
) {}
2427

2528
async init(): Promise<void> {
2629
// add configuration

packages/main/src/plugin/custompick/custompick-impl.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export class CustomPickImpl<T extends CustomPickItem> implements CustomPick<T>,
3232
private readonly _onDidConfirmSelection = new Emitter<number[]>();
3333
private readonly _onDidHide = new Emitter<void>();
3434

35-
constructor(private id: number, private registry: CustomPickRegistry, private apiSender: ApiSenderType) {}
35+
constructor(
36+
private id: number,
37+
private registry: CustomPickRegistry,
38+
private apiSender: ApiSenderType,
39+
) {}
3640

3741
readonly onDidConfirmSelection: Event<number[]> = this._onDidConfirmSelection.event;
3842
readonly onDidHide: Event<void> = this._onDidHide.event;

packages/main/src/plugin/docker-extension/docker-desktop-installation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ export class DockerDesktopInstallation {
303303
// ok search the image
304304
const images = await providerConnection.listImages();
305305
// const foundMatchingImage = images.find(image => image.RepoTags?.find(tag => tag.includes('aquasec/trivy-docker-extension:0.4.3')));
306-
const foundMatchingImage = images.find(image =>
307-
image.RepoTags?.find(tag => tag.includes(imageName) || imageName.includes(tag)),
306+
const foundMatchingImage = images.find(
307+
image => image.RepoTags?.find(tag => tag.includes(imageName) || imageName.includes(tag)),
308308
);
309309

310310
if (!foundMatchingImage) {

packages/main/src/plugin/docker-extension/docker-plugin-adapter.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export interface RawExecResult {
1919
export class DockerPluginAdapter {
2020
static MACOS_EXTRA_PATH = '/usr/local/bin:/opt/homebrew/bin:/opt/local/bin:/opt/podman/bin';
2121

22-
constructor(private contributionManager: ContributionManager, private containerRegistry: ContainerProviderRegistry) {}
22+
constructor(
23+
private contributionManager: ContributionManager,
24+
private containerRegistry: ContainerProviderRegistry,
25+
) {}
2326

2427
filterDockerArgs(cmd: string, args: string[]): string[] {
2528
// filter out the "-v", "/var/run/docker.sock:/var/run/docker.sock" from args

packages/main/src/plugin/extensions-catalog/extensions-catalog.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export class ExtensionsCatalog {
4040
private cachedCatalog: InternalCatalogJSON | undefined;
4141
static readonly CACHE_TIMEOUT = 1000 * 60 * 60 * 4; // 4 hours
4242

43-
constructor(private certificates: Certificates, private proxy: Proxy) {
43+
constructor(
44+
private certificates: Certificates,
45+
private proxy: Proxy,
46+
) {
4447
this.proxy.onDidUpdateProxy(settings => {
4548
this.proxySettings = settings;
4649
});

packages/main/src/plugin/featured/featured.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ import type { FeaturedExtension } from '/@/plugin/featured/featured-api.js';
2828
export class Featured {
2929
private fetchableExtensions: CatalogFetchableExtension[] = [];
3030

31-
constructor(private extensionLoader: ExtensionLoader, private extensionsCatalog: ExtensionsCatalog) {}
31+
constructor(
32+
private extensionLoader: ExtensionLoader,
33+
private extensionsCatalog: ExtensionsCatalog,
34+
) {}
3235

3336
async init(): Promise<void> {
3437
this.fetchableExtensions = await this.extensionsCatalog.getFetchableExtensions();

packages/main/src/plugin/index.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,17 @@ export class PluginSystem {
562562
}
563563

564564
// Create an interval to check for updates every 12 hours
565-
setInterval(() => {
566-
autoUpdater
567-
.checkForUpdates()
568-
.then(result => (updateCheckResult = result))
569-
.catch((error: unknown) => {
570-
console.log('unable to check for updates', error);
571-
});
572-
}, 1000 * 60 * 60 * 12);
565+
setInterval(
566+
() => {
567+
autoUpdater
568+
.checkForUpdates()
569+
.then(result => (updateCheckResult = result))
570+
.catch((error: unknown) => {
571+
console.log('unable to check for updates', error);
572+
});
573+
},
574+
1000 * 60 * 60 * 12,
575+
);
573576

574577
// Update will create a standard "autoUpdater" dialog / update process
575578
commandRegistry.registerCommand('update', async () => {

packages/main/src/plugin/module-loader.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export class ModuleLoader {
4040
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4141
private _overrides = new Map<string, object | OverrideFunction>();
4242

43-
constructor(private _module: NodeInternalModule, private _analyzedExtensions: Map<string, ExtensionModule>) {}
43+
constructor(
44+
private _module: NodeInternalModule,
45+
private _analyzedExtensions: Map<string, ExtensionModule>,
46+
) {}
4447

4548
addOverride(lookup: Record<string, object | OverrideFunction>) {
4649
Object.keys(lookup).forEach(entry => {

packages/main/src/plugin/onboarding-registry.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ import type { Context } from './context/context.js';
2727
export class OnboardingRegistry {
2828
private onboardingInfos: Map<string, OnboardingInfo> = new Map<string, OnboardingInfo>();
2929

30-
constructor(private configurationRegistry: ConfigurationRegistry, private context: Context) {}
30+
constructor(
31+
private configurationRegistry: ConfigurationRegistry,
32+
private context: Context,
33+
) {}
3134

3235
registerOnboarding(extension: AnalyzedExtension, onboarding: Onboarding): void {
3336
const onInfo = this.createOnboardingInfo(extension, onboarding);

packages/main/src/plugin/tray-icon-color.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import type { ConfigurationRegistry, IConfigurationNode } from './configuration-
2020
import type { ProviderRegistry } from './provider-registry.js';
2121

2222
export class TrayIconColor {
23-
constructor(private configurationRegistry: ConfigurationRegistry, private providerRegistry: ProviderRegistry) {}
23+
constructor(
24+
private configurationRegistry: ConfigurationRegistry,
25+
private providerRegistry: ProviderRegistry,
26+
) {}
2427

2528
async init(): Promise<void> {
2629
// add configuration

packages/main/src/tray-menu.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export class TrayMenu {
5252
private menuCustomItems = new Map<string, MenuItemConstructorOptions>();
5353
private menuContainerProviderConnectionItems = new Map<string, ProviderContainerConnectionInfoMenuItem>();
5454

55-
constructor(private readonly tray: Tray, private readonly animatedTray: AnimatedTray) {
55+
constructor(
56+
private readonly tray: Tray,
57+
private readonly animatedTray: AnimatedTray,
58+
) {
5659
ipcMain.on(
5760
'tray:add-provider-menu-item',
5861
(_, param: { providerId: string; menuItem: MenuItemConstructorOptions }) => {

packages/renderer/src/lib/context/contextKey.ts

+20-5
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,10 @@ export class ContextKeyDefinedExpr implements IContextKeyExpression {
847847

848848
public readonly type = ContextKeyExprType.Defined;
849849

850-
protected constructor(readonly key: string, private negated: ContextKeyExpression | undefined) {}
850+
protected constructor(
851+
readonly key: string,
852+
private negated: ContextKeyExpression | undefined,
853+
) {}
851854

852855
public cmp(other: ContextKeyExpression): number {
853856
if (other.type !== this.type) {
@@ -977,7 +980,10 @@ export class ContextKeyInExpr implements IContextKeyExpression {
977980
public readonly type = ContextKeyExprType.In;
978981
private negated: ContextKeyExpression | undefined = undefined;
979982

980-
private constructor(private readonly key: string, private readonly valueKey: string) {}
983+
private constructor(
984+
private readonly key: string,
985+
private readonly valueKey: string,
986+
) {}
981987

982988
public cmp(other: ContextKeyExpression): number {
983989
if (other.type !== this.type) {
@@ -1045,7 +1051,10 @@ export class ContextKeyNotInExpr implements IContextKeyExpression {
10451051

10461052
private readonly _negated: ContextKeyInExpr;
10471053

1048-
private constructor(private readonly key: string, private readonly valueKey: string) {
1054+
private constructor(
1055+
private readonly key: string,
1056+
private readonly valueKey: string,
1057+
) {
10491058
this._negated = ContextKeyInExpr.create(key, valueKey);
10501059
}
10511060

@@ -1176,7 +1185,10 @@ export class ContextKeyNotExpr implements IContextKeyExpression {
11761185

11771186
public readonly type = ContextKeyExprType.Not;
11781187

1179-
private constructor(private readonly key: string, private negated: ContextKeyExpression | undefined) {}
1188+
private constructor(
1189+
private readonly key: string,
1190+
private negated: ContextKeyExpression | undefined,
1191+
) {}
11801192

11811193
public cmp(other: ContextKeyExpression): number {
11821194
if (other.type !== this.type) {
@@ -1496,7 +1508,10 @@ export class ContextKeyRegexExpr implements IContextKeyExpression {
14961508
public readonly type = ContextKeyExprType.Regex;
14971509
private negated: ContextKeyExpression | undefined = undefined;
14981510

1499-
private constructor(private readonly key: string, private readonly regexp: RegExp | undefined) {
1511+
private constructor(
1512+
private readonly key: string,
1513+
private readonly regexp: RegExp | undefined,
1514+
) {
15001515
//
15011516
}
15021517

packages/renderer/src/lib/preferences/PreferencesConnectionCreationRendering.spec.ts

+9-11
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,15 @@ test('Expect that the create button is available', async () => {
7878
function mockCallback(
7979
callback: (keyLogger: (key: symbol, eventName: LoggerEventName, args: string[]) => void) => Promise<void>,
8080
) {
81-
return vi
82-
.fn()
83-
.mockImplementation(async function (
84-
_id: string,
85-
_params: unknown,
86-
_key: unknown,
87-
keyLogger: (key: symbol, eventName: LoggerEventName, args: string[]) => void,
88-
): Promise<void> {
89-
// keep reference
90-
callback(keyLogger);
91-
});
81+
return vi.fn().mockImplementation(async function (
82+
_id: string,
83+
_params: unknown,
84+
_key: unknown,
85+
keyLogger: (key: symbol, eventName: LoggerEventName, args: string[]) => void,
86+
): Promise<void> {
87+
// keep reference
88+
callback(keyLogger);
89+
});
9290
}
9391

9492
test('Expect Close button redirects to Resources page', async () => {

packages/renderer/src/stores/catalog-extensions.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ export const catalogExtensionEventStore = new EventStore<CatalogExtension[]>(
4545
export const catalogExtensionEventStoreInfo = catalogExtensionEventStore.setup();
4646

4747
// and refresh every 4 hours from client side
48-
setInterval(() => {
49-
catalogExtensionEventStoreInfo.fetch().catch((e: unknown) => {
50-
console.error('Unable to fetch catalog extensions', e);
51-
});
52-
}, 4 * 60 * 60 * 1000);
48+
setInterval(
49+
() => {
50+
catalogExtensionEventStoreInfo.fetch().catch((e: unknown) => {
51+
console.error('Unable to fetch catalog extensions', e);
52+
});
53+
},
54+
4 * 60 * 60 * 1000,
55+
);

website/src/css/custom.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
font-family: 'Montserrat';
1414
font-style: normal;
1515
font-weight: normal;
16-
src: url('../../static/fonts/montserrat-v25-latin-regular.woff2') format('woff2'),
16+
src:
17+
url('../../static/fonts/montserrat-v25-latin-regular.woff2') format('woff2'),
1718
url('../../static/fonts/montserrat-v25-latin-regular.woff') format('woff'),
1819
url('../../static/fonts/montserrat-v25-latin-regular.ttf') format('truetype');
1920
}

yarn.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -11646,15 +11646,15 @@ prepend-http@^2.0.0:
1164611646
resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz"
1164711647
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
1164811648

11649-
prettier-plugin-svelte@^2.10.1:
11650-
version "2.10.1"
11651-
resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-2.10.1.tgz#e1abbe5689e8a926c60b8bc42e61233556ca90d1"
11652-
integrity sha512-Wlq7Z5v2ueCubWo0TZzKc9XHcm7TDxqcuzRuGd0gcENfzfT4JZ9yDlCbEgxWgiPmLHkBjfOtpAWkcT28MCDpUQ==
11653-
11654-
prettier@^2.8.8:
11655-
version "2.8.8"
11656-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
11657-
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
11649+
prettier-plugin-svelte@^3.0.3:
11650+
version "3.0.3"
11651+
resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-3.0.3.tgz#a823295167f27dc71a4462ee6cb3da9f3f5ca2ea"
11652+
integrity sha512-dLhieh4obJEK1hnZ6koxF+tMUrZbV5YGvRpf2+OADyanjya5j0z1Llo8iGwiHmFWZVG/hLEw/AJD5chXd9r3XA==
11653+
11654+
prettier@^3.0.3:
11655+
version "3.0.3"
11656+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
11657+
integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==
1165811658

1165911659
pretty-error@^4.0.0:
1166011660
version "4.0.0"

0 commit comments

Comments
 (0)