Skip to content

Commit 9baf21b

Browse files
committed
Enable noUnusedImports and noUnusedVariables in Biome
1 parent ff0b0e1 commit 9baf21b

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

biome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"complexity": {
1313
"noUselessSwitchCase": "off"
1414
},
15+
"correctness": {
16+
"noUnusedImports": "warn",
17+
"noUnusedVariables": "warn"
18+
},
1519
"suspicious": {
1620
"noConsoleLog": "warn"
1721
}

src/filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function asyncFilter<T>(
2727
})
2828
.catch(reject);
2929
}),
30-
).then(() => result.filter((cur, idx) => idx in result));
30+
).then(() => result.filter((_cur, idx) => idx in result));
3131
}
3232

3333
export default asyncFilter;

src/filter_strict.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function asyncFilterStrict<T>(
2727
})
2828
.catch(reject);
2929
}),
30-
).then(() => result.filter((cur, idx) => idx in result));
30+
).then(() => result.filter((_cur, idx) => idx in result));
3131
}
3232

3333
export default asyncFilterStrict;

src/forEach.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('asyncForEach()', () => {
4343
});
4444

4545
it.skip('assertions below are valid for synchronous .forEach()', () => {
46-
const [arr, pushDuplicate] = makePushDuplicate();
46+
const [_arr, pushDuplicate] = makePushDuplicate();
4747
const mapper = vi.fn().mockImplementation(pushDuplicate);
4848

4949
inputArr.forEach(mapper);
@@ -57,7 +57,7 @@ describe('asyncForEach()', () => {
5757
});
5858

5959
it('iterates through an array properly', async () => {
60-
const [arr, pushDuplicate] = makePushDuplicateInRandomTime();
60+
const [_arr, pushDuplicate] = makePushDuplicateInRandomTime();
6161
const mapper = vi.fn().mockImplementation(pushDuplicate);
6262

6363
await asyncForEach(inputArr, mapper);

src/forEach_strict.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('asyncForEachStrict()', () => {
4747
});
4848

4949
it.skip('assertions below are valid for synchronous .forEach()', () => {
50-
const [arr, pushDuplicate] = makePushDuplicate();
50+
const [_arr, pushDuplicate] = makePushDuplicate();
5151
const mapper = vi.fn().mockImplementation(pushDuplicate);
5252

5353
inputArr.forEach(mapper);
@@ -61,7 +61,7 @@ describe('asyncForEachStrict()', () => {
6161
});
6262

6363
it('iterates through an array properly', async () => {
64-
const [arr, pushDuplicate] = makePushDuplicateInRandomTime();
64+
const [_arr, pushDuplicate] = makePushDuplicateInRandomTime();
6565
const mapper = vi.fn().mockImplementation(pushDuplicate);
6666

6767
await asyncForEachStrict(inputArr, mapper);

src/reduce.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ describe('asyncReduce()', () => {
6060
});
6161

6262
it('returns type string given function that returns Promise<string> and no initial value', async () => {
63-
const result = await asyncReduce(['a', 'b', 'c'], async (temp, cur) => cur);
63+
const result = await asyncReduce(['a', 'b', 'c'], async (_temp, cur) => cur);
6464

6565
assertType<string>(result);
6666

6767
expect(result).toBe('c');
6868

6969
// Sanity check
70-
const resultSync = ['a', 'b', 'c'].reduce((temp, cur) => cur);
70+
const resultSync = ['a', 'b', 'c'].reduce((_temp, cur) => cur);
7171

7272
assertType<string>(resultSync);
7373

@@ -99,7 +99,7 @@ describe('asyncReduce()', () => {
9999
it('returns type number[] given function that returns Promise<number> and initial value of type number', async () => {
100100
const result = await asyncReduce(
101101
['a', 'b', 'c'],
102-
async (temp, cur, idx) => [...temp, idx],
102+
async (temp, _cur, idx) => [...temp, idx],
103103
[0],
104104
);
105105

@@ -109,7 +109,7 @@ describe('asyncReduce()', () => {
109109

110110
// Sanity check
111111
const resultSync = ['a', 'b', 'c'].reduce(
112-
(temp, cur, idx) => {
112+
(temp, _cur, idx) => {
113113
temp.push(idx);
114114
return temp;
115115
},

0 commit comments

Comments
 (0)