Skip to content

Commit b26cc86

Browse files
author
sqrtthree
committed
chore: Remove linter warnings
1 parent 1ac2b2a commit b26cc86

File tree

18 files changed

+1014
-840
lines changed

18 files changed

+1014
-840
lines changed

components/Block/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default {
3131
const examples = this.$refs['cont-box'].querySelectorAll('.examples')
3232
3333
if (examples) {
34-
examples.forEach(item => {
34+
examples.forEach((item) => {
3535
this.$refs['example-box'].appendChild(item)
3636
})
3737
}

components/CURL/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default {
8989
this.openLoading()
9090
9191
request(options)
92-
.then(data => {
92+
.then((data) => {
9393
this.closeLoading()
9494
9595
this.$message.success(
@@ -103,7 +103,7 @@ export default {
103103
console.info('<=', data.status, data.statusText)
104104
console.info('<=', 'data:', data.data)
105105
})
106-
.catch(err => {
106+
.catch((err) => {
107107
this.closeLoading()
108108
109109
this.$message.error(`${err.status} ${err.message}`)

components/Message/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const getMessageContainerElement = () => {
1717
return el
1818
}
1919

20-
const Message = options => {
20+
const Message = (options) => {
2121
if (options === undefined) return
2222

2323
const opts =
@@ -36,8 +36,8 @@ const Message = options => {
3636
return vm
3737
}
3838

39-
typeList.forEach(type => {
40-
Message[type] = options => {
39+
typeList.forEach((type) => {
40+
Message[type] = (options) => {
4141
const opts = typeof options === 'string' ? { message: options } : options
4242

4343
opts.type = type

components/NetworkPanel/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default {
114114
computed: {
115115
headerTexts() {
116116
return Object.keys(this.headers)
117-
.map(item => `${item}: ${this.headers[item]}`)
117+
.map((item) => `${item}: ${this.headers[item]}`)
118118
.join('\n')
119119
},
120120
},
@@ -127,7 +127,7 @@ export default {
127127
} else {
128128
document.body.className = document.body.className
129129
.split(' ')
130-
.filter(item => item !== 'global-style__body__scroll-disabled')
130+
.filter((item) => item !== 'global-style__body__scroll-disabled')
131131
.join(' ')
132132
}
133133
},

components/Section/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ export default {
5656
const originalWidth = sectionElement.offsetWidth
5757
5858
sectionElement.style.width = `${clientWidth}px`
59-
sectionElement.style.marginLeft = `${-(clientWidth - originalWidth) /
60-
2}px`
59+
sectionElement.style.marginLeft = `${
60+
-(clientWidth - originalWidth) / 2
61+
}px`
6162
},
6263
},
6364
}

components/global.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const components = [
2323
Search,
2424
]
2525

26-
const install = Vue => {
27-
components.forEach(component => {
26+
const install = (Vue) => {
27+
components.forEach((component) => {
2828
Vue.component(component.name, component)
2929
})
3030

helpers/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const hasValue = target => target !== undefined && target !== null
1+
const hasValue = (target) => target !== undefined && target !== null
22

33
const getWithPath = (object, path) => {
44
const p = path.split('.')

helpers/curl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isURL, isJSON, isQueryString } from './is'
22

3-
const parseField = s => {
3+
const parseField = (s) => {
44
return s.split(/: (.+)/)
55
}
66

@@ -13,7 +13,7 @@ export default function curl(cmd) {
1313

1414
const args = cmd
1515
.match(/"[^"]+"|'[^']+'|\S+/g)
16-
.filter(item => item.trim() !== '\\')
16+
.filter((item) => item.trim() !== '\\')
1717

1818
const result = {
1919
method: 'GET',
@@ -22,7 +22,7 @@ export default function curl(cmd) {
2222

2323
let state = ''
2424

25-
args.forEach(function(arg) {
25+
args.forEach(function (arg) {
2626
switch (true) {
2727
case isURL(arg):
2828
result.url = arg

helpers/locales.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exports.defaultLocales = {
2323
exports.getDefaultLocales = ($locale, path) => {
2424
let value = exports.defaultLocales[$locale]
2525

26-
path.split('.').forEach(item => {
26+
path.split('.').forEach((item) => {
2727
value = value[item]
2828
})
2929

helpers/path.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function normalize(path) {
99

1010
let p = path
1111
.split('/')
12-
.filter(item => !!item)
12+
.filter((item) => !!item)
1313
.join('/')
1414

1515
if (p && trailingSlash) {
@@ -36,9 +36,7 @@ export function splitWithBasePath(path, base) {
3636
}
3737

3838
export function matchGroupNameFromPath(path, base) {
39-
return splitWithBasePath(path, base)
40-
.split('/')[0]
41-
.split('.')[0]
39+
return splitWithBasePath(path, base).split('/')[0].split('.')[0]
4240
}
4341

4442
export function matchFileName(path) {
@@ -52,7 +50,7 @@ export function matchFileName(path) {
5250
}
5351

5452
export function matchLocalePathFromPath(path, locales) {
55-
const localeList = Object.keys(locales).filter(item => item !== '/') // omit '/'
53+
const localeList = Object.keys(locales).filter((item) => item !== '/') // omit '/'
5654

5755
for (let i = 0, len = localeList.length; i < len; i++) {
5856
const localePath = localeList[i]

0 commit comments

Comments
 (0)