Skip to content

Latest commit

 

History

History
87 lines (60 loc) · 2.62 KB

README.md

File metadata and controls

87 lines (60 loc) · 2.62 KB

Format Files By Ignore

Downloads Installs License Last Commit Stars

中文

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 ?
    • 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

ignoreExtension < ignoreFileNames

ignoreFileNames[1] < ignoreFileNames[2]

📹 Demo

folder.gif

workspace.gif

workspace.gif

🔗 Link

🎉 Fin

Have fun 🎉🎉🎉🎉