nirtamir2 / eslint-config-nirtamir2

Nir Tamir's ESLint config
MIT License
1 stars 0 forks source link

ESLint sort imports #1

Open nirtamir2 opened 3 years ago

nirtamir2 commented 3 years ago

// This won't clash with import/order and will order imports inside the {}.
sort-imports: ["error", { ignoreDeclarationSort: true }],
"import/order": [
      "warn",
      {
        groups: [
          ["builtin", "external"],
          "internal",
          ["parent", "index", "sibling"],
        ],
        pathGroups: [
          // replace @projectName with your project name
          {
            pattern: "@projectName/**",
            group: "external",
            position: "after",
          },
          {
            pattern: "*.svg",
            patternOptions: {
              dot: true,
              nocomment: true,
              matchBase: true,
            },
            group: "sibling",
            position: "after",
          },
        ],
        pathGroupsExcludedImportTypes: ["builtin"],
        "newlines-between": "always",
        alphabetize: {
          order: "asc",
        },
      },
    ]
nirtamir2 commented 2 years ago

Maybe add another config file named sort imports for people that like to sort imports with eslint. Include eslint-plugin-sort-export-all and matybe eslint-plugin-simple-import-sort