Enable unicorn/no-duplicate-loops rule (#19370)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-06-16 03:55:19 +08:00
1 parent ba5261dc0c
commit cf5dec976a
3 files changed
+11 -6

No files matched your search

-1
View File
@@ -322,7 +322,6 @@ const configs = [
"unicorn/prefer-unicode-code-point-escapes": "off",
"unicorn/no-negated-array-predicate": "off",
"unicorn/no-break-in-nested-loop": "off",
"unicorn/no-duplicate-loops": "off",
"unicorn/no-declarations-before-early-exit": "off",
"unicorn/no-negated-comparison": "off",
"unicorn/prefer-early-return": "off",
+6 -2
View File
@@ -136,8 +136,12 @@ function printJestEachTemplateLiteral(path, options, print) {
{ cells: headerNames },
...tableBody.filter((row) => row.cells.length > 0),
];
for (const { cells } of table.filter((row) => !row.hasLineBreak)) {
for (const [index, cell] of cells.entries()) {
for (const row of table) {
if (row.hasLineBreak) {
continue;
}
for (const [index, cell] of row.cells.entries()) {
maxColumnWidths[index] = Math.max(
maxColumnWidths[index],
getStringWidth(cell),
+5 -3
View File
@@ -30,9 +30,11 @@ function setup(props, { slots }) {
// Should not trigger format when these changes
const ignoredKeys = new Set(["showSidebar", "showInput"]);
for (const key of Object.keys(settings).filter(
(key) => !ignoredKeys.has(key),
)) {
for (const key of Object.keys(settings)) {
if (ignoredKeys.has(key)) {
continue;
}
watch(
() => settings[key],
(newValue, oldValue) => {