Skip to content

Commit 36addf5

Browse files
committed
chore: upgrade depencencies, eslint auto fix
1 parent 21db34b commit 36addf5

File tree

10 files changed

+40
-14798
lines changed

10 files changed

+40
-14798
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'/': { title: name, description },
99
},
1010
head: [
11-
['link', { rel: 'icon', href: `/logo.png` }],
11+
['link', { rel: 'icon', href: '/logo.png' }],
1212
],
1313
evergreen: true,
1414
serviceWorker: true,

package-lock.json

Lines changed: 0 additions & 14758 deletions
This file was deleted.

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,41 +67,41 @@
6767
"koa-compose": "^4.1.0"
6868
},
6969
"devDependencies": {
70-
"@babel/core": "^7.5.5",
70+
"@babel/core": "^7.6.0",
7171
"@babel/plugin-external-helpers": "^7.2.0",
72-
"@babel/plugin-proposal-decorators": "^7.4.4",
72+
"@babel/plugin-proposal-decorators": "^7.6.0",
7373
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
74-
"@babel/preset-env": "^7.5.5",
74+
"@babel/preset-env": "^7.6.0",
7575
"@commitlint/cli": "^8.1.0",
7676
"@commitlint/config-conventional": "^8.1.0",
77-
"@types/jest": "^24.0.17",
77+
"@types/jest": "^24.0.18",
7878
"axios-mock-adapter": "^1.17.0",
7979
"babel-core": "^7.0.0-bridge.0",
80-
"babel-eslint": "^10.0.2",
81-
"babel-jest": "^24.8.0",
80+
"babel-eslint": "^10.0.3",
81+
"babel-jest": "^24.9.0",
8282
"codecov": "^3.5.0",
83-
"cross-env": "^5.2.0",
84-
"eslint": "^6.1.0",
85-
"eslint-config-standard": "^13.0.1",
83+
"cross-env": "^5.2.1",
84+
"eslint": "^6.3.0",
85+
"eslint-config-standard": "^14.1.0",
8686
"eslint-plugin-import": "^2.18.2",
87-
"eslint-plugin-node": "^9.1.0",
87+
"eslint-plugin-node": "^10.0.0",
8888
"eslint-plugin-promise": "^4.2.1",
89-
"eslint-plugin-standard": "^4.0.0",
90-
"gh-pages": "^2.1.0",
91-
"husky": "^3.0.2",
92-
"jest": "^24.8.0",
93-
"lint-staged": "^9.2.1",
94-
"rimraf": "^2.6.3",
95-
"rollup": "^1.19.4",
89+
"eslint-plugin-standard": "^4.0.1",
90+
"gh-pages": "^2.1.1",
91+
"husky": "^3.0.5",
92+
"jest": "^24.9.0",
93+
"lint-staged": "^9.2.5",
94+
"rimraf": "^3.0.0",
95+
"rollup": "^1.21.2",
9696
"rollup-plugin-babel": "^4.3.3",
97-
"rollup-plugin-commonjs": "^10.0.2",
97+
"rollup-plugin-commonjs": "^10.1.0",
9898
"rollup-plugin-eslint": "^7.0.0",
9999
"rollup-plugin-json": "^4.0.0",
100100
"rollup-plugin-node-resolve": "^5.2.0",
101101
"rollup-plugin-replace": "^2.2.0",
102-
"rollup-plugin-uglify": "^6.0.2",
103-
"typescript": "^3.5.3",
104-
"vuepress": "^1.0.3"
102+
"rollup-plugin-uglify": "^6.0.3",
103+
"typescript": "^3.6.3",
104+
"vuepress": "^1.0.4"
105105
},
106106
"repository": {
107107
"type": "git",

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import nodeResolve from 'rollup-plugin-node-resolve'
88

99
import pkg from './package.json'
1010

11-
const input = `src/index.js`
11+
const input = 'src/index.js'
1212
const banner = `/* ${pkg.name} version ${pkg.version} */`
1313

1414
const output = {

src/adapters/axios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const getAxiosPromise = ({
2121

2222
logger.log(`Req Url: ${url}`)
2323
if (data && (Object.keys(data).length || isFD)) {
24-
logger.log(`Req Data:`, data)
24+
logger.log('Req Data:', data)
2525
}
2626

2727
transformRequest = isFD ? null : transformRequest

src/adapters/wx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const getWxPromise = ({
2323
} else {
2424
logger.log(`Req Url: ${url}`)
2525
if (data && Object.keys(data).length) {
26-
logger.log(`Req Data:`, data)
26+
logger.log('Req Data:', data)
2727
}
2828
}
2929

src/constants.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const DEFAULT_HEADER = { 'Content-Type': 'application/x-www-form-urlencoded' }
99

1010
// 错误信息
1111
const ERROR_STRINGS = {
12-
noData: `no data!`,
13-
argsType: `the first parameter must be an object!`,
14-
middleware: `middleware must be a function!`,
12+
noData: 'no data!',
13+
argsType: 'the first parameter must be an object!',
14+
middleware: 'middleware must be a function!',
1515

1616
reqTypeFn: (reqType) => `invalid reqType: "${reqType}", ` +
1717
`support these reqTypes: ["${VALID_REQ_TYPES.join('", "')}"].`,

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ class TuaApi {
235235
}) {
236236
if (type) {
237237
logger.warn(
238-
`[type] will be deprecated, please use [method] instead!\n` +
239-
`[type] 属性将被废弃, 请用 [method] 替代!`
238+
'[type] will be deprecated, please use [method] instead!\n' +
239+
'[type] 属性将被废弃, 请用 [method] 替代!'
240240
)
241241
}
242242

src/utils/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const logByType = (type) => (...out) => {
88
if (env === 'test' || env === 'production') return
99

1010
/* istanbul ignore next */
11-
console[type](`[TUA-API]:`, ...out)
11+
console[type]('[TUA-API]:', ...out)
1212
}
1313

1414
export const logger = {

test/__tests__/axios.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ const params = {
1111
param2: 'young',
1212
}
1313

14-
const reqAPUrl = `http://example-base.com/fake-post/array-params`
15-
const reqOPUrl = `http://example-base.com/fake-post/object-params`
16-
const reqGOPUrl = `http://example-base.com/fake-get/object-params`
17-
const reqOHUrl = `http://example-test.com/fake-post/own-host`
18-
const reqTAUrl = `http://example-base.com/fake-get/req-type-axios?asyncCp=asyncCp`
19-
const reqEAPUrl = `http://example-base.com/fake-post/empty-array-params`
20-
const reqMFDUrl = `http://example-base.com/fake-get/mock-function-data`
14+
const reqAPUrl = 'http://example-base.com/fake-post/array-params'
15+
const reqOPUrl = 'http://example-base.com/fake-post/object-params'
16+
const reqGOPUrl = 'http://example-base.com/fake-get/object-params'
17+
const reqOHUrl = 'http://example-test.com/fake-post/own-host'
18+
const reqTAUrl = 'http://example-base.com/fake-get/req-type-axios?asyncCp=asyncCp'
19+
const reqEAPUrl = 'http://example-base.com/fake-post/empty-array-params'
20+
const reqMFDUrl = 'http://example-base.com/fake-get/mock-function-data'
2121

2222
describe('middleware', () => {
2323
test('change host before request', async () => {
2424
const data = { code: 0, data: 'custom host' }
25-
const reqHAPUrl = `http://custom-host.com/fake-post/array-params`
25+
const reqHAPUrl = 'http://custom-host.com/fake-post/array-params'
2626
mock.onPost(reqHAPUrl).reply(200, data)
2727
const resData = await fakePostApi.hap()
2828

@@ -86,7 +86,7 @@ describe('fake get requests', () => {
8686

8787
test('required param', async () => {
8888
const data = [0, 'array data']
89-
mock.onGet(reqGOPUrl + `?param1=1217&param2=steve&param3=young`).reply(200, data)
89+
mock.onGet(reqGOPUrl + '?param1=1217&param2=steve&param3=young').reply(200, data)
9090
const resData = await fakeGetApi.op({ param3: 'young' }, { reqType: 'axios' })
9191

9292
expect(mock.history.get[0].params).toBe(undefined)

0 commit comments

Comments
 (0)