Skip to content

mikerhyssmith/ts-barrelr

Repository files navigation

ts-barrelr

VSCodeVersion VSCodeInstalls TravisStatus

Features

ts-barrelr automates the production of index.ts barrel files.

ts-barrelr will produce an index.ts containing all files and folders within the folder containing the current file open in the editor window.

There are two ways to trigger barrelr:

  • Select the barrel action from the actions menu or use the keybinds ctrl-alt-b / cmd-alt-b with a file open to create an index.ts in the folder of the currently open file:

Barrel action

  • Right click on a folder and select 'Barrel' to create an index.ts file for that folder. Context menu barrel

Running the command again will update the barrel with any new or changed files.

Configuration

Included files:

By default barrelr will include any files with a .ts or .tsx extension but this can be configured via the setting barrelr.fileExtensionRegex

Quote Marks:

By default ts-barrelr will use single quotes as the default quotemark for imports in index.ts files. This can be changed to double quotes using the setting: barrelr.useDoubleQuotes

Semi-colons:

By default ts-barrelr will add semi colons at the end of each line, if you want to disable this you can use the setting: barrelr.useSemiColons

Line ending:

By default ts-barrelr will use Windows style line endings CRLF, if you want to use Linux style use LF: barrelr.lineEnding

Files to exclude:

By default ts-barrelr will exclude any files containing .spec., .e2e. or .test. This can be changed as a regular expression by changing the setting: barrelr.excludeFileRegex

About

🛢️ A VS Code plugin for automatically generating index.ts files for typescript or tsx projects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published