mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] optimize eslint-disable (#4070)
This commit is contained in:
parent
5777762249
commit
c74d90c561
@ -5,8 +5,7 @@ const Components = require('./get-components')();
|
||||
const packageJson = require('../package.json');
|
||||
|
||||
const version = process.env.VERSION || packageJson.version;
|
||||
const tips = `/* eslint-disable */
|
||||
// This file is auto gererated by build/build-entry.js`;
|
||||
const tips = '// This file is auto gererated by build/build-entry.js';
|
||||
|
||||
function buildEntry() {
|
||||
const uninstallComponents = [
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable camelcase */
|
||||
import AddressEdit from '..';
|
||||
import areaList from '../../area/demo/area.simple';
|
||||
import { mount, later } from '../../../test/utils';
|
||||
|
@ -24,7 +24,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable camelcase */
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable */
|
||||
// This file is auto gererated by build/build-entry.js
|
||||
import { VueConstructor } from 'vue/types';
|
||||
import ActionSheet from './action-sheet';
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable prefer-spread */
|
||||
import { createNamespace, addUnit } from '../utils';
|
||||
import { emit, inherit } from '../utils/functional';
|
||||
import { preventDefault } from '../utils/dom/event';
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable object-shorthand */
|
||||
import Search from '..';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
@ -99,9 +98,7 @@ test('right-icon prop', () => {
|
||||
test('right-icon slot', () => {
|
||||
const wrapper = mount(Search, {
|
||||
scopedSlots: {
|
||||
'right-icon'() {
|
||||
return 'Custom Right Icon';
|
||||
}
|
||||
'right-icon': () => 'Custom Right Icon'
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable camelcase */
|
||||
import Vue from 'vue';
|
||||
import Popup from '../popup';
|
||||
import Toast from '../toast';
|
||||
|
@ -100,7 +100,7 @@ export default createComponent({
|
||||
|
||||
if (value === '') {
|
||||
// 必填字段的校验
|
||||
if (String(message.required) === '1') { // eslint-disable-line
|
||||
if (String(message.required) === '1') {
|
||||
const textType = message.type === 'image'
|
||||
? '请上传'
|
||||
: '请填写';
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
goods_id: '946755',
|
||||
quota: 15,
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable object-shorthand */
|
||||
import { createNamespace } from '../utils';
|
||||
import { ChildrenMixin } from '../mixins/relation';
|
||||
|
||||
@ -30,6 +29,7 @@ export default createComponent({
|
||||
},
|
||||
|
||||
watch: {
|
||||
// eslint-disable-next-line object-shorthand
|
||||
'parent.currentIndex'() {
|
||||
this.inited = this.inited || this.isActive;
|
||||
},
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-use-before-define */
|
||||
import { isDef, isObj } from '.';
|
||||
import { ObjectIndex } from './types';
|
||||
|
||||
@ -14,6 +13,7 @@ function assignKey(to: ObjectIndex, from: ObjectIndex, key: string) {
|
||||
if (!hasOwnProperty.call(to, key) || !isObj(val) || typeof val === 'function') {
|
||||
to[key] = val;
|
||||
} else {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
to[key] = deepAssign(Object(to[key]), from[key]);
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,21 @@
|
||||
/* eslint-disable no-empty */
|
||||
/* eslint-disable getter-return */
|
||||
/* eslint-disable import/no-mutable-exports */
|
||||
import { isServer } from '..';
|
||||
import { EventHandler } from '../types';
|
||||
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
export let supportsPassive = false;
|
||||
|
||||
if (!isServer) {
|
||||
try {
|
||||
const opts = {};
|
||||
Object.defineProperty(opts, 'passive', {
|
||||
// eslint-disable-next-line getter-return
|
||||
get() {
|
||||
/* istanbul ignore next */
|
||||
supportsPassive = true;
|
||||
}
|
||||
});
|
||||
window.addEventListener('test-passive', null as any, opts);
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* eslint-disable no-self-compare */
|
||||
|
||||
export function isNumber(value: string): boolean {
|
||||
return /^\d+(\.\d+)?$/.test(value);
|
||||
}
|
||||
@ -9,5 +7,6 @@ export function isNaN(value: any): boolean {
|
||||
return Number.isNaN(value);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-self-compare
|
||||
return value !== value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user