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

Updated config and imports for module resolution #104

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

shalarewicz
Copy link
Collaborator

Summary

This PR updates imports to support ESModules per the typescript docs.

Adds linting rules to enforce the addition of file extensions to import statements.

Updates jest config to support module resolution during testing.

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Issues

  • N/A

Evidence

  • All tests pass as expected.
    image

@shalarewicz shalarewicz added the bug Something isn't working label Aug 17, 2022
@shalarewicz shalarewicz marked this pull request as ready for review August 17, 2022 03:16
Copy link
Contributor

@evanmcneely evanmcneely left a comment

Choose a reason for hiding this comment

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

Add an .eslintrc file in the test directory with the "import/extensions" rule set to off. This will ignore the rule in that directory (source). Also, the .npmignore file will need to be updated/cleaned-up since there is no src folder in dist anymore. We can also get rid of the add-file-extension dependency and maybe update the .travis.yml for deployment.

I also noticed that the import/extension rule is prompting me to add .ts file extension when we want .js file extension. Minor but could be confusing to others down the line.

I can do some of this if you want. Otherwise nice config fixes for an annoying issue.

Copy link
Contributor

@evanmcneely evanmcneely 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 to me. For the record, I've run npm publish --dry-run to verify the correct file structure gets published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants