Skip to content

Paths having more than two constructs ../ #2662

Closed
@TheAlexGo

Description

@TheAlexGo

Hello! I have the following problem: when trying to sort, those paths that have more than two "../" constructs do not fall into the parent category, but fall into the internal. How to solve this problem?

Expectation:

import { cfg } from 'path/path/path/src/Cfg';
import { l10n } from 'path/src/l10n';
import { helpers } from 'path/path/path/helpers';
import { tip } from 'path/path/tip';

import { controller } from '../../../../path/path/path/controller';
import { component } from '../../../../path/path/path/component';
import { component } from '../../../../path/path/path/component';

Reality:

import { controller } from '../../../../path/path/path/controller';
import { component } from '../../../../path/path/path/component';
import { component } from '../../../../path/path/path/component';
import { cfg } from 'path/path/path/src/Cfg';
import { l10n } from 'path/src/l10n';
import { helpers } from 'path/path/path/helpers';
import { tip } from 'path/path/tip';

Config:

"import/order": [
              2,
              {
                  "groups": [
                      ["builtin", "external"],
                      "internal",
                      ["sibling", "parent"],
                      "object",
                      "type"
                  ],
                  "pathGroups": [
                      {
                          "pattern": "react",
                          "group": "builtin",
                          "position": "before",
                          "patternOptions": {
                              "matchBase": true
                          }
                      },
                      {
                          "pattern": "*.+(css|svg)",
                          "group": "type",
                          "position": "after",
                          "patternOptions": {
                              "matchBase": true
                          }
                      }
                  ],
                  "pathGroupsExcludedImportTypes": ["react"],
                  "alphabetize": {
                      "order": "asc"
                  },
                  "newlines-between": "always"
              }
          ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions