import/order relative import sorting order changed in 2.27.0 #2682
Open
Description
opened on Jan 17, 2023
Given the following rule config:
module.exports.rules = {
'import/order': [
'error',
{
alphabetize: { order: 'asc', caseInsensitive: true },
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'object'],
'newlines-between': 'always',
warnOnUnassignedImports: true,
}
]
}
In eslint-plugin-import
2.26, sibling imports were sorted after parent imports. In versions 2.27.0 to 2.27.5, siblings are sorted before parents.
Here’s an example of previously valid, but now invalid code:
import { fooz } from '../baz.js'
import { foo } from './bar.js'
Activity