Skip to content

Commit 2872a20

Browse files
authored
refactor: add max-len rule (#720)
1 parent 51dcc9e commit 2872a20

File tree

128 files changed

+3096
-1767
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+3096
-1767
lines changed

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
"plugin:vue-libs/recommended",
1313
"plugin:flowtype/recommended"
1414
],
15-
rules: {
15+
"rules": {
1616
"no-debugger": 2,
17-
"no-proto": 0
17+
"no-proto": 0,
18+
"max-len": 2
1819
}
1920
}

docs/api/options.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ const wrapper = shallowMount(Component, {
8282
foo: '<p slot-scope="props">{{props.index}},{{props.text}}</p>'
8383
}
8484
})
85-
expect(wrapper.find('#fooWrapper').html()).toBe('<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>')
85+
expect(wrapper.find('#fooWrapper').html()).toBe(
86+
`<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>`
87+
)
8688
```
8789

8890
## stubs

docs/api/wrapper-array/filter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ import { shallowMount } from '@vue/test-utils'
1818
import Foo from './Foo.vue'
1919

2020
const wrapper = shallowMount(Foo)
21-
const filteredDivArray = wrapper.findAll('div').filter(w => !w.hasClass('filtered'))
21+
const filteredDivArray = wrapper.findAll('div')
22+
.filter(w => !w.hasClass('filtered'))
2223
```

docs/guides/common-tips.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Vue Test Utils allows you to mount a component without rendering its child compo
2323
```js
2424
import { shallowMount } from '@vue/test-utils'
2525

26-
const wrapper = shallowMount(Component) // returns a Wrapper containing a mounted Component instance
26+
const wrapper = shallowMount(Component)
2727
wrapper.vm // the mounted Vue instance
2828
```
2929

@@ -125,7 +125,9 @@ const $route = {
125125

126126
mount(Component, {
127127
mocks: {
128-
$route // adds the mocked `$route` object to the Vue instance before mounting component
128+
// adds mocked `$route` object to the Vue instance
129+
// before mounting component
130+
$route
129131
}
130132
})
131133
```

docs/guides/using-with-vuex.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ describe('Actions.vue', () => {
6969
})
7070
})
7171

72-
it('calls store action "actionInput" when input value is "input" and an "input" event is fired', () => {
72+
it('dispatches "actionInput" when input event value is "input"', () => {
7373
const wrapper = shallowMount(Actions, { store, localVue })
7474
const input = wrapper.find('input')
7575
input.element.value = 'input'
7676
input.trigger('input')
7777
expect(actions.actionInput).toHaveBeenCalled()
7878
})
7979

80-
it('does not call store action "actionInput" when input value is not "input" and an "input" event is fired', () => {
80+
it('does not dispatch "actionInput" when event value is not "input"', () => {
8181
const wrapper = shallowMount(Actions, { store, localVue })
8282
const input = wrapper.find('input')
8383
input.element.value = 'not input'

docs/ja/api/options.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ const wrapper = shallowMount(Component, {
7777
foo: '<p slot-scope="props">{{props.index}},{{props.text}}</p>'
7878
}
7979
})
80-
expect(wrapper.find('#fooWrapper').html()).toBe('<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>')
80+
expect(wrapper.find('#fooWrapper').html()).toBe(
81+
`<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>`
82+
)
8183
```
8284

8385
## stubs

docs/ja/api/wrapper-array/filter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ import { shallowMount } from '@vue/test-utils'
1818
import Foo from './Foo.vue'
1919

2020
const wrapper = shallowMount(Foo)
21-
const filteredDivArray = wrapper.findAll('div').filter(w => !w.hasClass('filtered'))
21+
const filteredDivArray = wrapper.findAll('div')
22+
.filter(w => !w.hasClass('filtered'))
2223
```

docs/ja/guides/using-with-vuex.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ describe('Actions.vue', () => {
6868
})
6969
})
7070

71-
it('calls store action actionInput when input value is input and an input event is fired', () => {
71+
it('dispatches "actionInput" when input event value is "input"', () => {
7272
const wrapper = shallowMount(Actions, { store, localVue })
7373
const input = wrapper.find('input')
7474
input.element.value = 'input'
7575
input.trigger('input')
7676
expect(actions.actionInput).toHaveBeenCalled()
7777
})
7878

79-
it('does not call store action actionInput when input value is not input and an input event is fired', () => {
79+
it('does not dispatch "actionInput" when event value is not "input"', () => {
8080
const wrapper = shallowMount(Actions, { store, localVue })
8181
const input = wrapper.find('input')
8282
input.element.value = 'not input'

docs/zh/api/options.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ const wrapper = shallowMount(Component, {
8282
foo: '<p slot-scope="props">{{props.index}},{{props.text}}</p>'
8383
}
8484
})
85-
expect(wrapper.find('#fooWrapper').html()).toBe('<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>')
85+
expect(wrapper.find('#fooWrapper').html()).toBe(
86+
`<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>`
87+
)
8688
```
8789

8890
## stubs

docs/zh/api/wrapper-array/filter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ import { shallowMount } from '@vue/test-utils'
1818
import Foo from './Foo.vue'
1919

2020
const wrapper = shallowMount(Foo)
21-
const filteredDivArray = wrapper.findAll('div').filter(w => !w.hasClass('filtered'))
21+
const filteredDivArray = wrapper.findAll('div')
22+
.filter(w => !w.hasClass('filtered'))
2223
```

0 commit comments

Comments
 (0)