File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments