eslint-plugin-grouped-import 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/grouped-imports.js +2 -1
- package/package.json +1 -1
package/lib/grouped-imports.js
CHANGED
|
@@ -226,7 +226,8 @@ const getImportsByGroup = (options, allOptionsPaths, importNodes) => {
|
|
|
226
226
|
return lodash_1.default.reduce(options, (acc, option, key) => {
|
|
227
227
|
const groupPaths = lodash_1.default.map(option, o => o.path);
|
|
228
228
|
const filteredImports = lodash_1.default.filter(importNodes, (node) => {
|
|
229
|
-
|
|
229
|
+
const isCurrentNodeInGroupAndPath = (lodash_1.default.includes(allOptionsPaths, node.source.value) && !lodash_1.default.includes(groupPaths, node.source.value));
|
|
230
|
+
return !isCurrentNodeInGroupAndPath && lodash_1.default.some(groupPaths, (groupPath) => {
|
|
230
231
|
// check if there's a more specific path in option values
|
|
231
232
|
const similarOptionValue = lodash_1.default.find(allOptionsPaths, optionValue => lodash_1.default.includes(optionValue, groupPath) && optionValue !== groupPath);
|
|
232
233
|
const importValue = node.source.value;
|