Skip to content

Commit b2e756d

Browse files
authored
chore: strict unused check (#1163)
* chore: strict unused check * prefer dummy expect in tests
1 parent ec614ad commit b2e756d

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

eslint.config.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default tseslint.config(
7272
],
7373
'@typescript-eslint/no-explicit-any': 'off',
7474
'@typescript-eslint/no-unused-vars': [
75-
'warn',
75+
'error',
7676
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
7777
],
7878
'react-hooks/react-compiler': 'error',
@@ -95,7 +95,6 @@ export default tseslint.config(
9595
files: ['tests/**/*.{ts,tsx}'],
9696
rules: {
9797
'import/extensions': ['error', 'never'],
98-
'@typescript-eslint/no-unused-vars': 'off',
9998
'vitest/consistent-test-it': [
10099
'error',
101100
{ fn: 'it', withinDescribe: 'it' },

tests/proxyMap.bench.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ TEST_SIZES.forEach((size) => {
6363
const testData = generateTestData(size)
6464

6565
bench('proxyMap', () => {
66-
const map = proxyMap<number, number>(testData)
67-
testData.forEach(([key, value]) => {})
66+
const _map = proxyMap<number, number>(testData)
67+
testData.forEach(([_key, _value]) => {})
6868
})
6969
})
7070

@@ -120,7 +120,7 @@ TEST_SIZES.forEach((size) => {
120120
bench('proxyMap', () => {
121121
const map = proxyMap<number, number>(testData)
122122
const snap = snapshot(map)
123-
testData.forEach(([key, value]) => {
123+
testData.forEach(([key, _value]) => {
124124
snap.get(key)
125125
})
126126
})
@@ -132,9 +132,9 @@ TEST_SIZES.forEach((size) => {
132132

133133
bench('proxyMap', () => {
134134
const map = proxyMap<number, number>(testData)
135-
const snap1 = snapshot(map)
135+
const _snap1 = snapshot(map)
136136
map.set(oneData[0], oneData[1])
137-
const snap2 = snapshot(map)
137+
const _snap2 = snapshot(map)
138138
})
139139
})
140140

tests/proxyMap.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ describe('proxyMap', () => {
625625
const state = proxyMap()
626626
const TestComponent = () => {
627627
const snap = useSnapshot(state)
628+
expect(snap).toBeDefined()
628629

629630
return (
630631
<>

tests/snapshot.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ describe('snapshot', () => {
194194
}
195195

196196
const user = new User()
197+
expect(user).toBeDefined()
197198

198199
expectTypeOf<A>().toEqualTypeOf<B>()
199200
})

0 commit comments

Comments
 (0)