[tcgc] add language-specific linter rules for reserved words#4099
[tcgc] add language-specific linter rules for reserved words#4099iscai-msft wants to merge 6 commits intoAzure:mainfrom
Conversation
commit: |
|
All changed packages have been documented.
Show changes
|
packages/typespec-client-generator-core/src/rules/reserved-words/create-reserved-word-rule.ts
Outdated
Show resolved
Hide resolved
| import { createReservedWordRule } from "./create-reserved-word-rule.js"; | ||
| import { csharpReservedWords } from "./words.js"; | ||
|
|
||
| export const csharpReservedWordsRule = createReservedWordRule("csharp", "C#", csharpReservedWords); |
There was a problem hiding this comment.
do you think it really valuable to have this rule as 5 different one and for any new language we'll add we'll need a new one?
There was a problem hiding this comment.
if it is just for organization, would keeping the words next to the rule instead of everything in words not be slightlyg better?
There was a problem hiding this comment.
it would be so you could individually validate for each language, i.e. if you're trying to generate python, you wouldn't have to see which words fail for csharp. You're right though that this list can grow, and I'm thinking more that since most people generate all sdks at a time, it's ok for them to not be isolated, though I still think I prefer it that way.
There was a problem hiding this comment.
just thinking also what if the rule had some option instead(we don't support that today becuase there wasn't a need for it but we could probably add that easily to the compiler)
like
no-reserverd-words: [csharp, python, java]There was a problem hiding this comment.
ooh yes I like that idea. should I open a separate issue for this?
There was a problem hiding this comment.
also missing the doc pages
|
You can try these changes here
|
fixes #3001