Skip to content

Syntax errors in typescript file? #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
christophfriedrich opened this issue Apr 11, 2025 · 2 comments
Open

Syntax errors in typescript file? #70

christophfriedrich opened this issue Apr 11, 2025 · 2 comments
Labels
question Further information is requested typescript
Milestone

Comments

@christophfriedrich
Copy link
Collaborator

When opening openeo.d.ts in VS Code, it displays me "482 problems in this file". I think most (if not all) of them stem from a missing . when specifying types for object keys/values with object<x,y>, because everything is fine until here:

/**
* @protected
* @type {object.<string, string>}
*/
protected apiToClientNames: object<string, string>;
/**
* @protected
* @type {object.<string, string>}
*/
protected clientToApiNames: object<string, string>;

The JSDoc has the . but the actual code doesn't. Do they share the same syntax rules?

I'd be happy to go through the file and fix this all over. Just: Where is this file actually used so that I can test the changes?

@christophfriedrich christophfriedrich added typescript question Further information is requested labels Apr 11, 2025
@m-mohr
Copy link
Member

m-mohr commented Apr 11, 2025

The TS generation is done by the typescript compiler pretty much, the checks might be done by JSDoc and it seem different rules apply. So it probably depends on the installed VS Code extension.

v3.0.0 we could probably implement in typescript to get rid of the issues, but for now it's not a priority as long as TS users get the typing, which I never heard complaints about yet so I assume it works.

@m-mohr m-mohr added this to the 3.0.0 milestone Apr 11, 2025
@christophfriedrich
Copy link
Collaborator Author

Hm okay. I tried a search&replace and indeed that resolved all the 'problems'.

However with some quick googling I couldn't find documentation for neither variant (not with nor without the dot), and all StackOverflow examples were using totally different syntax, so I ended up trying asking Copilot -- here's what it said:

Image

I wouldn't take that as authoritative, but will leave the info here for someone to pick up if this should become a more relevant issue at some point.

@christophfriedrich christophfriedrich changed the title Syntax errors in typescript file Syntax errors in typescript file? Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested typescript
Projects
None yet
Development

No branches or pull requests

2 participants