style: update es-lint check

This commit is contained in:
zazzaz 2020-07-28 13:44:22 +08:00 committed by jeremywu
parent e1f61af8f9
commit 2c80f15a81
6 changed files with 13 additions and 13 deletions

View File

@ -9,7 +9,7 @@
"storybook": "start-storybook",
"bootstrap": "yarn && npx lerna bootstrap",
"build": "yarn bootstrap && yarn build-storybook",
"lint": "eslint . --ext .vue,.js,.ts"
"lint": "eslint ./packages --ext .vue,.js,.ts"
},
"peerDependencies": {
"vue": "^3.0.0-rc.1"

View File

@ -1,4 +1,4 @@
import {mount} from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import Badge from '../src/index.vue'
const AXIOM = 'Rem is the best girl'
@ -6,32 +6,32 @@ const AXIOM = 'Rem is the best girl'
describe('Badge', () => {
test('has value', () => {
const wrapper = mount(Badge, {
props: {value: 80},
props: { value: 80 },
})
expect(wrapper.vm.content).toEqual(80)
})
test('is fixed', () => {
const wrapper = mount(Badge, {
slots: {default: AXIOM},
slots: { default: AXIOM },
})
expect(wrapper.find('.el-badge__content.is-fixed')).toBeDefined()
})
test('is dot', () => {
const wrapper = mount(Badge, {
props: {isDot: true},
slots: {default: AXIOM},
props: { isDot: true },
slots: { default: AXIOM },
})
expect(wrapper.find('.el-badge__content.is-fixed')).toBeDefined()
})
test('max', async () => {
const wrapper = mount(Badge, {
props: {max: 100, value: 200},
props: { max: 100, value: 200 },
})
expect(wrapper.vm.content).toEqual('100+')
await wrapper.setProps({value: 80})
await wrapper.setProps({ value: 80 })
expect(wrapper.vm.content).toEqual(80)
})
})

View File

@ -1,4 +1,4 @@
export { default as BasicUsage} from './basic.vue'
export { default as BasicUsage } from './basic.vue'
export default {
title: 'Badge',

View File

@ -20,7 +20,7 @@
</template>
<script lang="ts">
import {computed} from 'vue'
import { computed } from 'vue'
interface IBadgeProps {
value: string | number;
@ -59,7 +59,7 @@ export default {
if (props.isDot) {
return
}
const {value, max} = props
const { value, max } = props
if (typeof value === 'number' && typeof max === 'number') {
return max < value ? `${max}+` : value
}

View File

@ -1,4 +1,4 @@
import {mount} from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import Tag from '../src/index.vue'
const AXIOM = 'Rem is the best girl'

View File

@ -1,4 +1,4 @@
export { default as BasicUsage} from './basic.vue'
export { default as BasicUsage } from './basic.vue'
export default {
title: 'Tag',