Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
eslintConfigXo
✓ import eslintConfigXo from 'eslint-config-xo';
✗ const eslintConfigXo = require('eslint-config-xo');
Default export is a function. Since v0.51.0, it returns an array of config objects. You must spread it into your flat config array.
require
✓ import eslintConfigXo from 'eslint-config-xo';
✗ const eslintConfigXo = require('eslint-config-xo');
Package is ESM-only; require() will throw ERR_REQUIRE_ESM.
eslintConfigXo with options
✓ export default [...eslintConfigXo({ browser: true, space: true, semicolon: false })];
Options: browser (boolean), space (boolean|number for tab width), semicolon (boolean). Default is tabs, Node globals, semicolons on.
Shows minimal eslint.config.js using eslint-config-xo v0.51.0+ flat config pattern.
import eslintConfigXo from 'eslint-config-xo';
export default [
...eslintConfigXo(),
// you can add overrides
{
rules: {
'no-console': 'off',
},
},
];
Debug
Known issues
breakingv0.51.0 changed default export from array to function. Must call eslintConfigXo() and spread the result.fixReplace `export default eslintConfigXo;` with `export default [...eslintConfigXo()];`
affects: >=0.51.0
breakingv0.51.0 removed sub-path exports ./space and ./browser.fixUse options object: eslintConfigXo({ space: true, browser: true }) affects: >=0.51.0
breakingv0.46.0 migrated to flat config and ESLint 9. Old .eslintrc format no longer supported.fixRewrite to eslint.config.js flat config format.
affects: >=0.46.0 <0.51.0
breakingv0.49.0 required Node.js 20. Added no-unused-private-class-members rule.fixUpdate Node.js to 20+.
affects: >=0.49.0
deprecatedReplaced eslint-config-xo-typescript; use eslint-config-xo directly with TypeScript support built-in.fixRemove eslint-config-xo-typescript from dependencies.
affects: >=0.51.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Package is ESM-only; using require() instead of import.
fixUse `import eslintConfigXo from 'eslint-config-xo';` in a module context ("type": "module" in package.json). TypeError: {(intermediate value)} is not iterable
Using eslintConfigXo directly as array (v0.51.0+) without calling it as a function.
fixExport `[...eslintConfigXo()]` instead of `eslintConfigXo`.
ESLint couldn't find the config "eslint-config-xo"
Package not installed or ESLint version <10.
fixRun `npm install --save-dev eslint-config-xo@latest` and ensure ESLint 10+.
Audit
Dependencies
eslintrequiredPeer dependency: ESLint 10 required.
typescriptoptionalPeer dependency: TypeScript 5.9+ required (even for JS projects, for type-aware rules).