dprint / dprint-plugin-json

JSON code formatting plugin for dprint.
https://dprint.dev/plugins/json
MIT License
18 stars 5 forks source link

Allow globs in `jsonTrailingCommaFiles` #38

Open tommy-mitchell opened 2 months ago

tommy-mitchell commented 2 months ago

Specifying files to use trailing commas currently requires listing every file explicitly:

"jsonTrailingCommaFiles": [
  "tsconfig.json",
  "tsconfig.base.json",
  "jsconfig.json",
  ".vscode/settings.json",
  ".vscode/extensions.json",
  ".vscode/tasks.json",
  ".vscode/launch.json",
]

It'd be convenient to allow some glob-like matching (which is already supported for includes/excludes):

"jsonTrailingCommaFiles": [
  "{j,t}sconfig*.json",
  ".vscode/*.json"
]

This was suggested in https://github.com/dprint/dprint-plugin-json/issues/14#issuecomment-1489580999 as well.