electrovir / prettier-plugin-multiline-arrays

Prettier plugin to force array elements to wrap onto new lines.
https://www.npmjs.com/package/prettier-plugin-multiline-arrays
Creative Commons Zero v1.0 Universal
135 stars 6 forks source link

Completely ignore arrays for Prettier #13

Closed Hetch3t closed 2 years ago

Hetch3t commented 2 years ago

Proposal

It would be really awesome, if there was an option to "disable arrays" for Prettier completely. You can think of it as before every line with array there would be // prettier-ignore.

Reasoning

I'm using Prettier with ESLint (I'm sure I'm not the only one), and I would prefer to manually sometimes have each element on newline or all elements on single line - for that reasons I have 2 rules in .eslintrc:

"array-bracket-newline": ["error", "consistent"],
"array-element-newline": ["error", "consistent"],

and I would like Prettier to completely not care about arrays and let eslint --fix deal with arrays.

electrovir commented 2 years ago

Ah, nice use case! However, I think this request is out of scope for this plugin: this plugin is specifically used for forcing multiline arrays.