Skip to content
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

[eslint-plugin] update regex of matching TypeScript file extentions #32571

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeremymeng
Copy link
Member

Some of our custom rules perform operations on TypeScript files only and they use a regex of /\.ts$/.test(fileName) to check whether a file is TypeScript code file or not. With the migration to ESM we can have .mts and .cts files as well. This PR updates the pattern to also match those files.

Packages impacted by this PR

@azure/eslint-plugin-azure-sdk

Some of our custom rules perform operations on TypeScript files only and they
use a regex of `/\.ts$/.test(fileName)` to check whether a file is TypeScript
code file or not. With the migration to ESM we now can have .mts and .cts files
as well. This PR updates the pattern to also match those files.

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • common/tools/eslint-plugin-azure-sdk/tests/fixture/tsconfig.json: Language not supported
Copy link
Member

@deyaaeldeen deyaaeldeen left a comment

Choose a reason for hiding this comment

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

Looks good.

nitpick: Pull the check into a function?

@jeremymeng
Copy link
Member Author

jeremymeng commented Jan 16, 2025

nitpick: Pull the check into a function?

I searched but couldn't find other places of similar check. With just two and they are short and clear I'd keep them. If there is a third or more usage we can refactor.

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

Successfully merging this pull request may close these issues.

2 participants