Skip to content
This repository was archived by the owner on Sep 16, 2025. It is now read-only.
This repository was archived by the owner on Sep 16, 2025. It is now read-only.

can't use with XO; Named export 'ESLint' not found #126

@vaaski

Description

@vaaski

Hey, I was looking to switch my vue project from eslint to XO, but this config doesn't seem to work.

The vscode XO extension throws the following error:

error pop-up
Cannot read config file: eslint-config-xo-vue-repro/node_modules/eslint-config-prettier/index.js
Error: ENOENT: no such file or directory, open 'eslint-config-xo-vue-repro/node_modules/eslint-config-prettier/index.js'
Referenced from: eslint-config-xo-vue-repro/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js

While npx xo errors with:

npx xo error
file://eslint-config-xo-vue-repro/node_modules/xo/lib/report.js:2
import {ESLint} from 'eslint';
        ^^^^^^
SyntaxError: Named export 'ESLint' not found. The requested module 'eslint' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'eslint';
const {ESLint} = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)

I've spun up a repo for repro here.
Just clone, npm ci and npx xo

I am on MacOS Ventura on a M2 MacBook Air, but I doubt it's relevant for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions