Skip to content

v27.0.0

Choose a tag to compare

@spaceninja spaceninja released this 15 Sep 18:02
· 19 commits to main since this release

Major Changes

  • Update eslint-config-xo to v2, which moves eslint-plugin-unicorn from
    v73 to v74. The bump adds, removes and reconfigures no unicorn rule — v74's
    changes are fixes to rules we already run. Measured against a real consumer
    project, it produced three fewer reports across 64 TypeScript files, where
    unicorn/prefer-number-coercion and unicorn/prefer-string-replace-all had
    been flagging cases they misread.

  • n/prefer-process-get-builtin-module is now on, added by xo v2. It reports
    require('node:fs') and await import('node:fs') for built-in modules and
    wants process.getBuiltinModule('node:fs') instead. It is not auto-fixable,
    so whatever it catches has to be edited by hand. This is the only rule the
    upgrade turns on, and the only source of new errors in it.

    Most projects will never see it. The rule switches itself off unless the
    nearest package.json declares an engines.node falling entirely within
    ^20.16.0 || >=22.3.0 — the versions where process.getBuiltinModule is
    guaranteed to exist. A package with no engines.node at all, or one as loose
    as >=20, is left alone.

    Where it does apply, the payoff is in ES modules, where it removes the need
    for createRequire. It fires in CommonJS too, where require is the native
    idiom and the rewrite buys nothing, so build scripts and .cjs files are the
    likeliest place to meet it. Turn it off for those paths in your own config if
    it is noisy:

    {
    	files: ['**/*.cjs'],
    	rules: { 'n/prefer-process-get-builtin-module': 'off' },
    }