提交 e55bbfe7 编写于 作者: D dolymood

refactor(lint): fix lint errors

上级 63f524f9
export const ease = {
// easeOutQuint
// easeOutQuint
swipe: {
style: 'cubic-bezier(0.23, 1, 0.32, 1)',
fn: function (t) {
return 1 + (--t * t * t * t * t)
}
},
// easeOutQuard
// easeOutQuard
swipeBounce: {
style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
fn: function (t) {
return t * (2 - t)
}
},
// easeOutQuart
// easeOutQuart
bounce: {
style: 'cubic-bezier(0.165, 0.84, 0.44, 1)',
fn: function (t) {
......
......@@ -3127,8 +3127,7 @@
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz",
"integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==",
"dev": true,
"optional": true
"dev": true
},
"cssstyle": {
"version": "0.2.37",
......@@ -5243,8 +5242,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
......@@ -5268,15 +5266,13 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -5293,22 +5289,19 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -5439,8 +5432,7 @@
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
......@@ -5454,7 +5446,6 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -5471,7 +5462,6 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -5480,15 +5470,13 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz",
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
......@@ -5509,7 +5497,6 @@
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -5598,8 +5585,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
......@@ -5613,7 +5599,6 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -5709,8 +5694,7 @@
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -5752,7 +5736,6 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -5774,7 +5757,6 @@
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -5823,15 +5805,13 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
"dev": true,
"optional": true
"dev": true
}
}
},
......@@ -8501,7 +8481,7 @@
},
"onetime": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
"dev": true
},
......
export const warn = function (msg, componentName) {
/* istanbul ignore if */
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
const component = componentName ? `<${componentName}> ` : ''
console.error(`[Cube warn]: ${component}${msg}`)
......
......@@ -158,7 +158,7 @@ function processComponentName(Component, { prefix = '', firstUpperCase = false }
const name = Component.name
const pureName = name.replace(/^cube-/i, '')
let camelizeName = `${camelize(`${prefix}${pureName}`)}`
/* istanbul ignore if */
/* istanbul ignore if */
if (firstUpperCase) {
camelizeName = camelizeName.charAt(0).toUpperCase() + camelizeName.slice(1)
}
......@@ -170,7 +170,7 @@ function parsePath (obj, path = '') {
let result = obj
for (let i = 0; i < segments.length; i++) {
const key = segments[i]
/* istanbul ignore if */
/* istanbul ignore if */
if (isUndef(result[key])) {
result = ''
break
......
......@@ -16,8 +16,10 @@ function formatType(type, format, value, regExpAttributes) {
if (new RegExp(regExpMap[type], regExpAttributes).test(format)) {
const replaceStr = type === 'year'
? value.toString().substr(4 - RegExp.$1.length)
: (RegExp.$1.length === 1) ? value : pad(value)
? value.toString().substr(4 - RegExp.$1.length)
: (RegExp.$1.length === 1)
? value
: pad(value)
format = format.replace(RegExp.$1, replaceStr)
}
......
......@@ -133,18 +133,18 @@
},
minArray() {
return this.min instanceof Date
? dateToArray(this.min).slice(this.startIndex, this.startIndex + this.columnCount)
: this.min
? dateToArray(this.min).slice(this.startIndex, this.startIndex + this.columnCount)
: this.min
},
maxArray() {
return this.max instanceof Date
? dateToArray(this.max).slice(this.startIndex, this.startIndex + this.columnCount)
: this.max
? dateToArray(this.max).slice(this.startIndex, this.startIndex + this.columnCount)
: this.max
},
valueArray() {
return this.value instanceof Date
? dateToArray(this.value).slice(this.startIndex, this.startIndex + this.columnCount)
: this.value
? dateToArray(this.value).slice(this.startIndex, this.startIndex + this.columnCount)
: this.value
},
data() {
const data = []
......
......@@ -274,15 +274,17 @@
// calculate hourIndex
const hour = valueDate.getHours()
const beginHour = dayIndex === 0
? this.showNow ? this.minTime.getHours() - 1 : this.minTime.getHours()
: 0
? this.showNow
? this.minTime.getHours() - 1
: this.minTime.getHours()
: 0
const hourIndex = hour - beginHour
// calculate minuteIndex
const minute = this.minuteStepRule(valueDate.getMinutes() / this.minuteStepNumber)
const beginMinute = !dayIndex && (this.showNow ? hourIndex === 1 : !hourIndex)
? this.minuteStepRule(this.minTime.getMinutes() / this.minuteStepNumber)
: 0
? this.minuteStepRule(this.minTime.getMinutes() / this.minuteStepNumber)
: 0
const minuteIndex = minute - beginMinute
this.selectedIndex = [dayIndex, hourIndex, minuteIndex]
......
......@@ -214,10 +214,10 @@
this.validating = false
results.forEach(({ key, valid, ret }) => {
const msg = this.messages[key]
? isFunc(this.messages[key])
? this.messages[key](ret, valid)
: this.messages[key]
: this.findMessage(key, configRules[key], configRules.type, model)
? isFunc(this.messages[key])
? this.messages[key](ret, valid)
: this.messages[key]
: this.findMessage(key, configRules[key], configRules.type, model)
if (isValid && !valid) {
isValid = false
this.msg = msg
......
......@@ -209,7 +209,7 @@ describe('ImagePreview', () => {
// but becomes false in the same tick in safari
vm.$nextTick(() => {
expect(itemScroll.enabled)
.to.be.false
.to.be.false
})
expect(slideScroll.enabled)
.to.be.true
......
......@@ -32,7 +32,7 @@ describe('Locale', () => {
Locale.use('en-US', enUSMessages)
vm.$nextTick(() => {
expect(vm._cancelTxt)
.to.equal('Cancel')
.to.equal('Cancel')
done()
})
})
......
......@@ -153,9 +153,13 @@ function createRadioGroup(horizontal = false) {
function createUserDefaltSlotRadioGroup(vModelGroup = true) {
const vm = createVue({
template: `
<cube-radio-group ${
vModelGroup ? `v-model="selected"` : ''
} :options="options" class="my-radio" position="right" :horizontal="true">
<cube-radio-group
${vModelGroup ? `v-model="selected"` : ''}
:options="options"
class="my-radio"
position="right"
:horizontal="true"
>
<cube-radio
v-for="(option, idx) in options"
:key="idx"
......
......@@ -19,7 +19,7 @@ describe('RecycleList', () => {
it('requires onFetch function to return a Promise', () => {
vm = createRecycleList()
expect(vm.onFetch() instanceof window.Promise)
.to.equal(true)
.to.equal(true)
})
it('render correct count data', (done) => {
vm = createRecycleList(true)
......
......@@ -133,7 +133,7 @@ describe('Toast', () => {
expect(ins.$el.className)
.to.include('my-toast')
expect(ins.$el.querySelector('.cube-toast-tip').textContent)
.to.equal('toast api content')
.to.equal('toast api content')
ins.remove()
expect(ins.$el.parentElement)
.to.be.null
......
......@@ -46,7 +46,7 @@ describe('Validator', () => {
const msgEl = el.querySelector('.cube-validator-msg-def')
setTimeout(() => {
expect(el.className)
.to.include('cube-validator_invalid')
.to.include('cube-validator_invalid')
expect(msgEl.textContent)
.to.equal('必填')
expect(vm.result.asyncRule.valid)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册