diff --git a/.eslintrc.js b/.eslintrc.js index 68a0668e..bca4331d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,9 +2,10 @@ const baseRules = { '@typescript-eslint/no-explicit-any': 0, '@typescript-eslint/ban-ts-ignore': 0, '@typescript-eslint/ban-ts-comment': 0, + '@typescript-eslint/no-empty-function': 0, 'no-use-before-define': 0, 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': ['error'], + '@typescript-eslint/no-unused-vars': ['warn'], indent: ['warn', 2, { SwitchCase: 1, flatTernaryExpressions: true }], quotes: ['error', 'single', { avoidEscape: true }], semi: ['error', 'always'], diff --git a/package.json b/package.json index 5af020dd..044a3301 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,10 @@ "build": "vue-tsc --noEmit && vite build", "build:dist": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist", "serve": "vite preview", - "prepublishOnly": "yarn build:dist", - "test": "exit 0" + "prepublishOnly": "yarn lint && yarn build:dist", + "test": "exit 0", + "lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .", + "lint": "yarn lint:js" }, "dependencies": { "d3": "^7.0.0", diff --git a/src/container/NodeRenderer/index.tsx b/src/container/NodeRenderer/index.tsx index 23ba4919..68a511c4 100644 --- a/src/container/NodeRenderer/index.tsx +++ b/src/container/NodeRenderer/index.tsx @@ -137,7 +137,7 @@ const NodeRenderer = defineComponent({ {visibleNodes.value.map((node) => { const nodeType = node.type || 'default'; if (props.nodeTypes) { - const NodeComponent: any = (props.nodeTypes[nodeType] || props.nodeTypes.default); + const NodeComponent: any = props.nodeTypes[nodeType] || props.nodeTypes.default; if (!props.nodeTypes[nodeType]) { console.warn(`Node type "${nodeType}" not found. Using fallback type "default".`); } diff --git a/src/index.ts b/src/index.ts index 21ea0469..0c7b355c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,7 @@ export { getConnectedEdges, updateEdge, getTransformForBounds, - getRectOfNodes, + getRectOfNodes } from './utils/graph'; export { default as useZoomPanHelper } from './hooks/useZoomPanHelper'; export { default as useUpdateNodeInternals } from './hooks/useUpdateNodeInternals'; diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts index ac1ded79..9a8de2df 100644 --- a/src/shims-vue.d.ts +++ b/src/shims-vue.d.ts @@ -1,5 +1,6 @@ declare module '*.vue' { - import { DefineComponent } from 'vue' - const component: DefineComponent<{}, {}, any> - export default component + import { DefineComponent } from 'vue'; + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any>; + export default component; }