From 1322dbab526b55a5491ad032591b9080b62786f5 Mon Sep 17 00:00:00 2001 From: SebastianMC <23032356+SebastianMC@users.noreply.github.com> Date: Wed, 23 Apr 2025 00:20:32 +0200 Subject: [PATCH] #202 Syntax sugar to satisfy stricter TS compilation rules and improve readability --- src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 90bc329..86debae 100644 --- a/src/main.ts +++ b/src/main.ts @@ -707,8 +707,10 @@ export default class CustomSortPlugin workspaceLeafContentElementParentToObserve = document.querySelector(".workspace"); } if (workspaceLeafContentElementParentToObserve) { + // Syntax sugar to satisfy the strict TypeScript compiler + const fileExplorerParentElement = workspaceLeafContentElementParentToObserve const fullyFledgedFileExplorerElementSelector= - () => workspaceLeafContentElementParentToObserve.querySelector('[data-type="file-explorer"] .nav-files-container'); + () => fileExplorerParentElement.querySelector('[data-type="file-explorer"] .nav-files-container'); const mutationObserver = new MutationObserver((_, observerInstance) => { const fullyFledgedFileExplorerElement = fullyFledgedFileExplorerElementSelector();