-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
False positive of no-import-module-exports
on module
variable defined in the module
#2181
Comments
Is the variable “module” allowed in strict mode? If so, this is definitely a bug. |
Sure, it's allowed. Otherwise, CommonJS would not work in strict mode -) |
oh right, duh. thanks. |
I'm facing this in |
Per #2297, this should be fixed in v2.25.3. @micalevisk can you share the code that’s erroring? |
This is a TypeScript project that outputs Commonjs, btw. and this:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@micalevisk if you could set up a repro repo that would be most helpful. |
I figured out that I'm getting those lint errors when I access any property of Here's the code: https://gitlab.com/micalevisk/eslint-plugin-import-issue-2181 I might be missing something. I appreciate your help @ljharb |
That said, we could refine the check so that accessing statically knowable property names of |
this is a TS project that targets CJS, not ESM. Maybe I need to configure some plugin then? |
What's targeted shouldn't matter, only the source; My guess is that there's a way webpack can use |
right unfortunately I can't use
|
@ljharb I can reproduce it with the following code as per
If I remove the import React from 'react';
import { render } from 'react-dom';
import { loadableReady } from '@loadable/component';
import { BrowserRouter } from 'react-router-dom';
import { HelmetProvider } from 'react-helmet-async'; |
@snitin315 i definitely can reproduce the warnings, but they seem valid to me - |
@snitin315 The solution for the |
actually reopening for the false positives; but “webpack” isn’t a problem per the above. |
The text was updated successfully, but these errors were encountered: