Skip to content

docs/WorkflowGuidelines.md: add rule about typeof#242

Open
webwarrior-ws wants to merge 2 commits intotarsgate:masterfrom
webwarrior-ws:code-style-typescript-typeof
Open

docs/WorkflowGuidelines.md: add rule about typeof#242
webwarrior-ws wants to merge 2 commits intotarsgate:masterfrom
webwarrior-ws:code-style-typescript-typeof

Conversation

@webwarrior-ws
Copy link
Copy Markdown
Contributor

Added a rule about typeof operator in TypeScript.

@knocte
Copy link
Copy Markdown
Contributor

knocte commented Apr 15, 2026

Please avoid using {} in the example; it's ugly code and we might create a new rule about that in the future.

@knocte
Copy link
Copy Markdown
Contributor

knocte commented Apr 15, 2026

And I also told you to add a rule about avoiding double assignments, just use an assignment per line for readability.

@webwarrior-ws
Copy link
Copy Markdown
Contributor Author

Please avoid using {} in the example; it's ugly code and we might create a new rule about that in the future.

But that is how you create an empty object/record in TypeScript.

Added a rule about typeof operator in TypeScript.
@webwarrior-ws webwarrior-ws force-pushed the code-style-typescript-typeof branch from 17670bc to f2c4c01 Compare April 15, 2026 13:23
@knocte
Copy link
Copy Markdown
Contributor

knocte commented Apr 15, 2026

But that is how you create an empty object/record in TypeScript.

I don't care, I don't want that in the examples.

@webwarrior-ws
Copy link
Copy Markdown
Contributor Author

But that is how you create an empty object/record in TypeScript.

I don't care, I don't want that in the examples.

Then the example wouldn't make much sense because we could just rely on type inference and not need typeof or explicit type definition.

@knocte
Copy link
Copy Markdown
Contributor

knocte commented Apr 16, 2026

Adapt the example to our needs! It's an example, it is not a real world scenario!!!

@webwarrior-ws
Copy link
Copy Markdown
Contributor Author

I changed the example. But as I've said, example doesn't make much sense. Because we can rely on type inference in this case and not specify type of the provider variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants