🌐 AI搜索 & 代理 主页
Skip to content

Commit 3d60ca4

Browse files
authored
chore: fix linting for PR #3913 (#3939)
1 parent 3de8dd1 commit 3d60ca4

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

docs/markdown/reference/images/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module.exports = {
7272
.use('vue-loader')
7373
.loader('vue-loader')
7474
.tap(options => {
75-
options['transformAssetUrls'] = {
75+
options.transformAssetUrls = {
7676
img: 'src',
7777
image: 'xlink:href',
7878
'b-img': 'src',

docs/plugins/play.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ const destroyVM = (name, vm) => {
8787
}
8888

8989
const processExamples = (el, binding, vnode, oldVnode) => {
90-
if (vnode.context.$options['beforeDestroy']) {
91-
vnode.context.$options['beforeDestroy'] = []
92-
.concat(vnode.context.$options['beforeDestroy'])
90+
if (vnode.context.$options.beforeDestroy) {
91+
vnode.context.$options.beforeDestroy = []
92+
.concat(vnode.context.$options.beforeDestroy)
9393
.filter(h => h)
9494
} else {
95-
vnode.context.$options['beforeDestroy'] = []
95+
vnode.context.$options.beforeDestroy = []
9696
}
9797

9898
// Get all code-snippets
@@ -122,7 +122,7 @@ const processExamples = (el, binding, vnode, oldVnode) => {
122122
let vm = createVM(name, pre, vnode)
123123

124124
// Ensure we destroy the VM when parent is destroyed
125-
vnode.context.$options['beforeDestroy'].push(() => destroyVM(name, vm))
125+
vnode.context.$options.beforeDestroy.push(() => destroyVM(name, vm))
126126

127127
// Enable live edit on double click
128128
pre.ondblclick = async () => {

src/components/button/button.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ const computeAttrs = (props, data) => {
115115
const link = isLink(props)
116116
const toggle = isToggle(props)
117117
const nonStdTag = isNonStandardTag(props)
118-
const role = data.attrs && data.attrs['role'] ? data.attrs['role'] : null
119-
let tabindex = data.attrs ? data.attrs['tabindex'] : null
118+
const role = data.attrs && data.attrs.role ? data.attrs.role : null
119+
let tabindex = data.attrs ? data.attrs.tabindex : null
120120
if (nonStdTag) {
121121
tabindex = '0'
122122
}

src/components/form-group/form-group.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,22 +293,29 @@ export const BFormGroup = {
293293
return keys(this.labelColProps).length > 0
294294
},
295295
labelId() {
296-
return this.$slots['label'] || this.label ? this.safeId('_BV_label_') : null
296+
return this.hasNormalizedSlot('label') || this.label ? this.safeId('_BV_label_') : null
297297
},
298298
descriptionId() {
299-
return this.$slots['description'] || this.description ? this.safeId('_BV_description_') : null
299+
return this.hasNormalizedSlot('description') || this.description
300+
? this.safeId('_BV_description_')
301+
: null
300302
},
301303
hasInvalidFeedback() {
302304
// Used for computing aria-describedby
303-
const $slots = this.$slots
304-
return this.computedState === false && ($slots['invalid-feedback'] || this.invalidFeedback)
305+
return (
306+
this.computedState === false &&
307+
(this.hasNormalizedSlot('invalid-feedback') || this.invalidFeedback)
308+
)
305309
},
306310
invalidFeedbackId() {
307311
return this.hasInvalidFeedback ? this.safeId('_BV_feedback_invalid_') : null
308312
},
309313
hasValidFeedback() {
310314
// Used for computing aria-describedby
311-
return this.computedState === true && (this.$slots['valid-feedback'] || this.validFeedback)
315+
return (
316+
this.computedState === true &&
317+
(this.hasNormalizedSlot('valid-feedback') || this.validFeedback)
318+
)
312319
},
313320
validFeedbackId() {
314321
return this.hasValidFeedback ? this.safeId('_BV_feedback_valid_') : null

src/utils/loose-equal.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ describe('utils/looseEqual', () => {
168168
it('compares null and undefined values correctly', () => {
169169
expect(looseEqual(null, null)).toBe(true)
170170
expect(looseEqual(undefined, undefined)).toBe(true)
171+
// eslint-disable-next-line no-void
171172
expect(looseEqual(void 0, undefined)).toBe(true)
172173
expect(looseEqual(null, undefined)).toBe(false)
174+
// eslint-disable-next-line no-void
173175
expect(looseEqual(null, void 0)).toBe(false)
174176
expect(looseEqual(null, '')).toBe(false)
175177
expect(looseEqual(null, false)).toBe(false)

0 commit comments

Comments
 (0)