Skip to content

Commit a7cabef

Browse files
fix(sonar): use const when not reassigned
1 parent 57400b1 commit a7cabef

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ module.exports = {
2020
},
2121
],
2222
curly: [2, 'all'],
23+
'prefer-const': [
24+
'error',
25+
{
26+
destructuring: 'any',
27+
},
28+
],
2329
},
2430
overrides: [
2531
// Configuration for TypeScript files

src/core/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ type WithSelectors<S> = S extends { getState: () => infer T }
1212
export const createSelectors = <S extends UseBoundStore<StoreApi<object>>>(
1313
_store: S
1414
) => {
15-
let store = _store as WithSelectors<typeof _store>;
15+
const store = _store as WithSelectors<typeof _store>;
1616
store.use = {};
17-
for (let k of Object.keys(store.getState())) {
17+
for (const k of Object.keys(store.getState())) {
1818
(store.use as any)[k] = () => store((s) => s[k as keyof typeof s]);
1919
}
2020

0 commit comments

Comments
 (0)