中文
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
*.svg
Include model
For example: Only include ts files
*
!src/**/
!src/**/*.ts
⚙ Options
formatFilesByIgnores.useignoreExtension: Is use ignore extension ?
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?
formatFilesByIgnores.filterConcurrency: Filter concurrency
Ignore priority
ignoreExtension < ignoreFileNames
ignoreFileNames[1] < ignoreFileNames[2]
📹 Demo



🔗 Link
🎉 Fin
Have fun 🎉🎉🎉🎉
| |