Skip to content

feat: Update @commitlint/cz-commitlint peerDependency on inquirer@9 to inquirer@latest #4554

Closed

Description

@chris-dura

Expected Behavior

The @commitlint/cz-commitlint docs list a required peer dependency on inquirer@9. The inquirer package is now at v13, and eventually this requirement of an out-of-date version may cause problems for users.

Current Behavior

No response

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

No response

Activity

  1. YasharF commented on Oct 1, 2025

    @YasharF

    I have already incorporating this in the PR I am working on. Although, I have been looking at moving to @inquirer/prompt , because the folks at inquirer have said that is the upgrade path. inquirer v12 is the final version, and projects need to move to @inquirer/prompt sooner or later.

    Image
  2. johnny-the-coder commented on Nov 19, 2025

    @johnny-the-coder
  3. YasharF commented on Nov 19, 2025

    @YasharF

    So sorry, I got dragged into another project. I will be getting back to work on this this week.

  4. escapedcat commented on Nov 20, 2025

    @escapedcat
  5. kennethwkz-mm commented on Jan 18, 2026

    @kennethwkz-mm
  6. johnny-the-coder commented on Feb 6, 2026

    @johnny-the-coder
  7. escapedcat commented on Feb 7, 2026

    @escapedcat
    Member

    We currently need to stay on node v18. But whoever is motivated could give upgrading a try and create a PR

    Version Compatibility Matrix

    Inquirer Version Node.js Requirement Compatible with commitlint (Node >=18)?
    v9.3.8 (legacy) >=18 ✅ Yes (currently used)
    v10.x >=18 ✅ Yes
    v11.x >=18 ✅ Yes
    v12.x >=18 ✅ Yes
    v13.x (latest) >=20.12.0 ❌ No (requires Node 20.12+)
  8. YasharF commented on Feb 7, 2026

    @YasharF

    I am so sorry if I missed it from the other issues, but what is driving the requirement to continue supporting node v18, and not just staying with LTS versions at https://github.com/nodejs/Release?

  9. escapedcat commented on Feb 8, 2026

    @escapedcat
    Member

    I am so sorry if I missed it from the other issues, [...]

    No worries, it's mainly related to which version Ubtuntu LTS supports and if we have good reasons to move to an new minimum version.

    From this issues description:

    [...] eventually this requirement of an out-of-date version may cause problems for users.

    As long as nothing causing an issue for users we do not have to upgrade I guess.

  10. YasharF commented on Feb 8, 2026

    @YasharF

    Totally get wanting to minimize churn. It feels like keeping Node 18 as the floor is already creating extra work by having to tiptoe around dependencies that have dropped or are dropping non‑Foundation LTS support, like cross-env, yargs, and @inquirer/prompt. As the ecosystem moves on, that maintenance cost typically just grows. Aligning with the Node Foundation's active LTS window will likely make things easier in the long run.

  11. escapedcat commented on Feb 8, 2026

    @escapedcat
    Member

    The good news is that the new Ubuntu LTS will drop soon. So once that is out, we can move.

    Ubuntu 26.04 LTS (Resolute Raccoon)

  12. YasharF commented on Feb 8, 2026

    @YasharF

    That makes sense. Just to add some context from the Ubuntu side: even though the distro ships a bundled Node, many Ubuntu users don't rely on it for development. Historically the Node.js project has pointed people to external installs on Ubuntu (NodeSource apt-get repo instead of the built‑in), and Canonical now maintains a Node snap with current releases. In practice, Ubuntu LTS availability hasn't really been a blocker for moving with upstream Node LTS.

  13. 2 remaining items

  14. Mister-Hope commented on Apr 2, 2026

    @Mister-Hope

    I fail to see why the Node.js ecosystem should tether itself to an unrelated OS's LTS lifecycle. @escapedcat, could you clarify the reasoning behind this?

    The Node.js team is explicit: no additional security fixes are provided for EOL (End of Life) versions, which currently includes Node 18 (as seen here: https://nodejs.org/zh-cn/about/eol#eol-versions). With 15 High, 19 Medium, and 4 Low vulnerabilities identified, security should be a priority. For the sake of your own security, you should migrate to Node 20+ unless you are prepared to pay for Commercial Support.

    It seems Ubuntu LTS backports CVE fixes back to node18, but other os and standard node release do not share the benifits. Furthermore, while Ubuntu provides extended support for its shipped versions, the npm community at large does not backport CVE fixes, still making any project running on node18 possibly vulunerable, so I don't think anyone are glad to run any production projects on it.

    We should follow the standard practice of the rest of the ecosystem: once a major version reaches EOL, support for it should be dropped immediately.

    I understand why watching what NodeJS versions are falling out of support is important, but there are people that care more about software releases falling out of support at a distro level (e.g. people that just need NodeJS because it is a dependency of other software they use, but they don't care or know anything about NodeJS).

    I think commitlint could drop support of old NodeJS versions only when a new Ubuntu LTS version comes out that supports newer NodeJS versions, because if there were security bugs/issues present in the NodeJS version that the last Ubuntu LTS ships, I'm very certain that Canonical would put some effort into backporting the bugfixes or upgrading the NodeJS version altogether.

    While that might seem logical on the surface, it doesn't hold up under scrutiny for a few reasons.

    First, commitlint is rarely used in "toy" projects. For professional, large-scale projects, if a team is already using Node-based git hooks, they are expected to have a baseline understanding of the Node.js environment and probably use standard LTS node runtimes.

    Second, if a user cares about commit message linting, they likely have the expertise to manage their tools—whether via a binary or another language-specific tool, and commitlint should not be the ones they choose since they "do not care" Node.js. This is the most curious part: Why should one choose a npm package called commitlint to manage commit msg, if he never cares about Node.js?

    If the commitlint maintainers wish to provide backported security fixes for Node 18 to match Ubuntu's lifecycle, that’s a noble goal, but it should be handled in a dedicated extended-support branch.

  15. Mister-Hope commented on Apr 2, 2026

    @Mister-Hope

    Since commitlint at least introduce 28 extra packages that are outdated comparing to the ecosystem, I am now removing it with a simple script instead:

    import { readFileSync } from 'node:fs'
    import path from 'node:path'
    
    import picocolors from 'picocolors'
    
    const msgPath = process.argv[2]
      ? path.resolve(process.argv[2])
      : path.resolve('.git/COMMIT_EDITMSG')
    const msg = readFileSync(msgPath, 'utf-8').trim()
    
    const commitRE =
      /^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|release)(\(.+\))?: .{1,50}/
    
    if (!commitRE.test(msg)) {
      console.error(
        `${picocolors.white(picocolors.bgRed(' ERROR '))} ${picocolors.red(
          `invalid commit message format.`,
        )}`,
      )
      process.exit(1)
    }

    Just run the scripts in the git hooks

    Note: picocolors is already required by other parts in my project and you should be fine without it.

    hope the script helps anyone concerning the "oudated packages" in his project and thinks that commitlint is "too heavy".

  16. escapedcat commented on Apr 2, 2026

    @escapedcat
    Member

    /cc @knocte happy for your input here

  17. escapedcat commented on Apr 2, 2026

    @escapedcat
    Member
  18. Mister-Hope commented on Apr 2, 2026

    @Mister-Hope

    I've updated my original comment to make the reasons and expressions more clear.

    hope the script helps anyone concerning the "oudated packages" in his project and thinks that commitlint is "too heavy".

    I would also like to throw out this question for the maintainers.

    For most people, they should be happy enough with just the scripts I provided above. Even if you add extra validation, the script is not heavy.

    The scripts I am currently switching to
    import { readdirSync, statSync, readFileSync } from 'node:fs'
    import path from 'node:path'
    
    import picocolors from 'picocolors'
    import { getDirname } from 'vuepress/utils'
    
    const __dirname = getDirname(import.meta.url)
    
    const getSubDirectories = (dir: string): string[] =>
      readdirSync(dir).filter((item) =>
        statSync(path.join(dir, item)).isDirectory(),
      )
    
    const pluginPackages = getSubDirectories(
      path.join(__dirname, '../plugins'),
    ).flatMap((category) =>
      getSubDirectories(path.join(__dirname, '../plugins', category)),
    )
    const themePackages = getSubDirectories(path.join(__dirname, '../themes'))
    const toolPackages = getSubDirectories(path.join(__dirname, '../tools'))
    
    const msgPath = process.argv[2]
      ? path.resolve(process.argv[2])
      : path.resolve('.git/COMMIT_EDITMSG')
    const msg = readFileSync(msgPath, 'utf-8').trim()
    
    const types = [
      'feat',
      'fix',
      'docs',
      'style',
      'refactor',
      'perf',
      'test',
      'workflow',
      'build',
      'ci',
      'chore',
      'types',
      'release',
    ]
    const scopes = [
      ...pluginPackages,
      ...themePackages,
      ...toolPackages,
      'deps',
      'e2e',
    ]
    
    const commitRE =
      /^(revert: )?(?<type>[^(]*?)(?:\((?<scope>[^)]*?)\))?: .{1,50}$/
    
    const match = commitRE.exec(msg)
    
    if (!match) {
      console.error(
        `${picocolors.white(picocolors.bgRed(' ERROR '))} ${picocolors.red(
          `invalid commit message format.`,
        )}`,
      )
      // oxlint-disable-next-line unicorn/no-process-exit
      process.exit(1)
    }
    
    console.log(match, types, scopes)
    
    if (!types.includes(match.groups?.type ?? '')) {
      console.error(
        `${picocolors.white(picocolors.bgRed(' ERROR '))} ${picocolors.red(
          `invalid commit message type: "${match.groups?.type}".`,
        )}`,
      )
      // oxlint-disable-next-line unicorn/no-process-exit
      process.exit(1)
    }
    
    if (match.groups?.scope && !scopes.includes(match.groups.scope)) {
      console.error(
        `${picocolors.white(picocolors.bgRed(' ERROR '))} ${picocolors.red(
          `invalid commit message scope: "${match.groups.scope}".`,
        )}`,
      )
    }

    When why should commitlint have so many deps? (By removing commitlint, I reduced 29 deps from my projects, so there should be more as some deps may be required other parts).

    Shall a simple package be introduced?

  19. YasharF commented on Apr 2, 2026

    @YasharF

    Sharing another perspective that is in-line with getting commit lint to moving faster:

    In some ways, a lint tool is intended to maintain hygiene. It is just kind of odd that a hygiene tool itself isn't maintaining internal hygiene by keeping its dependencies up to date. (just an opinion)

    I am not sure if there are opportunities to redesign parts of it, specially considering how the ecosystem and NodeJS 22+ features are very different than when commitlint was originally written. But if there are places to reinvent and simplify, it might be worth looking into. If that is what the maintainers thinking about, I would highly suggest moving in that direction gradually over the course of multiple versions, so the release pipeline doesn't get clogged in the meantime. I know it is not always easy or trivial, as I myself had been working for over a year to modernize an opensource project that was originally written in 2012 and it has been taking me many months to move it.

  20. knocte commented on Apr 2, 2026

    @knocte
    Contributor

    Sorry I haven't had time to read all long comments yet, but I'd like to highlight this.

    if a team is already using Node-based git hooks, they are expected to have a baseline understanding of the Node.js environment

    commitlint can be adopted by any team, the fact that it is developed using NodeJS is just an implementation detail. I myself lead a team of a .NET shop and we use it, we don't have that "baseline understanding of the NodeJS environment" and shouldn't need to; because commitlint is a tool, not a library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions