Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use eslint-plugin-import-order-alphabetical in place of import/order rule #125

Closed
randycoulman opened this issue Mar 1, 2019 · 0 comments

Comments

@randycoulman
Copy link
Contributor

In #117, we enabled some support for sorting of import statements, but couldn't get all the way to where we want to be (see discussion in #103).

The PR on eslint-plugin-import is still open. Occasionally, someone will pick it up and try to run with it, but it's still out there.

Per this comment, there is now a new plugin available, eslint-plugin-import-order-alphabetical that contains an auto-fixing version of this open PR.

We've experimented with that plugin on a client project and found it to work quite well. It still doesn't support the names within a single destructured import statement, but it does get us a step closer.

Suggested rule configuration to match our conventions:

    "import-order-alphabetical/order": [
      "warn",
      {
        groups: [
          ["builtin", "external"],
          "internal",
          "parent",
          ["sibling", "index"],
        ],
        "newlines-between": "always",
      },
    ],
randycoulman added a commit that referenced this issue Mar 1, 2019
Replace the `import/order` rule with the new `import-order-alphabetical/order` rule to allow sorting of imports within groups.

Closes #125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant