【发布时间】:2019-05-20 23:46:06
【问题描述】:
运行 npm run lint:critical 后,返回一个错误,即:
61:26 error Unexpected 'this' no-invalid-this
该功能要求用户进行位置检测权限:
_askForPermission = async () => {
const { dispatch } = this.props;
try {
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
dispatch($isLocationActive()).catch((error) => dispatch(Activity.$toast('failure', error.message)));
}
} catch (err) {
console.warn(err);
}
};
行 const { dispatch } = this.props;导致错误,我需要修复,因为它导致管道 CI/CD 失败
【问题讨论】:
标签: react-native continuous-integration eslint lint npm-scripts