Skip to content

Commit 24eaacc

Browse files
committed
Appease linter
1 parent 433ad69 commit 24eaacc

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

eslint.config.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ export default tseslint.config(
2929
},
3030
],
3131
"no-empty": ["warn", { allowEmptyCatch: true }],
32-
"prefer-const": "warn",
32+
// `ignoreReadBeforeAssign` keeps the rule from flagging the legitimate
33+
// pattern where a `let` is declared first so it can be captured by a
34+
// closure defined immediately afterward, and is then assigned later
35+
// (e.g. `let timer; const cleanup = () => clearTimeout(timer); timer = setTimeout(...)`).
36+
// Rewriting those to `const` would force restructuring just to silence
37+
// the lint without any real readability gain.
38+
"prefer-const": ["warn", { ignoreReadBeforeAssign: true }],
3339
},
3440
},
3541
);

src/core/sync-engine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class SyncEngine {
231231
* Used by --force to re-sync every file.
232232
*/
233233
async resetSnapshot(): Promise<void> {
234-
let snapshot = await this.snapshotManager.load()
234+
const snapshot = await this.snapshotManager.load()
235235
if (!snapshot) return
236236
this.snapshotManager.clear(snapshot)
237237
await this.snapshotManager.save(snapshot)
@@ -243,7 +243,7 @@ export class SyncEngine {
243243
* documents. The root directory document itself is preserved.
244244
*/
245245
async nuclearReset(): Promise<void> {
246-
let snapshot = await this.snapshotManager.load()
246+
const snapshot = await this.snapshotManager.load()
247247
if (!snapshot) return
248248

249249
// Clear the root directory document's entries

0 commit comments

Comments
 (0)