idahogurl / vs-code-prettier-eslint

A Visual Studio Code Extension to format JavaScript and TypeScript code using the prettier-eslint package.
MIT License
185 stars 46 forks source link

It doesn't decrease the line size for me #144

Closed imthedaniels closed 1 year ago

imthedaniels commented 1 year ago

Describe the bug image

I configured the .editorconfig file to have a maximum of 99 characters per line, but the extension keeps undoing my formatting and increasing the line.

My package json: https://pastebin.com/raw/09e0mZc5 eslintrc.json: https://pastebin.com/raw/kafXj7h0

.editorconfig: root = true

[*] indent_size = 2 indent_style = space end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true ax_line_length = 99

I don't know why it happens that the extension doesn't help me, not decreasing the line size.

idahogurl commented 1 year ago

@imthedaniel Is your project using TypeScript?

imthedaniels commented 1 year ago

@imthedaniel Is your project using TypeScript?

yes

idahogurl commented 1 year ago

@imthedaniel Try the fix described here: https://github.com/idahogurl/vs-code-prettier-eslint/issues/27#issuecomment-1026444484

idahogurl commented 1 year ago

@imthedaniel Did the fix resolve your issue?

imthedaniels commented 1 year ago

@idahogurl Thanks a lot for all your support, I had to install 2 additional libraries to get it to work:

eslint-config-prettier and eslint-plugin-prettier

Greetings from Brazil!

idahogurl commented 1 year ago

@imthedaniel Interesting. You shouldn't need to install those. That means Prettier isn't running, just ESLint and you wouldn't need my extension.

imthedaniels commented 1 year ago

@idahogurl But if I disable its extension, the code formatting doesn't happen anymore

ashley-jisc commented 1 year ago

I'm also experiencing this issue.

No errors in the output for prettier-eslint, vscode will highlight in red about the max-len Eslint rule violation but formatting the document with this formatter doesn't act upon that rule violation. I do have the fix applied as described as above

I have narrowed the issue down, so I will open a new issue with the details