I'm using firebase cloud functions with typescript. Is it usual that I have to add JSDoc comments and can't use any with typescript and firebase cloud functions? It seems very strict when deploying. The build command seemed to work fine. Also in an emulator environment (npm run serve), it also worked.
Lint is not showing them as errors in vs code. And my autosave doesn't fix most of the line length issues as they are comments.
It's weird as some of the lines have been suggested by firebase themself and it seemed like they didn't get an error using the same code.
I use $ firebase deploy --only functions and then get:
I got a lot of these:
15:1 error Expected indentation of 6 spaces but found 4 indent
I already fixed most of them but it doesn't seem usual
=== Deploying to ''...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> lint
> eslint --ext .js,.ts .
/Users/user/Documents/firebase-host/functions/src/index.ts
14:1 error This line has a length of 81. Maximum allowed is 80 max-len
25:1 error Missing JSDoc comment require-jsdoc
27:50 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
50:1 error This line has a length of 81. Maximum allowed is 80 max-len
✖ 4 problems (3 errors, 1 warning)
Error: functions predeploy error: Command terminated with non-zero exit code1
Some of the error code where it wants me to set a JSDoc:
async function grandSuperAdminRole(email: string): Promise<void> {
const user = await admin.auth().getUserByEmail(email);
if (user.customClaims && (user.customClaims as any).superAdmin === true) {
return;
}
return admin.auth().setCustomUserClaims(user.uid, {
superAdmin: true,
});
}