update: add lint script to package.json

* lint files
This commit is contained in:
Braks
2021-07-09 19:21:29 +02:00
parent 179b5c5d4d
commit 65332cfde3
5 changed files with 12 additions and 8 deletions
+2 -1
View File
@@ -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
View File
@@ -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",
+1 -1
View File
@@ -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
View File
@@ -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';
+4 -3
View File
@@ -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;
} }