[improvement] optimize eslint-disable (#4070)

This commit is contained in:
neverland 2019-08-08 20:01:41 +08:00 committed by GitHub
parent 5777762249
commit c74d90c561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 9 additions and 20 deletions

View File

@ -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 = [

View File

@ -1,4 +1,3 @@
/* eslint-disable camelcase */
import AddressEdit from '..';
import areaList from '../../area/demo/area.simple';
import { mount, later } from '../../../test/utils';

View File

@ -24,7 +24,6 @@
</template>
<script>
/* eslint-disable camelcase */
export default {
i18n: {
'zh-CN': {

View File

@ -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';

View File

@ -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';

View File

@ -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'
}
});

View File

@ -1,4 +1,3 @@
/* eslint-disable camelcase */
import Vue from 'vue';
import Popup from '../popup';
import Toast from '../toast';

View File

@ -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'
? '请上传'
: '请填写';

View File

@ -1,4 +1,3 @@
/* eslint-disable */
export default {
goods_id: '946755',
quota: 15,

View File

@ -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;
},

View File

@ -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]);
}
}

View File

@ -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) {}
}

View File

@ -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;
}