Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vaaski opened this issue Oct 8, 2022 · 0 comments
Open

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

vaaski opened this issue Oct 8, 2022 · 0 comments

Comments

@vaaski
Copy link

vaaski commented Oct 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant