You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, ignored files return null when you try to get an import from them (see getExports#L79). However, this causes the import/export rule to throw an exception when you try to re-export everything from a file who is re-exporting from an ignored file, because ExportMap's forEach expects each of its re-exports to be able to get their imports (see getExports#L331).
For example, running ESLint with import/exports turned on throws on these files:
// test.jsexport{defaultasx}from'your-package';// your-package is in the ignored settings (eg. in node_modules)// reexport.jsexport*from'./test';
It seems like the simplest thing to fix this would be to just check that getImport() exists before trying to use .get() on it (although I'm not really sure what the first argument to the callback represents -- would null as a possibility make sense there?), but from a cursory glance, I also feel that using null to represent ignored files seems somewhat brittle?
The text was updated successfully, but these errors were encountered:
This happens when applying the import/namespace rule on:
test.js:
import * as foo from './foo';
foo.js:
export * from './bar';
bar.js:
module.exports = { };
bar.js must be ignored.
bar.js must use module.exports syntax.
It could be that hasExports is failing to detect the fact that module.exports is a valid export statement; or that this apparatus as a whole is not prepared to deal with the old-fashioned module.exports style?
Currently, ignored files return
null
when you try to get an import from them (see getExports#L79). However, this causes theimport/export
rule to throw an exception when you try to re-export everything from a file who is re-exporting from an ignored file, because ExportMap'sforEach
expects each of its re-exports to be able to get their imports (see getExports#L331).For example, running ESLint with
import/exports
turned on throws on these files:Exception:
It seems like the simplest thing to fix this would be to just check that
getImport()
exists before trying to use.get()
on it (although I'm not really sure what the first argument to the callback represents -- wouldnull
as a possibility make sense there?), but from a cursory glance, I also feel that usingnull
to represent ignored files seems somewhat brittle?The text was updated successfully, but these errors were encountered: