renovatemajor #38

Merged
root merged 1 commits from renovate into master 2025-05-11 08:08:34 +00:00
Contributor

npm

lint-staged

  • ^15.5.2 => ^16.0.0 (dvf)

Major Changes

  • #1546 158d15c Thanks @iiroj! - Processes are spawned using nano-spawn instead of execa. If you are using Node.js scripts as tasks, you might need to explicitly run them with node, especially when using Windows:

    {
      "*.js": "node my-js-linter.js"
    }
    
  • #1546 158d15c Thanks @iiroj! - The --shell flag has been removed and lint-staged no longer supports evaluating commands directly via a shell. To migrate existing commands, you can create a shell script and invoke it instead. Lint-staged will pass matched staged files as a list of arguments, accessible via "$@":

    # my-script.sh
    #!/bin/bash
    echo "Staged files: $@"
    

    and

    { "*.js": "my-script.sh" }
    

    If you were using the shell option to avoid passing filenames to tasks, for example bash -c 'tsc --noEmit', use the function syntax instead:

    export default { '*.ts': () => 'tsc --noEmit' }
    
  • #1546 158d15c Thanks @iiroj! - Validation for deprecated advanced configuration has been removed. The advanced configuration was removed in lint-staged version 9 and until now validation has failed if advanced configuration options were detected. Going forward the entire configuration will be treated with the same logic and if these advanced options are still present, they might be treated as valid globs for staged files instead.

  • #1546 158d15c Thanks @iiroj! - The lowest supported Node.js version is 20.18. Please upgrade your Node.js version.

Minor Changes

  • #1401 27110ef Thanks @RohitLuthra19! - Added support for directly running functions on staged files. To configure a function task, use an object with a title and the task itself:

    export default {
      '*.js': {
        title: 'My task',
        task: async (files) => {
          console.log('Staged JS files:', files)
        },
      },
    }
    

    Lint-staged will run your function task with the staged files matching the configured glob as its argument, and show the custom title in its console output.

<h1>npm</h1> <h2>lint-staged</h2> <ul> <li> ^15.5.2 => ^16.0.0 (dvf)</li> </ul> > <h3>Major Changes</h3> > <ul> > <li><p><a href="https://github.com/lint-staged/lint-staged/pull/1546">#1546</a> <a href="https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba"><code>158d15c</code></a> Thanks <a href="https://github.com/iiroj">@iiroj</a>! - Processes are spawned using <a href="https://github.com/sindresorhus/nano-spawn">nano-spawn</a> instead of <a href="https://github.com/sindresorhus/execa">execa</a>. If you are using Node.js scripts as tasks, you might need to explicitly run them with <code>node</code>, especially when using Windows:</p> > <pre><code class="language-json">{ > &quot;*.js&quot;: &quot;node my-js-linter.js&quot; > } > </code></pre> > </li> > <li><p><a href="https://github.com/lint-staged/lint-staged/pull/1546">#1546</a> <a href="https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba"><code>158d15c</code></a> Thanks <a href="https://github.com/iiroj">@iiroj</a>! - The <code>--shell</code> flag has been removed and <em>lint-staged</em> no longer supports evaluating commands directly via a shell. To migrate existing commands, you can create a shell script and invoke it instead. Lint-staged will pass matched staged files as a list of arguments, accessible via <code>&quot;$@&quot;</code>:</p> > <pre><code class="language-shell"># my-script.sh > #!/bin/bash > echo &quot;Staged files: $@&quot; > </code></pre> > <p>and</p> > <pre><code class="language-json">{ &quot;*.js&quot;: &quot;my-script.sh&quot; } > </code></pre> > <p>If you were using the shell option to avoid passing filenames to tasks, for example <code>bash -c &#39;tsc --noEmit&#39;</code>, use the function syntax instead:</p> > <pre><code class="language-js">export default { &#39;*.ts&#39;: () =&gt; &#39;tsc --noEmit&#39; } > </code></pre> > </li> > <li><p><a href="https://github.com/lint-staged/lint-staged/pull/1546">#1546</a> <a href="https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba"><code>158d15c</code></a> Thanks <a href="https://github.com/iiroj">@iiroj</a>! - Validation for deprecated advanced configuration has been removed. The advanced configuration was removed in <em>lint-staged</em> version 9 and until now validation has failed if advanced configuration options were detected. Going forward the entire configuration will be treated with the same logic and if these advanced options are still present, they might be treated as valid globs for staged files instead.</p> > </li> > <li><p><a href="https://github.com/lint-staged/lint-staged/pull/1546">#1546</a> <a href="https://github.com/lint-staged/lint-staged/commit/158d15c9aea0a3a87790ec3766442763cf387dba"><code>158d15c</code></a> Thanks <a href="https://github.com/iiroj">@iiroj</a>! - The lowest supported Node.js version is <code>20.18</code>. Please upgrade your Node.js version.</p> > </li> > </ul> > <h3>Minor Changes</h3> > <ul> > <li><p><a href="https://github.com/lint-staged/lint-staged/pull/1401">#1401</a> <a href="https://github.com/lint-staged/lint-staged/commit/27110ef8ee92c5d104235b4094abb3197b5bf074"><code>27110ef</code></a> Thanks <a href="https://github.com/RohitLuthra19">@RohitLuthra19</a>! - Added support for directly running functions on staged files. To configure a function task, use an object with a title and the task itself:</p> > <pre><code class="language-js">export default { > &#39;*.js&#39;: { > title: &#39;My task&#39;, > task: async (files) =&gt; { > console.log(&#39;Staged JS files:&#39;, files) > }, > }, > } > </code></pre> > <p><em>Lint-staged</em> will run your function task with the staged files matching the configured glob as its argument, and show the custom title in its console output.</p> > </li> > </ul>
m.schnitzler added 1 commit 2025-05-11 01:39:39 +00:00
root approved these changes 2025-05-11 06:46:58 +00:00
root left a comment
Owner

approved by automerge

approved by automerge
root merged commit e60bb5202c into master 2025-05-11 08:08:34 +00:00
root referenced this issue from a commit 2025-05-11 08:08:35 +00:00
root deleted branch renovate 2025-05-11 08:08:37 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: root/dvf#38
No description provided.