ESLint config for XO
raw JSON → 0.51.0 verified Sat Apr 25 auth: no javascript
ESLint shareable config for the XO linter, designed for advanced users who prefer to use ESLint directly. Current version 0.51.0 requires ESLint 10 and Node.js 20.19+. Includes over 400 rules from plugins like Unicorn, import-x, n, stylistic, typescript-eslint, and ava. Key differentiator: enforces a strict, opinionated style (tabs by default, semicolons, no jQuery, etc.) and merges TypeScript config in recent versions. Active development cadence with major breaking changes each year.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported ↓
cause Package is ESM-only; using require() instead of import.
fix
Use
import eslintConfigXo from 'eslint-config-xo'; in a module context ("type": "module" in package.json). error TypeError: {(intermediate value)} is not iterable ↓
cause Using eslintConfigXo directly as array (v0.51.0+) without calling it as a function.
fix
Export
[...eslintConfigXo()] instead of eslintConfigXo. error ESLint couldn't find the config "eslint-config-xo" ↓
cause Package not installed or ESLint version <10.
fix
Run
npm install --save-dev eslint-config-xo@latest and ensure ESLint 10+. Warnings
breaking v0.51.0 changed default export from array to function. Must call eslintConfigXo() and spread the result. ↓
fix Replace `export default eslintConfigXo;` with `export default [...eslintConfigXo()];`
breaking v0.51.0 removed sub-path exports ./space and ./browser. ↓
fix Use options object: eslintConfigXo({ space: true, browser: true })
breaking v0.46.0 migrated to flat config and ESLint 9. Old .eslintrc format no longer supported. ↓
fix Rewrite to eslint.config.js flat config format.
breaking v0.49.0 required Node.js 20. Added no-unused-private-class-members rule. ↓
fix Update Node.js to 20+.
deprecated Replaced eslint-config-xo-typescript; use eslint-config-xo directly with TypeScript support built-in. ↓
fix Remove eslint-config-xo-typescript from dependencies.
Install
npm install eslint-config-xo yarn add eslint-config-xo pnpm add eslint-config-xo Imports
- eslintConfigXo wrong
const eslintConfigXo = require('eslint-config-xo');correctimport eslintConfigXo from 'eslint-config-xo'; - require wrong
const eslintConfigXo = require('eslint-config-xo');correctimport eslintConfigXo from 'eslint-config-xo'; - eslintConfigXo with options
export default [...eslintConfigXo({ browser: true, space: true, semicolon: false })];
Quickstart
import eslintConfigXo from 'eslint-config-xo';
export default [
...eslintConfigXo(),
// you can add overrides
{
rules: {
'no-console': 'off',
},
},
];