Marco de Wit
Marco de Wit

Reputation: 2804

Formatting empty line between third party imports and other imports

In a react component I am importing some third party modules and other modules. Is there a way Webstorm, Prettier, Eslint or something else will check for or even format an empty line between the third party imports and the other imports?

I already found out how to sort the imports so that the third party imports are on top.

I found my answer. And now how do I insert a newline between script and asset imports?

Upvotes: 7

Views: 11934

Answers (1)

Marco de Wit
Marco de Wit

Reputation: 2804

Using the following eslint rule works:

{
  "import/order": [
    "error",
    {
      groups: [
        ["builtin", "external"]
      ],
      "newlines-between": "always"
    }
  ]
},

Upvotes: 11

Related Questions