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

Error on version 3.0.0 #145

Open
ghost opened this issue Mar 23, 2025 · 2 comments
Open

Error on version 3.0.0 #145

ghost opened this issue Mar 23, 2025 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 23, 2025

Baby,
I appreciate your update. Thank you.

Until 2.2.1, linting javascript files was working,
Now on 3.0.0, there is an error when linting files.

I created a simple reproduction, but I don't know if that is going to help you, because there is nothing beyond the basic files: https://stackblitz.com/edit/create-olnjb38v?devToolsHeight=33&file=eslint.config.js

You see in Stackblitz that I don't use your recommended/best practices/pre-made configs.
Instead I make my own flat config.

I import all plugins in the same way in app.js, but the error only happens when your plugin is imported:

import astro from 'eslint-plugin-astro';
import globals from 'globals';
import importx from 'eslint-plugin-import-x';
import js from '@eslint/js';
import jsdoc from 'eslint-plugin-jsdoc';
import unicorn from 'eslint-plugin-unicorn';
import wc from 'eslint-plugin-wc';

When running the script to lint javascript files, the following message appears on the code editor terminal:

user@pc:~/project$ bun run js:lint
$ eslint './**/*.js' --cache

Oops! Something went wrong! :(

ESLint: 9.23.0

file:///project/src/app.js:3
import wc from 'eslint-plugin-wc';
       ^^
SyntaxError: The requested module 'eslint-plugin-wc' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
    at async loadConfigFile (/home/user/project/node_modules/eslint/lib/config/config-loader.js:197:18)
    at async ConfigLoader.calculateConfigArray (/home/user/project/node_modules/eslint/lib/config/config-loader.js:513:23)
    at async #calculateConfigArray (/home/user/project/node_modules/eslint/lib/config/config-loader.js:691:23)
    at async directoryFilter (/home/user/project/node_modules/eslint/lib/eslint/eslint-helpers.js:268:5)
    at async NodeHfs.<anonymous> (file:///home/user/project/node_modules/@humanfs/core/src/hfs.js:586:29)
    at async NodeHfs.walk (file:///home/user/project/node_modules/@humanfs/core/src/hfs.js:614:3)
    at async globSearch (/home/user/project/node_modules/eslint/lib/eslint/eslint-helpers.js:323:20)
user@pc:~/project$ 

It may be a simple error somewhere, or something not declared as exports in package.json... no worry about it. Could you please review your 3.0.0 update and try to fix it?

@ghost
Copy link
Author

ghost commented Mar 24, 2025

in package.json, the "type" is "module"

@43081j
Copy link
Owner

43081j commented Mar 24, 2025

import * as wc from 'eslint-plugin-wc';

typescript would tell you this but unfortunately node just leaves you with a not-so-useful error about defaults

ill update the readme to mention this at some point

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