Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import reactRefresh from "eslint-plugin-react-refresh";
import { globalIgnores } from "eslint/config";
import globals from "globals";
import tseslint from "typescript-eslint";
import sonarJs from "eslint-plugin-sonarjs";

export default tseslint.config([
globalIgnores([
Expand All @@ -18,7 +19,8 @@ export default tseslint.config([
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs["recommended-latest"],
reactRefresh.configs.vite
reactRefresh.configs.vite,
sonarJs.configs.recommended
],
languageOptions: {
ecmaVersion: 2020,
Expand Down Expand Up @@ -64,7 +66,17 @@ export default tseslint.config([
varsIgnorePattern: "^_",
ignoreRestSiblings: true
}
]
],
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-commented-code": "off",
"sonarjs/no-small-switch": "off",
"sonarjs/todo-tag": "off",
"sonarjs/no-nested-functions": "off",
"sonarjs/no-unused-vars": "off",
"sonarjs/no-nested-conditional": "off",
"sonarjs/no-dead-store": "off",
"sonarjs/slow-regex": "off",
"sonarjs/no-duplicated-branches": "off"
}
}
]);
12 changes: 0 additions & 12 deletions lib/global/event-handlers/onDocumentPointerDown.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { Layout, RegisteredGroup } from "../../components/group/types";
import type { RegisteredPanel } from "../../components/panel/types";
import type { RegisteredSeparator } from "../../components/separator/types";
import { read, update } from "../mutableState";
import { findMatchingHitRegions } from "../utils/findMatchingHitRegions";

Expand All @@ -15,22 +13,12 @@ export function onDocumentPointerDown(event: PointerEvent) {

const hitRegions = findMatchingHitRegions(event, mountedGroups);

const groups = new Set<RegisteredGroup>();
const panels = new Set<RegisteredPanel>();
const separators = new Set<RegisteredSeparator>();
const initialLayoutMap = new Map<RegisteredGroup, Layout>();

let didChangeFocus = false;

hitRegions.forEach((current) => {
groups.add(current.group);
current.panels.forEach((panel) => {
panels.add(panel);
});

if (current.separator) {
separators.add(current.separator);

if (!didChangeFocus) {
didChangeFocus = true;

Expand Down
4 changes: 2 additions & 2 deletions lib/global/utils/calculateSeparatorAriaValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export function calculateSeparatorAriaValues({
);
if (constraints) {
const maxSize = constraints.maxSize;
const minSize = (valueMin = constraints.collapsible
const minSize = constraints.collapsible
? constraints.collapsedSize
: constraints.minSize);
: constraints.minSize;

const pivotIndices = [panelIndex, panelIndex + 1];

Expand Down
4 changes: 0 additions & 4 deletions lib/utils/test/mockResizeObserver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { emitter } from "./mockBoundingClientRect";

const elementToDOMRect = new Map<HTMLElement, DOMRect>();

let disabled: boolean = false;

export function disableResizeObserverForCurrentTest() {
Expand All @@ -24,8 +22,6 @@ export function mockResizeObserver() {
window.ResizeObserver = originalResizeObserver;

disabled = false;

elementToDOMRect.clear();
};
}

Expand Down
6 changes: 2 additions & 4 deletions lib/vendor/stacking-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ export function compare(

// remove shared ancestors
while (ancestors.a.at(-1) === ancestors.b.at(-1)) {
a = ancestors.a.pop() as HTMLElement;
b = ancestors.b.pop() as HTMLElement;

common_ancestor = a;
common_ancestor = ancestors.a.pop() as HTMLElement;
ancestors.b.pop();
}

assert(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"@types/node": "^24.2.0",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.2.3",
"@types/sharp": "^0.32.0",
"@vitejs/plugin-react-swc": "^3.10.2",
"bytes": "^3.1.2",
"clsx": "^2.1.1",
Expand All @@ -79,6 +78,7 @@
"eslint": "^9.30.1",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"eslint-plugin-sonarjs": "^3.0.6",
"express": "^5.1.0",
"globals": "^16.3.0",
"husky": "^9.1.7",
Expand Down
89 changes: 75 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const commonQuestions: CommonQuestion[] = [
ResizeObserver
</ExternalLink>{" "}
API, either through a hook like{" "}
<ExternalLink href="http://npmjs.com/package/use-resize-observer">
<ExternalLink href="https://npmjs.com/package/use-resize-observer">
useResizeObserver
</ExternalLink>{" "}
or a component like{" "}
Expand Down
Loading