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
With this configuration, the following is flagged as an error:
import{Something}from'./LocalFolderWithIndexfile'
However, the following is not flagged as an error, but I believe it should be:
import{Something}from'.'
The only difference between the two is where in the file tree the importing file sits. As a workaround, one can supplement this rule with the general no-restricted-imports rule like this:
'no-restricted-imports': ['error',{paths: [{name: '..',message: 'Import from ../index.js instead.',},{name: '.',message: 'Import from ./index.js instead.',},],},],
Apologies if this has already been filed. I found it really hard to search for
The text was updated successfully, but these errors were encountered:
. should not be, because that's not necessarily pointing to a specific file, it's potentially pointing to a package.json. . won't always be index.js, and the whole point of that feature is to not specify extensions and defer to node's algorithm for it.
I have this rule configured like so:
With this configuration, the following is flagged as an error:
However, the following is not flagged as an error, but I believe it should be:
The only difference between the two is where in the file tree the importing file sits. As a workaround, one can supplement this rule with the general
no-restricted-imports
rule like this:Apologies if this has already been filed. I found it really hard to search for
The text was updated successfully, but these errors were encountered: