Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix mode? #29

Closed
breck7 opened this issue Oct 18, 2020 · 2 comments
Closed

Matrix mode? #29

breck7 opened this issue Oct 18, 2020 · 2 comments

Comments

@breck7
Copy link

breck7 commented Oct 18, 2020

I found this lib after hitting an issue where Prettier does not format long arrays well (prettier/prettier#4210).

One user had a great suggestion:

// prettier-mode matrix
const userIds = [
  7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166,
  7234932843, 7234932978, 7234932436, 7234932687, 7234932269, 7234932573,
  7234932913, 7234932873, 7234932748, 7234932354, 7234932153, 7234932181,
  7234932947, 7234932563, 7234932324, 7234932952, 7234932885, 7234932911,
  7234932698, 7234932248, 7234932764, 7234932431, 7234932811, 7234932344,
  7234932855, 7234932430, 7234932396, 7234932981, 7234932594, 7234932131,
  7234932489, 7234932552, 7234932116, 7234932833, 7234932521, 7234932252,
  7234932503, 7234932540, 7234932893, 7234932736, 7234932969, 7234932145,
  7234932925, 7234932417, 7234932344, 7234932108, 7234932161, 7234932777,
  7234932971, 7234932159, 7234932158, 7234932908, 7234932511, 7234932876,
  7234932768, 7234932284, 7234932640, 7234932309, 7234932651, 7234932292,
  7234932898, 7234932284, 7234932201, 7234932506, 7234932654, 7234932840,
  7234932334, 7234932246, 7234932376, 7234932398, 7234932714, 7234932134,
  7234932435, 7234932181, 7234932980, 7234932594, 7234932396, 7234932100,
  7234932743, 7234932812, 7234932583, 7234932622, 7234932800, 7234932310,
  7234932111, 7234932537, 7234932751, 7234932920, 7234932872, 7234932700,
  7234932702, 7234932655, 7234932515, 7234932298
];

I tried to achieve that with your lib but line breaks right now seem to be all or nothing.

My input, pasted below, exceeds the line length so each array value gets it's own line. Might help the 40+ devs on that thread.

Also, a simple webpage with a textarea demo would be great, so if I just wanted to reformat 1 document or to kick the tires i didn't have to go through NPM and the whole shebang.

  stringify([
    "#440154",
    "#440256",
    "#450457",
    "#450559",
    "#46075a",
    "#46085c",
    "#460a5d",
    "#460b5e",
    "#470d60",
    "#470e61",
    "#471063",
    "#471164",
    "#471365",
    "#481467",
    "#481668",
    "#481769",
    "#48186a",
    "#481a6c",
    "#481b6d",
    "#481c6e",
    "#481d6f",
    "#481f70",
    "#482071",
    "#482173",
    "#482374",
    "#482475",
    "#482576",
    "#482677",
    "#482878",
    "#482979",
    "#472a7a",
    "#472c7a",
    "#472d7b",
    "#472e7c",
    "#472f7d",
    "#46307e",
    "#46327e",
    "#46337f",
    "#463480",
    "#453581",
    "#453781",
    "#453882",
    "#443983",
    "#443a83",
    "#443b84",
    "#433d84",
    "#433e85",
    "#423f85",
    "#424086",
    "#424186",
    "#414287",
    "#414487",
    "#404588",
    "#404688",
    "#3f4788",
    "#3f4889",
    "#3e4989",
    "#3e4a89",
    "#3e4c8a",
    "#3d4d8a",
    "#3d4e8a",
    "#3c4f8a",
    "#3c508b",
    "#3b518b",
    "#3b528b",
    "#3a538b",
    "#3a548c",
    "#39558c",
    "#39568c",
    "#38588c",
    "#38598c",
    "#375a8c",
    "#375b8d",
    "#365c8d",
    "#365d8d",
    "#355e8d",
    "#355f8d",
    "#34608d",
    "#34618d",
    "#33628d",
    "#33638d",
    "#32648e",
    "#32658e",
    "#31668e",
    "#31678e",
    "#31688e",
    "#30698e",
    "#306a8e",
    "#2f6b8e",
    "#2f6c8e",
    "#2e6d8e",
    "#2e6e8e",
    "#2e6f8e",
    "#2d708e",
    "#2d718e",
    "#2c718e",
    "#2c728e",
    "#2c738e",
    "#2b748e",
    "#2b758e",
    "#2a768e",
    "#2a778e",
    "#2a788e",
    "#29798e",
    "#297a8e",
    "#297b8e",
    "#287c8e",
    "#287d8e",
    "#277e8e",
    "#277f8e",
    "#27808e",
    "#26818e",
    "#26828e",
    "#26828e",
    "#25838e",
    "#25848e",
    "#25858e",
    "#24868e",
    "#24878e",
    "#23888e",
    "#23898e",
    "#238a8d",
    "#228b8d",
    "#228c8d",
    "#228d8d",
    "#218e8d",
    "#218f8d",
    "#21908d",
    "#21918c",
    "#20928c",
    "#20928c",
    "#20938c",
    "#1f948c",
    "#1f958b",
    "#1f968b",
    "#1f978b",
    "#1f988b",
    "#1f998a",
    "#1f9a8a",
    "#1e9b8a",
    "#1e9c89",
    "#1e9d89",
    "#1f9e89",
    "#1f9f88",
    "#1fa088",
    "#1fa188",
    "#1fa187",
    "#1fa287",
    "#20a386",
    "#20a486",
    "#21a585",
    "#21a685",
    "#22a785",
    "#22a884",
    "#23a983",
    "#24aa83",
    "#25ab82",
    "#25ac82",
    "#26ad81",
    "#27ad81",
    "#28ae80",
    "#29af7f",
    "#2ab07f",
    "#2cb17e",
    "#2db27d",
    "#2eb37c",
    "#2fb47c",
    "#31b57b",
    "#32b67a",
    "#34b679",
    "#35b779",
    "#37b878",
    "#38b977",
    "#3aba76",
    "#3bbb75",
    "#3dbc74",
    "#3fbc73",
    "#40bd72",
    "#42be71",
    "#44bf70",
    "#46c06f",
    "#48c16e",
    "#4ac16d",
    "#4cc26c",
    "#4ec36b",
    "#50c46a",
    "#52c569",
    "#54c568",
    "#56c667",
    "#58c765",
    "#5ac864",
    "#5cc863",
    "#5ec962",
    "#60ca60",
    "#63cb5f",
    "#65cb5e",
    "#67cc5c",
    "#69cd5b",
    "#6ccd5a",
    "#6ece58",
    "#70cf57",
    "#73d056",
    "#75d054",
    "#77d153",
    "#7ad151",
    "#7cd250",
    "#7fd34e",
    "#81d34d",
    "#84d44b",
    "#86d549",
    "#89d548",
    "#8bd646",
    "#8ed645",
    "#90d743",
    "#93d741",
    "#95d840",
    "#98d83e",
    "#9bd93c",
    "#9dd93b",
    "#a0da39",
    "#a2da37",
    "#a5db36",
    "#a8db34",
    "#aadc32",
    "#addc30",
    "#b0dd2f",
    "#b2dd2d",
    "#b5de2b",
    "#b8de29",
    "#bade28",
    "#bddf26",
    "#c0df25",
    "#c2df23",
    "#c5e021",
    "#c8e020",
    "#cae11f",
    "#cde11d",
    "#d0e11c",
    "#d2e21b",
    "#d5e21a",
    "#d8e219",
    "#dae319",
    "#dde318",
    "#dfe318",
    "#e2e418",
    "#e5e419",
    "#e7e419",
    "#eae51a",
    "#ece51b",
    "#efe51c",
    "#f1e51d",
    "#f4e61e",
    "#f6e620",
    "#f8e621",
    "#fbe723",
    "#fde725",
  ])
@lydell
Copy link
Owner

lydell commented Oct 18, 2020

Hi!

I tried to achieve that with your lib but line breaks right now seem to be all or nothing.

Yep, that’s exactly how it works. All or nothing.

I consider this library to be done. I’m not interested in changing how it works or adding options.

I hope you’ll find something that suits your needs eventually! If not, it sounds like a fun exercise to write it yourself.

@lydell lydell closed this as completed Oct 18, 2020
@breck7
Copy link
Author

breck7 commented Oct 20, 2020

Makes sense! Thanks for responding! If I still want it in a week I'll write it :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants