Comments (3)
It would be a lot of work to give plugins read access to the file system and it would slow things down a lot. Plus, the plugins in dprint ideally should work in Web browsers. If anything, there should maybe be some ability to be able to specify a subset to include from another JSON file in the config. So for example, the shared config in tailwind.config.ts
could be extracted out to a statically analyzable JSON file, then used in both tailwind.config.ts and dprint.json. I opened #821.
from dprint.
It's not possible because dprint's CLI runs Biome sandboxed in a Wasm runtime. It's not able to reach out and ask what's at a certain path. This has the security benefit, but also the performance benefit that plugin config only needs to be loaded from one file (dprint.json) instead of many different files. The downside is obviously that config needs to be duplicated in some cases if desired.
from dprint.
This problem is somewhat similar to a problem in #552 ββΒ the plugin needs access to a project file (in that case of #552, the tailwindcss config file is needed). @dsherret thoughts on allowing users to explicitly allow read access to specific files? These file contents could be automatically added to plugin context.
{
"read": ["biome.json", "tailwind.config.ts"],
// rest of dprint config...
}
from dprint.
Related Issues (20)
- Include / exclude behavior differs with `--stdin` HOT 1
- 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.
- On some Windows machines: "Connection Failed: tls connection init failed: invalid peer certificate: UnknownIssuer" HOT 1
- dprint 0.46 fails to build via cargo without `--locked` flag HOT 1
- could not parse Dockerfile from version 0.46 HOT 3
- Global gitignore is not respected. HOT 2
- Branding, documentation update
- (π) pypi release
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.