question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Group for first party packages

See original GitHub issue

We have a module alias called web for our local code (like @ in #4) and I’d like it to be sorted into it’s own group like this:

import React from "react"

import { Foo } from "web/components/foo"

import { Bar } from "./bar"

import/order supports this by doing a bunch of magic with Webpack parsing, but just having a list of first party packages as a config variable would be a lot easier. Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:34 (20 by maintainers)

github_iconTop GitHub Comments

20reactions
lydellcommented, Nov 22, 2019

v5.0.0 has now been released with the groups option. See custom grouping.

Example:

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

The automatic tsconfig.json idea is tracked in: https://github.com/lydell/eslint-plugin-simple-import-sort/issues/31

9reactions
lydellcommented, Nov 13, 2019

You’ll be able to put your vendored libs anywhere you want with my upcoming thing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Basic Definition of First Party, Second Party, & Third Party Data
First party data is data your company has collected directly from your audience, whether customer, site visitors, or social media followers.
Read more >
Party Venue and Event Space Inquiries - Drive Shack
Upcoming birthday? Office party? Corporate event? Choose from a range of flexible spaces at Drive Shack to make your next event your best....
Read more >
Birthday Parties - Kidville |
We have all-inclusive party packages designed to fulfill your little one's wildest birthday wishes and meet the needs of your guests.
Read more >
Parties & Groups - Allevity Entertainment
Plan your next birthday party at Allevity! Your guests will enjoy a variety of dining options and several fun games and attractions. ·...
Read more >
Birthday Parties - NY Kids Club
Party Packages ; Price includes 10 children. Additional children will be: $20, $30 ; Birthday Child, Free, Free ; 1.5 Hours ox exclusive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found