Auto TS File Generator is a VS Code extension designed to boost productivity in TypeScript projects. It allows developers to generate TypeScript files with customizable configurations effortlessly.
With a few clicks, you can create:
- Classes: Fully structured with constructors and placeholders for methods.
- Interfaces: Ready-to-use templates for defining object shapes.
- Enums: Easily define enumerations for your projects.
- Types: Generate type aliases to streamline your code.
- Functions: Boilerplate code for reusable logic.
- Variables: Predefined variables for consistent coding.
- VSCode 1.88.0 or later
- Custom Configurations: Choose formatting, strict mode, and comment options to match your project's style.
- Integrated Workflow: Seamlessly create files in your workspace folders.
- Extensibility: Easily extend the generator for additional use cases.
- Open Source: Auto TS Generator is open-source software, so you can contribute to its development and help make it even better.
Configure your project by creating or updating a settings.json file at the project's root. If you already have a .vscode/settings.json
file, skip the first two steps.
-
Open the command palette in VSCode:
CTRL + SHIFT + P
(Windows)CMD + SHIFT + P
(Mac OS)
-
Type
Preferences: Open Workspace Settings (JSON)
. -
In the
.vscode/settings.json
file, copy and paste the following settings:{ "autoTS.enable": true, // Enable or disable Auto TS Generator "autoTS.files.fileExtension": "ts", // The file extension for generated files "autoTS.files.skipFolderConfirmation": false, // Skip the folder confirmation dialog "autoTS.files.autoImport": false, // Automatically import generated files "autoTS.files.defaultBarrelFileName": "index.ts", // The default name for barrel files "autoTS.formatting.useSingleQuotes": true, // Use single quotes for strings "autoTS.formatting.excludeSemiColonAtEndOfLine": false, // Exclude semicolons at the end of lines "autoTS.formatting.keepExtensionOnExport": false, // Keep file extension on export "autoTS.formatting.endOfLine": "lf", // The end-of-line character "autoTS.formatting.useStrict": false, // Use strict mode in generated files "autoTS.formatting.headerCommentTemplate": [], // A template for header comments "autoTS.formatting.insertFinalNewline": true, // Insert a newline at the end of files }
-
Restart VS Code
Your project is now set up to automatically format code upon saving.
Configure Auto TS Generator settings in your .vscode/settings.json
file to customize the extension's behavior. The following settings are available:
autoTS.enable
: Enable or disable Auto TS Generator. Default istrue
.autoTS.files.fileExtension
: The file extension for generated files. Default ists
.autoTS.files.skipFolderConfirmation
: Skip the folder confirmation dialog. Default isfalse
.autoTS.files.autoImport
: Automatically import generated files. Default isfalse
.autoTS.files.defaultBarrelFileName
: The default name for barrel files. Default isindex.ts
.autoTS.formatting.useSingleQuotes
: Use single quotes for strings. Default istrue
.autoTS.formatting.excludeSemiColonAtEndOfLine
: Exclude semicolons at the end of lines. Default isfalse
.autoTS.formatting.keepExtensionOnExport
: Keep file extension on export. Default isfalse
.autoTS.formatting.endOfLine
: The end-of-line character. Default islf
.autoTS.formatting.useStrict
: Use strict mode in generated files. Default isfalse
.autoTS.formatting.headerCommentTemplate
: A template for header comments. Default is[]
.autoTS.formatting.insertFinalNewline
: Insert a newline at the end of files. Default istrue
.
For more information on configuring Auto TS Generator settings, refer to the Project Settings section.
If you enjoy using Auto TS Generator, consider following me for updates on this and future projects:
This extension was created using VSXpert, a template that helps you create Visual Studio Code extensions with ease. VSXpert provides a simple and easy-to-use structure to get you started quickly.
- Angular File Generator
- NestJS File Generator
- T3 Stack / NextJS / ReactJS File Generator
- Auto Barrel
- CodeIgniter 4 Spark
Auto TS Generator is open-source software, and we welcome contributions from the community. If you'd like to contribute, please fork the GitHub repository and submit a pull request with your changes.
Before contributing, please read our Contribution Guidelines for instructions on coding standards, testing, and more.
We are committed to providing a friendly, safe, and welcoming environment for all, regardless of gender, sexual orientation, disability, ethnicity, religion, or similar personal characteristic. Please review our Code of Conduct before participating in our community.
For a complete list of changes, see the CHANGELOG.md
- Manuel Gil - Owner - ManuelGil
See also the list of contributors who participated in this project.
This extension is licensed under the MIT License. See the MIT License for details.