Commit 22171094 authored by Petr D. Svoboda's avatar Petr D. Svoboda

Fix linting

parent ad052c34
......@@ -2,7 +2,7 @@ import uuid from 'uuid'
import Data from './Data'
import Map from './Map'
import Position, { toPosition } from './Position'
import Position from './Position'
import State from './State'
import Transition from './Transition'
......
const uuid = jest.genMockFromModule('uuid')
const uuid = jest.genMockFromModule<{ v4: () => string }>('uuid')
let id = 1
function getid() {
......
......@@ -113,7 +113,9 @@ function topologicalSort(graph: Graph): Graph {
graph.vertices[v].layer = layerIndex
}
// eslint-disable-next-line no-loop-func
vertices = vertices.filter(v => !initial.includes(v))
// eslint-disable-next-line no-loop-func
edges = edges.filter(e => !initial.includes(e.from))
initial = getInitialStates(edges, vertices)
layerIndex++
......@@ -281,6 +283,7 @@ function transposeLayer(graph: Graph): Graph {
while (improved) {
improved = false
// eslint-disable-next-line no-loop-func
graph.layers = graph.layers.map((layer, index) => {
for (let i = 0; i < layer.length - 2; i++) {
const curr = layer[i]
......
......@@ -28,12 +28,6 @@ interface Graph {
edges: Edge[]
layers: string[][]
}
const medianSort = (a: Vertex, b: Vertex) =>
a.medianCrossing !== undefined && b.medianCrossing !== undefined
? a.medianCrossing - b.medianCrossing
: 0
function setEdgeMakesCycle(graph: Graph, edge: Edge): Graph {
graph.edges = graph.edges.reduce<Edge[]>(
(acc, curr) => [
......@@ -88,7 +82,9 @@ function topologicalSort(graph: Graph): Graph {
graph.vertices[v].layer = layerIndex
}
// eslint-disable-next-line no-loop-func
vertices = vertices.filter(v => !initial.includes(v))
// eslint-disable-next-line no-loop-func
edges = edges.filter(e => !initial.includes(e.from))
initial = getInitialStates(edges, vertices)
layerIndex++
......@@ -260,6 +256,7 @@ function transposeLayer(graph: Graph): Graph {
while (improved) {
improved = false
// eslint-disable-next-line no-loop-func
graph.layers = graph.layers.map((layer, index) => {
for (let i = 0; i < layer.length - 2; i++) {
const curr = layer[i]
......
......@@ -16,5 +16,6 @@
"jsx": "preserve",
"types": ["jest"]
},
"include": ["src"]
"include": ["src"],
"exclude": ["**/__mocks__"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment