Giter VIP home page Giter VIP logo

Comments (3)

dsherret avatar dsherret commented on June 11, 2024 1

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.

dsherret avatar dsherret commented on June 11, 2024

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.

harrysolovay avatar harrysolovay commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.