File Type TemplatesThis extension allows you to specify the default content for files based on their file type. After initialization (run command with CTRL+SHIFT+P, "Initialize file type templates folder), the .file_type_templates folder will be created at the root of the currently open workspace. Beneath that, a series of "Template.{ext}" files will be created, based on the files currently in your project. They will be blank by default, but after editing, any new files you create will be populated with the contents of the template. So for a normal react project, you might, after initialization, see a file structure like
You can then edit
Note the use of inline variable
Also included is a command "Apply current file type templates to all existing empty files" which will retroactively apply existing template rules to any empty files of the matching extension in your project. SourceThe extension is (as most are) open source, and can be found at https://github.com/rollie42/file-type-templates |