Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xiaohuohumax/format-files-by-ignores

vscode extension: Batch formatting files not filtered by the `ignore` configuration; vscode 扩展: 批量格式化未被 `ignore` 配置过滤的文件
https://github.com/xiaohuohumax/format-files-by-ignores

batch-format folder formatter gitignore ignore vscode vscode-extension workspace

Last synced: about 5 hours ago
JSON representation

vscode extension: Batch formatting files not filtered by the `ignore` configuration; vscode 扩展: 批量格式化未被 `ignore` 配置过滤的文件

Awesome Lists containing this project

README

        

# Format Files By Ignore


Downloads
Installs
License
Last Commit
Stars

[中文](./README_CN.md)

VSCode Extension: **Batch formatting files not filtered by the `ignore` configuration**

## Install

VSCode Extensions Select `Format Files By Ignores`

## 📄 Usage

- **Format Workspace**
- Open command pallette (`Ctrl + Shift + P`)
- Enter `Start Format Workspace By Ignores 📂`
- **Format Folder**
- `Right` click a folder
- Select `Start Format Folder By Ignores 📂`
- **Custom Ignore File**
- Create a file called `.formatignore` under the folder, and then write the ignore rules (like `.gitignore`)

## Practical tips (ignore rule)

### Exclude model

**For example:** Exclude all **svg** files

```txt
*.svg
```

### Include model

**For example:** Only include **ts** files

```txt
*
!src/**/
!src/**/*.ts
```

## ⚙ Options

- `formatFilesByIgnores.useignoreExtension`: Is use ignore extension ?
- `default`: true
- `formatFilesByIgnores.ignoreExtension`: Ignore extension rules (root folder)
- `default`: [ "node_modules", ".vscode", ".git", "dist" ]
- `formatFilesByIgnores.ignoreFileNames`: Ignore files name
- `default`: [ ".gitignore", ".formatignore" ]
- `formatFilesByIgnores.collapseExplorerFolders`: Whether to collapse the explorer folder after formatting?
- `default`: true
- `formatFilesByIgnores.filterConcurrency`: Filter concurrency
- `default`: 16

## Ignore priority

```txt
ignoreExtension < ignoreFileNames

ignoreFileNames[1] < ignoreFileNames[2]
```

## 📹 Demo

![folder.gif](https://cdn.jsdelivr.net/gh/xiaohuohumax/format-files-by-ignores/images/folder_1_5_0.gif)

![workspace.gif](https://cdn.jsdelivr.net/gh/xiaohuohumax/format-files-by-ignores/images/workspace_1_5_0.gif)

![workspace.gif](https://cdn.jsdelivr.net/gh/xiaohuohumax/format-files-by-ignores/images/cancel_1_5_0.gif)

## 🔗 Link

- [Homepage](https://github.com/xiaohuohumax/format-files-by-ignores#readme)
- [Issue](https://github.com/xiaohuohumax/format-files-by-ignores/issues)
- [Marketplace](https://marketplace.visualstudio.com/items?itemName=xiaohuohumax.format-files-by-ignores)

## 🎉 Fin

Have fun 🎉🎉🎉🎉