How to config VSCode’s Organize Imports order?

The built-in “Organize Imports” functionality has no configuration, according to the documentation.

You can customize import ordering using a third-party extension, such as alfnielsen.vsc-organize-imports or by using a separate linting tool like eslint or tslint.

In eslint (my recommendation, since tslint has been deprecated), you’ll need to also use a plugin like eslint-plugin-import to get the more-specific configuration you want. Then, instead of using the VSCode “Organize Imports” action, you’ll use the “Fix All” action or a invoke a quick fix.

Here’s a partial example .eslint.js config file.

module.exports = {
  plugins: [
    "import",
  ],
  rules: {
    "import/order": [
      "error",
      {
        groups: [
          "index",
          "sibling",
          "parent",
          "internal",
          "external",
          "builtin"
        ]
      }
    ]
  }
}

Leave a Comment

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş