hosseinmd / prettier-plugin-jsdoc

A Prettier plugin to format JSDoc comments.
MIT License
232 stars 28 forks source link

Not compatible with `prettier-plugin-organize-imports` #99

Closed electrovir closed 3 years ago

electrovir commented 3 years ago

If I install prettier-plugin-organize-imports and list it after prettier-plugin-jsdoc in the "plugins" array within .prettierrc.json, this plugin doesn't do anything at all.

hosseinmd commented 3 years ago

https://github.com/prettier/prettier/issues/10261

hosseinmd commented 3 years ago

https://github.com/prettier/prettier/issues/10259

electrovir commented 3 years ago

darn 😩 Thanks for the links. The more I use Prettier the more I realize it's a huge pain to work with :(

hosseinmd commented 3 years ago

This link show what is the problem, I solved this bug, I am improving code to resolve this for plugins more than two, I will be done so.

hosseinmd commented 3 years ago

Fixed: v0.3.18

hosseinmd commented 3 years ago

prettier-plugin-organize-imports not supporting multiple parsers for typescript so add prettier-plugin-jsdoc to end of plugins list

electrovir commented 3 years ago

I don't understand, what has changed?

If I list prettier-plugin-jsdoc last, then prettier-plugin-jsdoc works but prettier-plugin-organize-imports doesn't. If I list prettier-plugin-organize-imports last then prettier-plugin-organize-imports works but prettier-plugin-jsdoc doesn't.

This is the same behavior as before the v0.3.18 update.

hosseinmd commented 3 years ago

prettier can't find modules, please add plugins like. this

  "plugins": [
    "./node_modules/prettier-plugin-organize-imports",
    "./node_modules/prettier-plugin-jsdoc"
  ],
electrovir commented 3 years ago

Yes, this is my whole .prettier.json file:

{
    "arrowParens": "always",
    "bracketSpacing": false,
    "endOfLine": "lf",
    "htmlWhitespaceSensitivity": "ignore",
    "jsdocParser": true,
    "jsonRecursiveSort": true,
    "jsxBracketSameLine": false,
    "plugins": [
        "./node_modules/prettier-plugin-sort-json",
        "./node_modules/prettier-plugin-packagejson",
        "./node_modules/prettier-plugin-organize-imports",
        "./node_modules/prettier-plugin-jsdoc"
    ],
    "printWidth": 100,
    "singleQuote": true,
    "tabWidth": 4,
    "trailingComma": "all"
}

And here are my dependency versions:

        "prettier": "^2.2.1",
        "prettier-plugin-jsdoc": "^0.3.18",
        "prettier-plugin-organize-imports": "^1.1.1",
        "prettier-plugin-packagejson": "^2.2.10",
        "prettier-plugin-sort-json": "^0.0.2",

Same problem still.

hosseinmd commented 3 years ago

i tested that work for me, i think you should set plugins. then restart vscode to work

electrovir commented 3 years ago

Ah! >Developer: Reload Window did it. It's working now! It's also working with the Prettier CLI.

Thank you much! 😄