-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
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: 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
Description
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
- Create a TS interface in the same file where it's being used called SomeExampleInterface
- Extract the interface using "Move to a new file" in VS Code
- 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 49 more
Metadata
Metadata
Assignees
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: 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