Comments (3)
Would you be able to expand on what you mean? I don't fully understand. For example, given a dprint configuration file, list of files on the file system, and running dprint output-file-paths
, what would be some example output?
from dprint.
Basic dprint config file in the current directorly, like
{
"json": {
},
"excludes": [
"**/*-lock.json"
],
"plugins": [
"https://plugins.dprint.dev/json-0.19.1.wasm"
]
}
File named foo.json.in
in the current directory, with JSON inside.
dprint fmt foo.json.in
would format it as JSON. Currently it errors out with "No files found to format with the specified plugins at ...".
But note that this is in no way limited to JSON. The ignored suffix processing would apply to all filenames and filename extensions recognized by dprint.
from dprint.
This is possible today by using the associations feature:
{
"json": {
"associations": "**/*.{json,jsonc,json.in}"
},
"excludes": [
"**/*-lock.json"
],
"plugins": [
"https://plugins.dprint.dev/json-0.19.1.wasm"
]
}
But note that this is in no way limited to JSON. The ignored suffix processing would apply to all filenames and filename extensions recognized by dprint.
Right now, the dprint CLI gets the extensions to format from the plugins. Perhaps it could get these extensions then also add searching for these other backup extensions. However, this would greatly expand the number of file extension tests it needs to do per file, which might affect performance. Additionally, I think some people might find this behaviour undesirable. It also seems like an edge case that the associations feature covers.
I'm wondering if perhaps these kinds of extensions should only be matched for if they are explictily provided on the command line.
from dprint.
Related Issues (20)
- Document using lsp in various editors
- Can't remove BOM HOT 1
- CI GH Actions compile error HOT 5
- Possible to have `dprint` `biome` point to `biome.json` for configuration? HOT 3
- Can't Format Files In Hardlink Folder
- Support assigning a file to a formatter based on its shebang HOT 5
- Include / exclude behavior differs with `--stdin`
- JSON config schema file HOT 1
- Offline process plugin installation instructions
- Config - Ability to include subset of another arbitrary JSON file
- Programatic API for TS (Node/Bun/Deno/etc.) HOT 2
- CLI fails to run on android-arm64
- dprint hangs sometimes HOT 3
- Memory leak in dprint-core HOT 1
- dprint attempts to format files in .git HOT 1
- plugin-prettier causes `dprint fmt` to crash on Apple M3 HOT 2
- Support for key spacing alignment HOT 2
- npm package's post-install should copy binary to node_modules/.bin folder?
- Delegate to repository-local dprint when available
- `associations` do not overwrite file extensions supported by the plugin.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dprint.