SoominHan / import-sorter

MIT License
89 stars 28 forks source link

Prettier overwriting sorter #102

Open reharik opened 1 year ago

reharik commented 1 year ago

Hi, I have read your docs for setting up import-sorter with prettier. It does not seem to work with me. I would like the imports to all be on the same line unless the line is at 80, or maybe 100. What happens when I save is I see the importer format the lines the way I like then I see prettier put each import on it's online.
I have it setup like this

    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "prettier.proseWrap": "never",

    "importSorter.generalConfiguration.sortOnBeforeSave": true,
    "importSorter.importStringConfiguration.maximumNumberOfImportExpressionsPerLine.type": "newLineEachExpressionAfterCountLimitExceptIfOnlyOne",
    "importSorter.importStringConfiguration.maximumNumberOfImportExpressionsPerLine.count": 80,
    "importSorter.importStringConfiguration.tabSize": 2,
    "importSorter.sortConfiguration.removeUnusedImports": true,
    "importSorter.sortConfiguration.removeUnusedDefaultImports": true,

then I have a .prettierrc that looks like this

{
  "trailingComma": "all",
  "tabWidth": 2,
  "semi": true,
  "singleQuote": true,
  "arrowParens": "avoid"
}

Any help would be appreciated. Thanks, Raif