Skip to content

Allow specification for file extension to be used in import statement paths for files created by code generation #4645

Open
@TheMartianMaker

Description

@TheMartianMaker

Feature Request:

  • Option to specify a file extension: Add a configuration option to specify the file extension (e.g., .js, .ts) that should be used in all import statements within the generated files.
  • Consistent import paths: Ensure that all import statements in the generated files use the specified file extension.

Use Case:
For ESM projects, it is often required to include file extensions in import statements. Currently, developers have to manually update the import statements in the generated files to include the necessary file extensions. This feature would automate that process and ensure consistency across the codebase, which is crucial for maintaining proper module resolution in ESM environments.

Activity

markerikson

markerikson commented on Oct 1, 2024

@markerikson
Collaborator

Seems reasonable. File a PR?

TheMartianMaker

TheMartianMaker commented on Oct 2, 2024

@TheMartianMaker
Author

I dont' have the code written for this request. I'm inquiring to see if you guys could add this feature.

markerikson

markerikson commented on Oct 2, 2024

@markerikson
Collaborator

@TheMartianMaker Yeah, I'm saying it's a reasonable request, but it's probably not something we're going to have time to implement ourselves any time soon. Best bet to add it soon is if you can file a PR to make the changes, otherwise it'll probably be a while.

TheMartianMaker

TheMartianMaker commented on Dec 1, 2024

@TheMartianMaker
Author

@markerikson the PR has been filed :)
#4743

linked a pull request that will close this issueIssue 4645 fix #4743on Jan 3, 2025
TheMartianMaker

TheMartianMaker commented on Jan 3, 2025

@TheMartianMaker
Author

@markerikson any updates?

markerikson

markerikson commented on Jan 3, 2025

@markerikson
Collaborator

@TheMartianMaker no, the codegen has been low priority - all my own time atm is focused on pushing the infinite query feature forward.

TheMartianMaker

TheMartianMaker commented on Jan 9, 2025

@TheMartianMaker
Author

@markerikson i understand, and have already written the code to adapt the code gen. Are you waiting to complete infinite query before merging other PRs?

markerikson

markerikson commented on Jan 9, 2025

@markerikson
Collaborator

Loosely, yeah.

I've learned over the years that while I can absorb a lot of info, when it comes to large projects I can only deal with one at a time. That's especially true with something like a large RTK feature, where I only find time to work on it intermittently. It's also a matter of prioritization.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @markerikson@TheMartianMaker

      Issue actions

        Allow specification for file extension to be used in import statement paths for files created by code generation · Issue #4645 · reduxjs/redux-toolkit