Skip to content

Commit 550d9f1

Browse files
authored
chore: update ESLint config (#4091)
1 parent 603dddc commit 550d9f1

38 files changed

Lines changed: 618 additions & 594 deletions

package-lock.json

Lines changed: 453 additions & 425 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@
6868
"@emotion/react": "^11.14.0",
6969
"@emotion/styled": "^11.14.1",
7070
"@hookform/resolvers": "^5.2.2",
71-
"@tanstack/react-form": "^1.28.6",
71+
"@tanstack/react-form": "^1.29.0",
7272
"@tanstack/react-table": "^8.21.3",
73-
"@zakodium/nmr-types": "^0.5.5",
74-
"@zakodium/nmrium-core": "^0.7.8",
75-
"@zakodium/nmrium-core-plugins": "^0.7.11",
73+
"@zakodium/nmr-types": "^0.5.7",
74+
"@zakodium/nmrium-core": "^0.7.11",
75+
"@zakodium/nmrium-core-plugins": "^0.7.14",
7676
"@zakodium/pdnd-esm": "^1.0.2",
7777
"@zip.js/zip.js": "^2.8.26",
78-
"cheminfo-font": "^1.25.0",
78+
"cheminfo-font": "^1.26.0",
7979
"cheminfo-types": "^1.15.0",
8080
"clipboard-polyfill": "^4.1.1",
8181
"d3-array": "^3.2.4",
@@ -89,16 +89,16 @@
8989
"get-jpaths": "^1.4.0",
9090
"immer": "^11.1.4",
9191
"lodash": "^4.18.1",
92-
"mf-parser": "^3.8.0",
93-
"ml-array-mean": "^1.1.6",
94-
"ml-array-median": "^1.1.6",
92+
"mf-parser": "^3.9.0",
93+
"ml-array-mean": "^2.0.0",
94+
"ml-array-median": "^2.0.0",
9595
"ml-conrec": "^5.0.3",
9696
"ml-gsd": "^13.1.1",
9797
"ml-signal-processing": "^2.2.0",
98-
"ml-spectra-processing": "^14.23.0",
98+
"ml-spectra-processing": "^14.27.0",
9999
"ml-tree-similarity": "^2.2.0",
100100
"nmr-correlation": "2.3.3",
101-
"nmr-processing": "^22.8.1",
101+
"nmr-processing": "^22.8.2",
102102
"numeral": "^2.0.6",
103103
"openchemlib": "^9.22.0",
104104
"openchemlib-utils": "^8.15.0",
@@ -143,22 +143,22 @@
143143
"@vitest/coverage-v8": "^4.1.4",
144144
"@zakodium/tsconfig": "^1.0.5",
145145
"cross-env": "^10.1.0",
146-
"cspell": "^9.7.0",
146+
"cspell": "^10.0.0",
147147
"eslint": "^9.39.2",
148-
"eslint-config-cheminfo-react": "^19.2.0",
149-
"eslint-config-cheminfo-typescript": "^21.2.0",
150-
"knip": "^6.3.1",
148+
"eslint-config-cheminfo-react": "^20.0.0",
149+
"eslint-config-cheminfo-typescript": "^22.0.0",
150+
"knip": "^6.4.1",
151151
"modern-normalize": "^3.0.1",
152152
"postcss": "^8.5.9",
153153
"postcss-styled-syntax": "^0.7.1",
154-
"prettier": "^3.8.2",
154+
"prettier": "^3.8.3",
155155
"rc-menu": "^9.16.1",
156156
"react": "^18.3.1",
157157
"react-dom": "^18.3.1",
158-
"react-router-dom": "^7.14.0",
158+
"react-router-dom": "^7.14.1",
159159
"rimraf": "^6.1.3",
160160
"serve": "^14.2.6",
161-
"stylelint": "^17.6.0",
161+
"stylelint": "^17.7.0",
162162
"stylelint-config-standard": "^40.0.0",
163163
"typescript": "~6.0.2",
164164
"vite": "^8.0.8",

src/component/1d-2d/tools/BrushXY.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ export default function BrushXY(props: BrushXYProps) {
158158
let x1;
159159

160160
if (brush.type === 'X') {
161-
y1 = Math.max(brushTracker.startY, margin.top);
161+
y1 = Math.max(startY, margin.top);
162162
} else if (brush.type === 'XY') {
163-
y1 = Math.round((brushTracker.endY + brushTracker.startY) / 2);
163+
y1 = Math.round((endY + startY) / 2);
164164
}
165165
if (brush.type === 'Y') {
166-
x1 = Math.max(brushTracker.startX, margin.left);
166+
x1 = Math.max(startX, margin.left);
167167
} else if (brush.type === 'XY') {
168-
x1 = Math.round((brushTracker.endX + brushTracker.startX) / 2);
168+
x1 = Math.round((endX + startX) / 2);
169169
}
170170

171171
const invScaleX = 1 / scaleX;
@@ -247,8 +247,8 @@ export default function BrushXY(props: BrushXYProps) {
247247

248248
if (scaleX === 0 || scaleY === 0) return;
249249

250-
const centerX = Math.round((brushTracker.endX + brushTracker.startX) / 2);
251-
const centerY = Math.round((brushTracker.endY + brushTracker.startY) / 2);
250+
const centerX = Math.round((endX + startX) / 2);
251+
const centerY = Math.round((endY + startY) / 2);
252252

253253
return (
254254
<div

src/component/1d/multiplicityTree/MultiplicityTree.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function Tree(props: TreeProps) {
8585
assignment: assignmentLabel,
8686
},
8787
} = props;
88-
const { from, to, id: rangeID } = range;
88+
const { from, to, id: rangeId } = range;
8989
const { width } = useChartData();
9090
const { scaleX, shiftY } = useScaleChecked();
9191
const dispatch = useDispatch();
@@ -95,7 +95,7 @@ function Tree(props: TreeProps) {
9595
const assignment = useAssignment(signalKey);
9696
const highlight = useHighlight(extractID(signalKey, assignment), {
9797
type: 'SIGNAL_1D',
98-
extra: { id: signalKey, rangeId: rangeID },
98+
extra: { id: signalKey, rangeId },
9999
});
100100

101101
let widthRatio: number;
@@ -135,7 +135,7 @@ function Tree(props: TreeProps) {
135135
isUnAssignLabelButtonVisible: !!assignmentLabel,
136136
onAssign: assignHandler,
137137
onUnAssign: unAssignHandler,
138-
rangeId: range.id,
138+
rangeId,
139139
});
140140

141141
if (!multiplicity) return null;
@@ -149,7 +149,7 @@ function Tree(props: TreeProps) {
149149
dispatch({
150150
type: 'UNASSIGN_1D_SIGNAL',
151151
payload: {
152-
rangeKey: range.id,
152+
rangeKey: rangeId,
153153
signalIndex,
154154
},
155155
});

src/component/1d/ranges/Range.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function Range(options: RangeProps) {
116116
dispatch({
117117
type: 'UNASSIGN_1D_SIGNAL',
118118
payload: {
119-
rangeKey: range.id,
119+
rangeKey: id,
120120
signalIndex: 0,
121121
},
122122
});
@@ -141,7 +141,7 @@ function Range(options: RangeProps) {
141141
isUnAssignLabelButtonVisible: hasOnlyOneSignal && !!signal.assignment,
142142
onAssign: assignHandler,
143143
onUnAssign: unAssignHandler,
144-
rangeId: range.id,
144+
rangeId: id,
145145
});
146146

147147
const isOpen = isAssignBtnTrigged.current ? isAssignmentActive : undefined;
@@ -200,7 +200,7 @@ function Range(options: RangeProps) {
200200
fill={isHighlighted || isActive ? '#ff6f0057' : 'transparent'}
201201
data-no-export="true"
202202
/>
203-
{range.signals.map((signal) => (
203+
{signals.map((signal) => (
204204
<AssignmentLabel
205205
key={signal.id}
206206
stackIndex={signalsStackIndexes?.[signal.id] || 0}

src/component/2d/utilities/extractSpectrumSignals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ export function extractSpectrumSignals<T extends object = object>(
3939
const { signals = [] } = range;
4040
let index = 0;
4141
for (const signal of signals) {
42-
const { kind } = signal;
42+
const { kind, assignment } = signal;
4343
if (kind && signalKindsToInclude.has(kind)) {
4444
result.push({
4545
...signal,
46-
assignment: index === 0 ? signal.assignment : '',
46+
assignment: index === 0 ? assignment : '',
4747
...include?.(range),
4848
} as ExtractedSignal<T>);
4949
index++;

src/component/2d/zones/SignalsGuideLines.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ function useSignalsOverlap(axis: IndicationLinesAxis, spectrum: Spectrum1D) {
7474
const isOverXAxis = axis === 'x';
7575

7676
const processedSignals: ProcessedSignal[] = signals.map((signal) => {
77-
const { delta } = signal;
78-
const text = signal.assignment ?? '';
77+
const { delta, assignment } = signal;
78+
const text = assignment ?? '';
7979
const labelWidth = getTextWidth(text);
8080

8181
return {

src/component/EventsTrackers/BrushTracker.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,17 @@ export function BrushTracker(options: BrushTrackerProps) {
250250

251251
function moveCallback(event: globalThis.PointerEvent) {
252252
isDraggingRef.current = true; // set flag to true to skip click event if the user dragged the mouse
253-
const { clientX, clientY, shiftKey, altKey, ctrlKey } = event;
253+
const {
254+
clientX,
255+
clientY,
256+
screenX,
257+
screenY,
258+
shiftKey,
259+
altKey,
260+
ctrlKey,
261+
} = event;
254262

255-
if (event.ctrlKey) {
263+
if (ctrlKey) {
256264
if (boundingRectRef.current) {
257265
const boundingRect = boundingRectRef.current;
258266

@@ -281,10 +289,10 @@ export function BrushTracker(options: BrushTrackerProps) {
281289
dispatch({
282290
type: 'MOVE',
283291
payload: {
284-
screenX: event.screenX,
285-
screenY: event.screenY,
286-
clientX: event.clientX,
287-
clientY: event.clientY,
292+
screenX,
293+
screenY,
294+
clientX,
295+
clientY,
288296
},
289297
});
290298
}

src/component/SVGTable.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,9 @@ export function SVGTable<T>(props: SVGTableProps<T>) {
180180
cellBoxProps,
181181
cellTextProps,
182182
_columnOptions: { key: columnKey },
183+
rowSpanGroupKey,
183184
} = col;
184-
const groupKey = col.rowSpanGroupKey
185-
? row?.[col.rowSpanGroupKey]
186-
: '';
185+
const groupKey = rowSpanGroupKey ? row?.[rowSpanGroupKey] : '';
187186
const cellKey = formatKey({
188187
groupKey: String(groupKey),
189188
columnKey,

src/component/elements/ReactTable/Elements/ReactTableRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ function ReactTableRow(props: ReactTableRowPropsWithHighlight) {
123123
const {
124124
column: { style },
125125
isRowSpanned,
126+
rowSpan,
126127
} = cell;
127128
if (isRowSpanned) {
128129
return null;
@@ -131,7 +132,7 @@ function ReactTableRow(props: ReactTableRowPropsWithHighlight) {
131132

132133
return (
133134
<td
134-
rowSpan={cell.rowSpan}
135+
rowSpan={rowSpan}
135136
key={columnKey}
136137
{...otherColumnProps}
137138
onContextMenu={(e) => {

0 commit comments

Comments
 (0)