Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support different moveToNewFile file name conventionsΒ #46514

Copy link
Copy link
@bobbyg603

Description

@bobbyg603
Issue body actions

Suggestion

Support additional file naming conventions when refactoring.

πŸ” Search Terms

moveToNewFile move to file "move to a new file"

βœ… Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Specify project file naming conventions in tsconfig.json and use the rule here.

πŸ“ƒ Motivating Example

Angular projects use the file name convention some-example.component.ts. The refactor action "Move to a new file" uses the convention SomeNewFile.ts. Ideally, there would be a way to specify the naming convention of the new file. In this case, some-new-file.ts would be the desirable outcome.

πŸ’» Use Cases

  1. Create a TS interface in the same file where it's being used called SomeExampleInterface
  2. Extract the interface using "Move to a new file" in VS Code
  3. Notice the created file is SomeExampleInterface.ts, which needs to be renamed to some-example-interface.ts to follow project naming conventions
bobbyg603, tommck, wizzard0, JamieMason, owensmooth and 50 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.