我有以下代码
async register(user: User){
try {
const result = await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password);
this.userRegister();
}
catch {
this.showAlert();
}
}
但是,当我运行命令ionic build --release --prod
时,终端告诉我以下消息
tslint: C:/Users/Mike/Desktop/GuiaCorretor/src/pages/register/register.ts, line: 39
'result' is declared but its value is never read.
try {
const result = await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password);
this.userRegister();
我认为它抱怨你没有对你的结果变量做任何事情。试着改为做await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password);
。听起来像是一个linter错误而不是编译器错误
要禁用该规则(来自tslint
),您可以更新它: