Skip to content

Commit

Permalink
chore: 修复 eslint 错误
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Sep 2, 2020
1 parent a3ebe68 commit cab239c
Show file tree
Hide file tree
Showing 9 changed files with 4,812 additions and 19,304 deletions.
2 changes: 1 addition & 1 deletion packages/taro-cli/src/rn/transformJS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export function parseJSCode ({ code, filePath, isEntryFile, projectConfig }) {
},
CallExpression (astPath) {
const node = astPath.node
const callee = node.callee as t.Identifier
const callee = node.callee as any
const calleeName = callee.name
const parentPath = astPath.parentPath

Expand Down
8,939 changes: 2,094 additions & 6,845 deletions packages/taro-cli/yarn.lock

Large diffs are not rendered by default.

1,642 changes: 871 additions & 771 deletions packages/taro-helper/yarn.lock

Large diffs are not rendered by default.

9,123 changes: 1,778 additions & 7,345 deletions packages/taro-mini-runner/yarn.lock

Large diffs are not rendered by default.

2,389 changes: 27 additions & 2,362 deletions packages/taro-service/yarn.lock

Large diffs are not rendered by default.

1,991 changes: 26 additions & 1,965 deletions packages/taro-webpack-runner/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/taro-with-weapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"author": "yuche",
"license": "MIT",
"dependencies": {
"@tarojs/taro": "3.0.6",
"@tarojs/runtime": "3.0.6",
"@tarojs/taro": "3.0.8",
"@tarojs/runtime": "3.0.8",
"lodash": "^4.17.11"
}
}
14 changes: 7 additions & 7 deletions packages/taro-with-weapp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function isFunction (o): o is Function {
}

export default function withWeapp (weappConf: WxOptions) {

return (ConnectComponent: ComponentClass) => {
class BaseComponent<P = {}, S = {}> extends ConnectComponent {
private _observeProps: ObserverProperties[] = []
Expand All @@ -76,7 +75,7 @@ export default function withWeapp (weappConf: WxOptions) {
defineGetter(this, 'properties', 'props')
}

private initProps (props: Object) {
private initProps (props: any) {
for (const propKey in props) {
if (props.hasOwnProperty(propKey)) {
const propValue = props[propKey]
Expand All @@ -99,15 +98,16 @@ export default function withWeapp (weappConf: WxOptions) {
switch (confKey) {
case 'externalClasses':
break
case 'data':
case 'data': {
this.state = confValue
const keys = Object.keys(this.state)
let i = keys.length
while (i--) {
const key = keys[i]
proxy(this, `state`, key)
proxy(this, 'state', key)
}
break
}
case 'properties':
this.initProps(confValue)
break
Expand Down Expand Up @@ -189,7 +189,7 @@ export default function withWeapp (weappConf: WxOptions) {
page.selectComponent(...args)
} else {
// tslint:disable-next-line: no-console
console.error(`page 下没有 selectComponent 方法`)
console.error('page 下没有 selectComponent 方法')
}
}

Expand All @@ -199,7 +199,7 @@ export default function withWeapp (weappConf: WxOptions) {
page.getRelationNodes(...args)
} else {
// tslint:disable-next-line: no-console
console.error(`page 下没有 getRelationNodes 方法`)
console.error('page 下没有 getRelationNodes 方法')
}
}

Expand Down Expand Up @@ -320,7 +320,7 @@ export default function withWeapp (weappConf: WxOptions) {
}
}

const props = weappConf['properties']
const props = weappConf.properties

if (props) {
for (const propKey in props) {
Expand Down
12 changes: 6 additions & 6 deletions packages/taro-with-weapp/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export function safeGet (obj, propsArg, defaultValue?) {
if (Array.isArray(propsArg)) {
props = propsArg.slice(0)
}
if (typeof propsArg == 'string') {
if (typeof propsArg === 'string') {
props = propsArg.split('.')
}
if (typeof propsArg == 'symbol') {
if (typeof propsArg === 'symbol') {
props = [propsArg]
}
if (!Array.isArray(props)) {
Expand All @@ -70,10 +70,10 @@ export function safeGet (obj, propsArg, defaultValue?) {
}

export function safeSet (obj, props, value) {
if (typeof props == 'string') {
if (typeof props === 'string') {
props = props.split('.')
}
if (typeof props == 'symbol') {
if (typeof props === 'symbol') {
props = [props]
}
const lastProp = props.pop()
Expand All @@ -82,11 +82,11 @@ export function safeSet (obj, props, value) {
}
let thisProp
while ((thisProp = props.shift())) {
if (typeof obj[thisProp] == 'undefined') {
if (typeof obj[thisProp] === 'undefined') {
obj[thisProp] = {}
}
obj = obj[thisProp]
if (!obj || typeof obj != 'object') {
if (!obj || typeof obj !== 'object') {
return false
}
}
Expand Down

0 comments on commit cab239c

Please sign in to comment.