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

ci: require js extensions on local imports #77

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

samsiegart
Copy link
Contributor

@samsiegart samsiegart commented Jan 25, 2024

We need to use .js when importing local typescript files for ESM compatibility. #76 fixes this, but this PR adds an eslint plugin (thanks solana) to protect against breaking it again.

I looked into other options, like libraries that transform extensionless imports to .js automatically, but seems like .js extensions are a common pattern in typescript libraries, and it seems less risky to not muck around with the build process.

Example output:

Screenshot 2024-01-25 at 11 02 49 AM

Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

Good thinking

@samsiegart samsiegart merged commit 7a70e1e into main Jan 26, 2024
1 check passed
@samsiegart samsiegart deleted the require-local-js-extensions branch January 26, 2024 20:22
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.

3 participants