Skip to content

Commit d133081

Browse files
sxzzPlumbiu
andcommitted
chore: remove unused eslint-disable rules (#9019)
Co-authored-by: Guo Xingjun <[email protected]>
1 parent 00c6f85 commit d133081

File tree

5 files changed

+59
-68
lines changed

5 files changed

+59
-68
lines changed

packages/compiler-dom/src/decodeHtmlBrowser.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-restricted-globals */
2-
31
let decoder: HTMLDivElement
42

53
export function decodeHtmlBrowser(raw: string, asAttr = false): string {

packages/dts-test/ref.test-d.ts

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
MaybeRefOrGetter,
1717
ComputedRef,
1818
computed,
19-
ShallowRef
19+
ShallowRef,
2020
} from 'vue'
2121
import { expectType, describe, IsUnion, IsAny } from './utils'
2222

@@ -37,7 +37,7 @@ function plainType(arg: number | Ref<number>) {
3737

3838
// ref inner type should be unwrapped
3939
const nestedRef = ref({
40-
foo: ref(1)
40+
foo: ref(1),
4141
})
4242
expectType<{ foo: number }>(nestedRef.value)
4343

@@ -60,7 +60,7 @@ function plainType(arg: number | Ref<number>) {
6060

6161
// with symbol
6262
expectType<Ref<IteratorFoo | null | undefined>>(
63-
ref<IteratorFoo | null | undefined>()
63+
ref<IteratorFoo | null | undefined>(),
6464
)
6565

6666
// should not unwrap ref inside arrays
@@ -101,13 +101,11 @@ function bailType(arg: HTMLElement | Ref<HTMLElement>) {
101101
expectType<HTMLElement>(unref(arg))
102102

103103
// ref inner type should be unwrapped
104-
// eslint-disable-next-line no-restricted-globals
105104
const nestedRef = ref({ foo: ref(document.createElement('DIV')) })
106105

107106
expectType<Ref<{ foo: HTMLElement }>>(nestedRef)
108107
expectType<{ foo: HTMLElement }>(nestedRef.value)
109108
}
110-
// eslint-disable-next-line no-restricted-globals
111109
const el = document.createElement('DIV')
112110
bailType(el)
113111

@@ -127,7 +125,7 @@ function withSymbol() {
127125
[Symbol.toPrimitive]: new WeakMap<Ref<boolean>, string>(),
128126
[Symbol.toStringTag]: { weakSet: new WeakSet<Ref<boolean>>() },
129127
[Symbol.unscopables]: { weakMap: new WeakMap<Ref<boolean>, string>() },
130-
[customSymbol]: { arr: [ref(1)] }
128+
[customSymbol]: { arr: [ref(1)] },
131129
}
132130

133131
const objRef = ref(obj)
@@ -144,10 +142,10 @@ function withSymbol() {
144142
expectType<WeakSet<Ref<boolean>>>(objRef.value[Symbol.split])
145143
expectType<WeakMap<Ref<boolean>, string>>(objRef.value[Symbol.toPrimitive])
146144
expectType<{ weakSet: WeakSet<Ref<boolean>> }>(
147-
objRef.value[Symbol.toStringTag]
145+
objRef.value[Symbol.toStringTag],
148146
)
149147
expectType<{ weakMap: WeakMap<Ref<boolean>, string> }>(
150-
objRef.value[Symbol.unscopables]
148+
objRef.value[Symbol.unscopables],
151149
)
152150
expectType<{ arr: Ref<number>[] }>(objRef.value[customSymbol])
153151
}
@@ -157,8 +155,8 @@ withSymbol()
157155
const state = reactive({
158156
foo: {
159157
value: 1,
160-
label: 'bar'
161-
}
158+
label: 'bar',
159+
},
162160
})
163161

164162
expectType<string>(state.foo.label)
@@ -227,16 +225,16 @@ describe('shallowRef with generic', <T extends { name: string }>() => {
227225
{
228226
// should return ShallowRef<T> | Ref<T>, not ShallowRef<T | Ref<T>>
229227
expectType<ShallowRef<{ name: string }> | Ref<{ name: string }>>(
230-
shallowRef({} as MaybeRef<{ name: string }>)
228+
shallowRef({} as MaybeRef<{ name: string }>),
231229
)
232230
expectType<ShallowRef<number> | Ref<string[]> | ShallowRef<string>>(
233-
shallowRef('' as Ref<string[]> | string | number)
231+
shallowRef('' as Ref<string[]> | string | number),
234232
)
235233
}
236234

237235
// proxyRefs: should return `reactive` directly
238236
const r1 = reactive({
239-
k: 'v'
237+
k: 'v',
240238
})
241239
const p1 = proxyRefs(r1)
242240
expectType<typeof r1>(p1)
@@ -245,8 +243,8 @@ expectType<typeof r1>(p1)
245243
const r2 = {
246244
a: ref(1),
247245
obj: {
248-
k: ref('foo')
249-
}
246+
k: ref('foo'),
247+
},
250248
}
251249
const p2 = proxyRefs(r2)
252250
expectType<number>(p2.a)
@@ -261,7 +259,7 @@ expectType<Ref<string>>(p2.obj.k)
261259
} = {
262260
a: 1,
263261
b: ref(1),
264-
c: 1
262+
c: 1,
265263
}
266264

267265
// toRef
@@ -288,8 +286,8 @@ expectType<Ref<string>>(p2.obj.k)
288286
// Both should not do any unwrapping
289287
const someReactive = shallowReactive({
290288
a: {
291-
b: ref(42)
292-
}
289+
b: ref(42),
290+
},
293291
})
294292

295293
const toRefResult = toRef(someReactive, 'a')
@@ -321,8 +319,8 @@ interface AppData {
321319

322320
const data: ToRefs<AppData> = toRefs(
323321
reactive({
324-
state: 'state1'
325-
})
322+
state: 'state1',
323+
}),
326324
)
327325

328326
switch (data.state.value) {
@@ -349,9 +347,9 @@ describe('shallow reactive in reactive', () => {
349347
const baz = reactive({
350348
foo: shallowReactive({
351349
a: {
352-
b: ref(42)
353-
}
354-
})
350+
b: ref(42),
351+
},
352+
}),
355353
})
356354

357355
const foo = toRef(baz, 'foo')
@@ -366,10 +364,10 @@ describe('shallow ref in reactive', () => {
366364
bar: {
367365
baz: ref(123),
368366
qux: reactive({
369-
z: ref(123)
370-
})
371-
}
372-
})
367+
z: ref(123),
368+
}),
369+
},
370+
}),
373371
})
374372

375373
expectType<Ref<number>>(x.foo.bar.baz)
@@ -378,7 +376,7 @@ describe('shallow ref in reactive', () => {
378376

379377
describe('ref in shallow ref', () => {
380378
const x = shallowRef({
381-
a: ref(123)
379+
a: ref(123),
382380
})
383381

384382
expectType<Ref<number>>(x.value.a)
@@ -387,8 +385,8 @@ describe('ref in shallow ref', () => {
387385
describe('reactive in shallow ref', () => {
388386
const x = shallowRef({
389387
a: reactive({
390-
b: ref(0)
391-
})
388+
b: ref(0),
389+
}),
392390
})
393391

394392
expectType<number>(x.value.a.b)
@@ -399,7 +397,7 @@ describe('toRef <-> toValue', () => {
399397
a: MaybeRef<string>,
400398
b: () => string,
401399
c: MaybeRefOrGetter<string>,
402-
d: ComputedRef<string>
400+
d: ComputedRef<string>,
403401
) {
404402
const r = toRef(a)
405403
expectType<Ref<string>>(r)
@@ -430,7 +428,7 @@ describe('toRef <-> toValue', () => {
430428
r: toValue(r),
431429
rb: toValue(rb),
432430
rc: toValue(rc),
433-
rd: toValue(rd)
431+
rd: toValue(rd),
434432
}
435433
}
436434

@@ -444,7 +442,7 @@ describe('toRef <-> toValue', () => {
444442
'foo',
445443
() => 'bar',
446444
ref('baz'),
447-
computed(() => 'hi')
448-
)
445+
computed(() => 'hi'),
446+
),
449447
)
450448
})

packages/reactivity/__tests__/collections/Map.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ describe('reactivity/collections', () => {
6969
const map = reactive(new Map())
7070
effect(() => {
7171
dummy = 0
72-
// eslint-disable-next-line no-unused-vars
7372
for (let [key, num] of map) {
7473
key
7574
dummy += num
@@ -164,7 +163,6 @@ describe('reactivity/collections', () => {
164163
effect(() => {
165164
dummy = ''
166165
dummy2 = 0
167-
// eslint-disable-next-line no-unused-vars
168166
for (let [key, num] of map.entries()) {
169167
dummy += key
170168
dummy2 += num
@@ -411,7 +409,7 @@ describe('reactivity/collections', () => {
411409
const map = reactive(raw)
412410
map.set(key, 2)
413411
expect(
414-
`Reactive Map contains both the raw and reactive`
412+
`Reactive Map contains both the raw and reactive`,
415413
).toHaveBeenWarned()
416414
})
417415

packages/reactivity/__tests__/collections/Set.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ describe('reactivity/collections', () => {
125125
const set = reactive(new Set<number>())
126126
effect(() => {
127127
dummy = 0
128-
// eslint-disable-next-line no-unused-vars
129128
for (let [key, num] of set.entries()) {
130129
key
131130
dummy += num
@@ -413,7 +412,7 @@ describe('reactivity/collections', () => {
413412
const set = reactive(raw)
414413
set.delete(key)
415414
expect(
416-
`Reactive Set contains both the raw and reactive`
415+
`Reactive Set contains both the raw and reactive`,
417416
).toHaveBeenWarned()
418417
})
419418

0 commit comments

Comments
 (0)