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

Group node_module packages separately from from absolute project imports #29

Closed
mtjn opened this issue Nov 13, 2019 · 2 comments
Closed

Comments

@mtjn
Copy link

mtjn commented Nov 13, 2019

In a sample app structure

node_modules
src
  util
  App.js

where App.js is:

import React from "react";
import lib from "util/lib";

// code

Would it be possible to separate the two groups? Thanks!

@lydell
Copy link
Owner

lydell commented Nov 13, 2019

Duplicate of #18

@lydell lydell marked this as a duplicate of #18 Nov 13, 2019
@lydell lydell closed this as completed Nov 13, 2019
@lydell
Copy link
Owner

lydell commented Nov 22, 2019

This is now possible in v5.0.0 using custom grouping.

For example:

{
  "rules": {
    "simple-import-sort/sort": [
      "error",
      {
        "groups": [["^\\u0000"], ["^@?\\w"], ["^util(/.*|$)"], ["^\\."]]
      }
    ]
  }
}

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

2 participants