Files
fisker Cheungandautofix-ci[bot] 3149f353d7 Enable unicorn/prefer-string-repeat rule (#19306)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-08 18:16:28 +08:00

44 lines
890 B
JavaScript

import prettier from "../../../config/prettier-entry.js";
const parsers = (await prettier.getSupportInfo()).options
.find((option) => option.name === "parser")
.choices.filter((choice) => !choice.deprecated)
.map((choice) => choice.value);
runFormatTest(
{
importMeta: import.meta,
snippets: [
// empty
"",
// space
" ",
" ".repeat(5),
// `\n`
"\n",
" \n",
" \n ",
"\n".repeat(4),
" \n \n \n\n",
" \n \n \n\n ",
// `\r`
"\r",
" \r",
" \r ",
"\r".repeat(4),
" \r \r \r\r",
" \r \r \r\r ",
// `\r\n`
"\r\n",
" \r\n",
" \r\n ",
"\r\n\r\n\r\n\r\n",
" \r\n \r\n \r\n\r\n",
" \r\n \r\n \r\n\r\n ",
// mixed `\r` `\r\n` '\n'
" \r \r\n \n ",
].map((code) => ({ code, output: "" })),
},
parsers,
);