update: add lint script to package.json
* lint files
This commit is contained in:
+2
-1
@@ -2,9 +2,10 @@ const baseRules = {
|
|||||||
'@typescript-eslint/no-explicit-any': 0,
|
'@typescript-eslint/no-explicit-any': 0,
|
||||||
'@typescript-eslint/ban-ts-ignore': 0,
|
'@typescript-eslint/ban-ts-ignore': 0,
|
||||||
'@typescript-eslint/ban-ts-comment': 0,
|
'@typescript-eslint/ban-ts-comment': 0,
|
||||||
|
'@typescript-eslint/no-empty-function': 0,
|
||||||
'no-use-before-define': 0,
|
'no-use-before-define': 0,
|
||||||
'no-unused-vars': 'off',
|
'no-unused-vars': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': ['error'],
|
'@typescript-eslint/no-unused-vars': ['warn'],
|
||||||
indent: ['warn', 2, { SwitchCase: 1, flatTernaryExpressions: true }],
|
indent: ['warn', 2, { SwitchCase: 1, flatTernaryExpressions: true }],
|
||||||
quotes: ['error', 'single', { avoidEscape: true }],
|
quotes: ['error', 'single', { avoidEscape: true }],
|
||||||
semi: ['error', 'always'],
|
semi: ['error', 'always'],
|
||||||
|
|||||||
+4
-2
@@ -20,8 +20,10 @@
|
|||||||
"build": "vue-tsc --noEmit && vite build",
|
"build": "vue-tsc --noEmit && vite build",
|
||||||
"build:dist": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist",
|
"build:dist": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist",
|
||||||
"serve": "vite preview",
|
"serve": "vite preview",
|
||||||
"prepublishOnly": "yarn build:dist",
|
"prepublishOnly": "yarn lint && yarn build:dist",
|
||||||
"test": "exit 0"
|
"test": "exit 0",
|
||||||
|
"lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .",
|
||||||
|
"lint": "yarn lint:js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"d3": "^7.0.0",
|
"d3": "^7.0.0",
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ const NodeRenderer = defineComponent({
|
|||||||
{visibleNodes.value.map((node) => {
|
{visibleNodes.value.map((node) => {
|
||||||
const nodeType = node.type || 'default';
|
const nodeType = node.type || 'default';
|
||||||
if (props.nodeTypes) {
|
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]) {
|
if (!props.nodeTypes[nodeType]) {
|
||||||
console.warn(`Node type "${nodeType}" not found. Using fallback type "default".`);
|
console.warn(`Node type "${nodeType}" not found. Using fallback type "default".`);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ export {
|
|||||||
getConnectedEdges,
|
getConnectedEdges,
|
||||||
updateEdge,
|
updateEdge,
|
||||||
getTransformForBounds,
|
getTransformForBounds,
|
||||||
getRectOfNodes,
|
getRectOfNodes
|
||||||
} from './utils/graph';
|
} from './utils/graph';
|
||||||
export { default as useZoomPanHelper } from './hooks/useZoomPanHelper';
|
export { default as useZoomPanHelper } from './hooks/useZoomPanHelper';
|
||||||
export { default as useUpdateNodeInternals } from './hooks/useUpdateNodeInternals';
|
export { default as useUpdateNodeInternals } from './hooks/useUpdateNodeInternals';
|
||||||
|
|||||||
Vendored
+4
-3
@@ -1,5 +1,6 @@
|
|||||||
declare module '*.vue' {
|
declare module '*.vue' {
|
||||||
import { DefineComponent } from 'vue'
|
import { DefineComponent } from 'vue';
|
||||||
const component: DefineComponent<{}, {}, any>
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
export default component
|
const component: DefineComponent<{}, {}, any>;
|
||||||
|
export default component;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user