XO is an opinionated JavaScript and TypeScript linter that wraps ESLint, providing a zero-configuration setup with strict, readable code defaults. It aims to streamline code style enforcement and eliminate style-related discussions in pull requests. The current stable version is 2.0.2, with a relatively active release cadence to incorporate updates and maintain compatibility with its underlying dependencies. Key differentiators include its batteries-included approach, which bundles many useful ESLint plugins (e.g., `unicorn`, `import-x`, `n`), automatic caching for performance, first-class TypeScript support, and flexible integration options, including optional Prettier usage. It mandates an ESM-only project structure for optimal functionality.
npm install xoVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install XO as a dev dependency, configure it in `package.json`, and run it from the command line, including using the `--fix` flag to automatically resolve issues.
Upgrade your Node.js environment to version 20.19 or newer.
Update your local ESLint installation to `eslint@^10.0.0` or higher, or remove it if you intend for XO to manage it exclusively.
Migrate your `xo.config.cjs` or similar CJS configuration files to `.js`, `.mjs`, or TypeScript equivalents, ensuring they use `export default` syntax.
Be aware that these rules are currently disabled. Monitor the XO changelog for re-introduction once ESLint 10 compatibility is resolved for the plugin.
Ensure your project's `package.json` contains `"type": "module"` if you are using `.js` files, or use `.mjs` or TypeScript files. For CLI usage, `npx xo` should handle the environment correctly.
Change your import statement to `import xo from 'xo';` if using XO programmatically. Ensure your `package.json` has `"type": "module"` if your `.js` files are intended to be ESM.
Update your Node.js installation to version 20.19 or newer. Consider using a version manager like `nvm` or `volta`.
This is expected behavior in XO v2.0.0. You cannot re-enable these rules until XO re-integrates them in a future release. Review your linting expectations accordingly.
Verify your `xo.config.js` or similar file is using correct ESM syntax and extending valid, compatible configurations. Ensure there are no CJS-style `module.exports` or `require()` calls within the config file itself.