-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
I have this rule configured like so:
'import/extensions': ['error', 'ignorePackages'],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