From f011ea61b11189d6ead8be8065230fa2f531b316 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sat, 9 Apr 2022 23:38:25 +0200 Subject: [PATCH] chore: Remove unused eslint-rules & lint files --- .eslintrc.js | 10 ---------- package/src/types/node.ts | 2 ++ .../cypress/integration/1-store/setElements.spec.ts | 1 - tests/cypress/integration/1-store/setState.spec.ts | 4 +--- tests/cypress/integration/2-flow/container.spec.ts | 13 ++++++++----- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 13a0fd9e..c15ec840 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,14 +1,4 @@ const baseRules = { - '@typescript-eslint/triple-slash-reference': 0, - 'no-console': 0, - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - 'no-unused-expressions': ['off', { allowTernary: true }], - 'no-use-before-define': 0, 'chai-friendly/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }], 'prettier/prettier': ['error', {}, { usePrettierrc: true }], } diff --git a/package/src/types/node.ts b/package/src/types/node.ts index 8eeb6a69..364731bc 100644 --- a/package/src/types/node.ts +++ b/package/src/types/node.ts @@ -11,7 +11,9 @@ export type NodeHandleBounds = { target?: HandleElement[] } +// eslint-disable-next-line no-use-before-define type WidthFunc = (node: GraphNode) => number | string | void +// eslint-disable-next-line no-use-before-define type HeightFunc = (node: GraphNode) => number | string | void export interface Node extends Element { diff --git a/tests/cypress/integration/1-store/setElements.spec.ts b/tests/cypress/integration/1-store/setElements.spec.ts index fb2046a5..6b254526 100644 --- a/tests/cypress/integration/1-store/setElements.spec.ts +++ b/tests/cypress/integration/1-store/setElements.spec.ts @@ -30,7 +30,6 @@ describe('test store action setElements', () => { }) it('parses elements to flow-elements', () => { - console.log(store.getEdges) store.getEdges.forEach((edge) => expect(isEdge(edge)).to.be.true) store.getNodes.forEach((node) => expect(isNode(node)).to.be.true) }) diff --git a/tests/cypress/integration/1-store/setState.spec.ts b/tests/cypress/integration/1-store/setState.spec.ts index 0b4196a3..5077333b 100644 --- a/tests/cypress/integration/1-store/setState.spec.ts +++ b/tests/cypress/integration/1-store/setState.spec.ts @@ -6,9 +6,7 @@ describe('test store state', () => { const { store: initial } = useVueFlow() beforeEach(() => ({ store } = useVueFlow())) - it('has any initial state', () => { - expect(store).to.exist - }) + it('has any initial state', () => expect(store).to.exist) it('has default initial state', () => { Object.keys(store).forEach((state) => { diff --git a/tests/cypress/integration/2-flow/container.spec.ts b/tests/cypress/integration/2-flow/container.spec.ts index aeb980b4..709a9458 100644 --- a/tests/cypress/integration/2-flow/container.spec.ts +++ b/tests/cypress/integration/2-flow/container.spec.ts @@ -39,9 +39,12 @@ describe('Render VueFlow', () => { cy.get('.vue-flow__node').each((node) => expect(elements.some((el) => el.label === node.text())).to.be.true)) it('renders nodes at correct position', () => - cy.get('.vue-flow__node').each((node) => { - expect( - elements.filter(isNode).some((el) => el.position.x === node.position().left && el.position.y === node.position().top), - ).to.be.true - })) + cy + .get('.vue-flow__node') + .each( + (node) => + expect( + elements.filter(isNode).some((el) => el.position.x === node.position().left && el.position.y === node.position().top), + ).to.be.true, + )) })