You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the guide for creating a CF using TypeScript.
I suppose it's an official guide how to build CFs using TypeScript.
It uses gts for a project. And local .eslintrc.json refers to one in gts:
.eslintrc.json
{
"extends": "./node_modules/gts/"
}
The problem is that if we run gts lint or open the project in VSCode we'll see tons of errors.
And it's just in default freshly generated according an official guide project.
Particularly any CF project will have this line:
import type {HttpFunction} from '@google-cloud/functions-framework/build/src/functions';
and eslint complains about it:
"@google-cloud/functions-framework" is not published.
If we want to add typing for request/response we'll import import express from 'express'; which installed as a dev-dependency @types/express. Again it will cause a violation from eslint: "no-extraneous-import".
So I don't quite understand how it's suppose to work. We got a lint tool for free (gts/eslint) with some default config but it doesn't work even in empty project.
Can you please consider providing a working bootstrapping setup for TypeScript-based projects for CFs.
Thanks.
The text was updated successfully, but these errors were encountered:
Hi,
I followed the guide for creating a CF using TypeScript.
I suppose it's an official guide how to build CFs using TypeScript.
It uses gts for a project. And local
.eslintrc.json
refers to one in gts:.eslintrc.json
The problem is that if we run
gts lint
or open the project in VSCode we'll see tons of errors.And it's just in default freshly generated according an official guide project.
Particularly any CF project will have this line:
and eslint complains about it:
"@google-cloud/functions-framework" is not published.
If we want to add typing for request/response we'll import
import express from 'express';
which installed as a dev-dependency@types/express
. Again it will cause a violation from eslint: "no-extraneous-import".So I don't quite understand how it's suppose to work. We got a lint tool for free (gts/eslint) with some default config but it doesn't work even in empty project.
Can you please consider providing a working bootstrapping setup for TypeScript-based projects for CFs.
Thanks.
The text was updated successfully, but these errors were encountered: