chore(lint): cleanup minor issues

This commit is contained in:
moklick
2024-06-11 17:19:58 +02:00
parent 59c5d47130
commit e6b21d372e
8 changed files with 29 additions and 24 deletions

View File

@@ -14,11 +14,10 @@
"test:svelte:ui": "pnpm --filter=playwright run test:svelte:ui",
"test:react": "pnpm --filter=playwright run test:react",
"test:react:ui": "pnpm --filter=playwright run test:react:ui",
"build": "turbo run build",
"build:libs": "turbo run build --filter=./packages/**",
"test": "turbo run test",
"lint": "turbo run lint",
"typecheck": "turbo run typecheck",
"build:all": "turbo run build",
"build": "turbo run build --filter=./packages/**",
"lint": "turbo run lint --filter=./packages/**",
"typecheck": "turbo run typecheck --filter=./packages/**",
"release": "changeset publish",
"clean": "pnpm -r --parallel exec rimraf dist .turbo node_modules"
},

View File

@@ -18,7 +18,7 @@
- add `on:edgemouseenter` and `on:edgemouseleave` event handler
- fix deselection of edges
- remove pointer events from panel when user selection is active
- fix viewport initialization with user viewport
- fix viewport initialization with user viewport
- fix parent node lookup in `evaluateAbsolutePosition`- thanks @lcsfort
## 0.1.3
@@ -42,16 +42,16 @@ This is a bigger update for Svelte Flow to keep up with the latest changes we ma
- rename `node.computed` to `node.measured` - this attribute only includes `width` and `height` and no `positionAbsolute` anymore. For this we added the helpers `getInternalNode` and `useInternalNode`
- rename `node.parentNode` to `node.parentId`
### More updates:
### More updates:
- add `isValidConnection` for `<Handle />` component
- add `fitViewOptions` for `<Controls />` component
- add `getInternalNode` to `useSvelteFlow`
- add `useInternalNode` hook
- don't reset nodes and edges when svelte flow unmounts - thanks @darabos
- don't reset nodes and edges when svelte flow unmounts - thanks @darabos
- fix node event types - thanks @RedPhoenixQ
- make handleId and isTarget reactive - thanks @darabos
- fix MiniMap interaction for touch devices
- fix MiniMap interaction for touch devices
- fix pane: pinch zoom on windows
- fix nodes: return user node in node event handlers

View File

@@ -18,8 +18,8 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"css": "postcss src/styles/{base,style}.css --config ./../../tooling/postcss-config --dir dist",
"css-watch": "pnpm css --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"lint": "prettier --check . && eslint ./src",
"format": "prettier --write .",
"typecheck": "pnpm check"
},
"type": "module",

View File

@@ -1,6 +1,7 @@
<script lang="ts">
import type { NodeProps } from '$lib/types';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface $$Props extends NodeProps {}
// this is a workaround for suppressing the warning about unused props

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { getContext } from 'svelte';
import { getNodesBounds, Position, type Rect, getNodeToolbarTransform } from '@xyflow/system';
import { getNodesBounds, Position, getNodeToolbarTransform } from '@xyflow/system';
import portal from '$lib/actions/portal';
import type { InternalNode } from '$lib/types';
import { useStore } from '$lib/store';

View File

@@ -38,6 +38,7 @@ export function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMi
zoomable = true,
inversePan = false,
}: XYMinimapUpdate) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const zoomHandler = (event: D3ZoomEvent<SVGSVGElement, any>) => {
const transform = getTransform();
@@ -55,6 +56,7 @@ export function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMi
};
let panStart = [0, 0];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const panStartHandler = (event: D3ZoomEvent<HTMLDivElement, any>) => {
if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') {
panStart = [
@@ -64,6 +66,7 @@ export function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMi
}
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const panHandler = (event: D3ZoomEvent<HTMLDivElement, any>) => {
const transform = getTransform();
@@ -101,8 +104,10 @@ export function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMi
const zoomAndPanHandler = zoom()
.on('start', panStartHandler)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
.on('zoom', pannable ? panHandler : null)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
.on('zoom.wheel', zoomable ? zoomHandler : null);

20
pnpm-lock.yaml generated
View File

@@ -444,10 +444,10 @@ importers:
specifier: ^8.5.0
version: 8.8.0(eslint@8.43.0)
eslint-config-turbo:
specifier: latest
version: 1.10.15(eslint@8.43.0)
specifier: ^2.0.3
version: 2.0.3(eslint@8.43.0)
eslint-plugin-react:
specifier: latest
specifier: ^7.33.2
version: 7.33.2(eslint@8.43.0)
tooling/rollup-config:
@@ -2923,8 +2923,8 @@ packages:
peerDependencies:
eslint: '>=7.0.0'
eslint-config-turbo@1.10.15:
resolution: {integrity: sha512-76mpx2x818JZE26euen14utYcFDxOahZ9NaWA+6Xa4pY2ezVKVschuOxS96EQz3o3ZRSmcgBOapw/gHbN+EKxQ==}
eslint-config-turbo@2.0.3:
resolution: {integrity: sha512-D1+lNOpTFEuAgPWJfRHXHjzvAfO+0TVmORfftmYQNw+uk2UIBjhelhwERBceYFy2oFJnckHsqt69dp/zIM6/0g==}
peerDependencies:
eslint: '>6.6.0'
@@ -2965,8 +2965,8 @@ packages:
svelte:
optional: true
eslint-plugin-turbo@1.10.15:
resolution: {integrity: sha512-Tv4QSKV/U56qGcTqS/UgOvb9HcKFmWOQcVh3HEaj7of94lfaENgfrtK48E2CckQf7amhKs1i+imhCsNCKjkQyA==}
eslint-plugin-turbo@2.0.3:
resolution: {integrity: sha512-mplP4nYaRvtTNuwF5QTLYKLu0/8LTRsHPgX4ARhaof+QZI2ttglONe1/iJpKB4pg0KqFp7WHziKoJL+s0+CJ1w==}
peerDependencies:
eslint: '>6.6.0'
@@ -8980,10 +8980,10 @@ snapshots:
dependencies:
eslint: 8.57.0
eslint-config-turbo@1.10.15(eslint@8.43.0):
eslint-config-turbo@2.0.3(eslint@8.43.0):
dependencies:
eslint: 8.43.0
eslint-plugin-turbo: 1.10.15(eslint@8.43.0)
eslint-plugin-turbo: 2.0.3(eslint@8.43.0)
eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0(eslint@8.43.0))(eslint@8.43.0)(prettier@2.8.8):
dependencies:
@@ -9055,7 +9055,7 @@ snapshots:
- supports-color
- ts-node
eslint-plugin-turbo@1.10.15(eslint@8.43.0):
eslint-plugin-turbo@2.0.3(eslint@8.43.0):
dependencies:
dotenv: 16.0.3
eslint: 8.43.0

View File

@@ -7,7 +7,7 @@
"devDependencies": {
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-turbo": "latest",
"eslint-plugin-react": "latest"
"eslint-config-turbo": "^2.0.3",
"eslint-plugin-react": "^7.33.2"
}
}