<p dir="auto">I have a module that requires some <code class="notranslate">read</code>, <code class="notranslate">write</code> and <code class="notranslate">run</code> permissions when using <code class="notranslate">deno run</code>. However, if I import the same module in the REPL these permissions are either granted implicitly or not required? This seems like a security risk because if an attacker can get someone to 'try out' their project by running an 'example' in the REPL,that code can circumvent explicit permission requirements and cause all kinds of havoc.</p>
<p dir="auto">Maybe <code class="notranslate">deno repl</code> should implement a <code class="notranslate">--prompt</code> flag just like <code class="notranslate">deno run</code> and run with it by default? That way the REPL can still be used for quick prototyping, but also asks the user before granting for example net access to shady.site.</p>
<p dir="auto">I have a JavaScript monorepo wherein some sub-projects do not comply to Deno. To fully ignore them, I have to add three <code class="notranslate">files.exclude</code> configs to my deno.json:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;fmt&quot;: {
    &quot;files&quot;: { &quot;exclude&quot;: [&quot;modules/tools&quot;] },
    // More options.
  },
  &quot;lint&quot;: {
    &quot;files&quot;: { &quot;exclude&quot;: [&quot;modules/tools&quot;] },
    // More options.
  },
  &quot;test&quot;: {
    &quot;files&quot;: { &quot;exclude&quot;: [&quot;modules/tools&quot;] },
    // More options.
  },
  // More options.
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"fmt"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"files"</span>: <span class="pl-kos">{</span> <span class="pl-s">"exclude"</span>: <span class="pl-kos">[</span><span class="pl-s">"modules/tools"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c">// More options.</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"lint"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"files"</span>: <span class="pl-kos">{</span> <span class="pl-s">"exclude"</span>: <span class="pl-kos">[</span><span class="pl-s">"modules/tools"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c">// More options.</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"test"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"files"</span>: <span class="pl-kos">{</span> <span class="pl-s">"exclude"</span>: <span class="pl-kos">[</span><span class="pl-s">"modules/tools"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c">// More options.</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c">// More options.</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I'd like a single top-level <code class="notranslate">files</code> config that had the same effect:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;files&quot;: { &quot;exclude&quot;: [&quot;modules/tools&quot;] },
  &quot;fmt&quot;: {
    // More options.
  },
  &quot;lint&quot;: {
    // More options.
  },
  &quot;test&quot;: {
    // More options.
  },
  // More options.
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"files"</span>: <span class="pl-kos">{</span> <span class="pl-s">"exclude"</span>: <span class="pl-kos">[</span><span class="pl-s">"modules/tools"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"fmt"</span>: <span class="pl-kos">{</span>
    <span class="pl-c">// More options.</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"lint"</span>: <span class="pl-kos">{</span>
    <span class="pl-c">// More options.</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-s">"test"</span>: <span class="pl-kos">{</span>
    <span class="pl-c">// More options.</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c">// More options.</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">This DRYs up the config at the expense of increasing the complexity. It feels more natural to me than updating three places to effectively fully ignore a directory.</p>
<h2 dir="auto">References</h2>
<ul dir="auto">
<li><a href="https://github.com/denoland/vscode_deno/blob/main/docs/workspaceFolders.md#mixed-deno-projects">Mixed Deno workspaces in the VS Code extension</a></li>
<li><a href="https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json" rel="nofollow">deno.json schema</a></li>
</ul>