Skip to content

feat: implement naming-convention rule#664

Draft
neo773 wants to merge 5 commits intooxc-project:mainfrom
neo773:feature/naming-convention
Draft

feat: implement naming-convention rule#664
neo773 wants to merge 5 commits intooxc-project:mainfrom
neo773:feature/naming-convention

Conversation

@neo773
Copy link
Copy Markdown

@neo773 neo773 commented Feb 12, 2026

fixes #186

@neo773 neo773 changed the title feat: naming-convention rule feat: implement naming-convention rule Feb 12, 2026
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test structure looks quite different to the original rule - this makes it hard to review, and tricky to tell if we have complete test coverage with the original rule.

Do you mind porting the tests exactly?

Thanks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

The ESLint test suite had a dynamic generated test suite via their helper createTestCases
https://github.com/typescript-eslint/typescript-eslint/blob/68a074fb61a10c3627f09678859fb4d42a3b88f5/packages/eslint-plugin/tests/rules/naming-convention/cases/createTestCases.ts#L87

For this I'm not sure what the right approach would be for tsgolint

As for the static tests I think I ported them all, will double check and get back to you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, let me think about it a bit more

Copy link
Copy Markdown
Contributor

@Limerio Limerio Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your thoughts then? Is it good? (this is just a reminder for you :) ) @camc314

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalidCases = append(invalidCases, GenerateBaseCases(BaseCaseOptions{Operator: "&&"})...)
is how I chose to handle the dynamic tests for prefer optional chaining if that direction is more preferred.

@camc314 camc314 marked this pull request as draft February 13, 2026 17:08
@camc314 camc314 self-assigned this Feb 13, 2026
@jordan-cutler
Copy link
Copy Markdown

Thank you for addressing this!

@yqazi27
Copy link
Copy Markdown

yqazi27 commented Mar 31, 2026

Are there any updates on this rule?

@camc314 camc314 force-pushed the feature/naming-convention branch from 6e4e775 to d284015 Compare March 31, 2026 22:24
Comment on lines +20 to +21
//go:linkname checkerCheckSourceFile github.com/microsoft/typescript-go/internal/checker.(*Checker).checkSourceFile
func checkerCheckSourceFile(recv *checker.Checker, ctx context.Context, sourceFile *ast.SourceFile)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to selff: we shuoldn't be exposing stuff like this

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.

[naming-convention](https://typescript-eslint.io/rules/naming-convention)

6 participants