Fix lint warnings (#289)
This commit is contained in:
@ -79,7 +79,6 @@ export function App() {
|
|||||||
setIsStreamReady,
|
setIsStreamReady,
|
||||||
isStreamReady,
|
isStreamReady,
|
||||||
isMouseDownInStream,
|
isMouseDownInStream,
|
||||||
fileId,
|
|
||||||
cmdId,
|
cmdId,
|
||||||
setCmdId,
|
setCmdId,
|
||||||
token,
|
token,
|
||||||
@ -120,7 +119,6 @@ export function App() {
|
|||||||
isStreamReady: s.isStreamReady,
|
isStreamReady: s.isStreamReady,
|
||||||
setIsStreamReady: s.setIsStreamReady,
|
setIsStreamReady: s.setIsStreamReady,
|
||||||
isMouseDownInStream: s.isMouseDownInStream,
|
isMouseDownInStream: s.isMouseDownInStream,
|
||||||
fileId: s.fileId,
|
|
||||||
cmdId: s.cmdId,
|
cmdId: s.cmdId,
|
||||||
setCmdId: s.setCmdId,
|
setCmdId: s.setCmdId,
|
||||||
token: s.token,
|
token: s.token,
|
||||||
|
@ -11,7 +11,6 @@ import { SetAngleLength } from './components/Toolbar/setAngleLength'
|
|||||||
import { ConvertToVariable } from './components/Toolbar/ConvertVariable'
|
import { ConvertToVariable } from './components/Toolbar/ConvertVariable'
|
||||||
import { SetAbsDistance } from './components/Toolbar/SetAbsDistance'
|
import { SetAbsDistance } from './components/Toolbar/SetAbsDistance'
|
||||||
import { SetAngleBetween } from './components/Toolbar/SetAngleBetween'
|
import { SetAngleBetween } from './components/Toolbar/SetAngleBetween'
|
||||||
import { ExportButton } from './components/ExportButton'
|
|
||||||
|
|
||||||
export const Toolbar = () => {
|
export const Toolbar = () => {
|
||||||
const {
|
const {
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
findUniqueName,
|
findUniqueName,
|
||||||
} from '../lang/modifyAst'
|
} from '../lang/modifyAst'
|
||||||
import { findAllPreviousVariables, PrevVariable } from '../lang/queryAst'
|
import { findAllPreviousVariables, PrevVariable } from '../lang/queryAst'
|
||||||
import { lexer } from '../lang/tokeniser'
|
|
||||||
import { useStore } from '../useStore'
|
import { useStore } from '../useStore'
|
||||||
|
|
||||||
export const AvailableVars = ({
|
export const AvailableVars = ({
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { fireEvent, render, screen } from '@testing-library/react'
|
import { fireEvent, render, screen } from '@testing-library/react'
|
||||||
import { User } from '../useStore'
|
|
||||||
import { BrowserRouter } from 'react-router-dom'
|
import { BrowserRouter } from 'react-router-dom'
|
||||||
import ProjectSidebarMenu from './ProjectSidebarMenu'
|
import ProjectSidebarMenu from './ProjectSidebarMenu'
|
||||||
import { ProjectWithEntryPointMetadata } from '../Router'
|
import { ProjectWithEntryPointMetadata } from '../Router'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Dialog, Transition } from '@headlessui/react'
|
import { Dialog, Transition } from '@headlessui/react'
|
||||||
import { Fragment, useState } from 'react'
|
import { Fragment } from 'react'
|
||||||
import { useCalc, CreateNewVariable } from './AvailableVarsHelpers'
|
import { useCalc, CreateNewVariable } from './AvailableVarsHelpers'
|
||||||
|
|
||||||
export const SetVarNameModal = ({
|
export const SetVarNameModal = ({
|
||||||
|
@ -20,8 +20,6 @@ export const Stream = ({ className = '' }) => {
|
|||||||
mediaStream,
|
mediaStream,
|
||||||
engineCommandManager,
|
engineCommandManager,
|
||||||
setIsMouseDownInStream,
|
setIsMouseDownInStream,
|
||||||
fileId,
|
|
||||||
setFileId,
|
|
||||||
setCmdId,
|
setCmdId,
|
||||||
didDragInStream,
|
didDragInStream,
|
||||||
setDidDragInStream,
|
setDidDragInStream,
|
||||||
@ -32,7 +30,6 @@ export const Stream = ({ className = '' }) => {
|
|||||||
isMouseDownInStream: s.isMouseDownInStream,
|
isMouseDownInStream: s.isMouseDownInStream,
|
||||||
setIsMouseDownInStream: s.setIsMouseDownInStream,
|
setIsMouseDownInStream: s.setIsMouseDownInStream,
|
||||||
fileId: s.fileId,
|
fileId: s.fileId,
|
||||||
setFileId: s.setFileId,
|
|
||||||
setCmdId: s.setCmdId,
|
setCmdId: s.setCmdId,
|
||||||
didDragInStream: s.didDragInStream,
|
didDragInStream: s.didDragInStream,
|
||||||
setDidDragInStream: s.setDidDragInStream,
|
setDidDragInStream: s.setDidDragInStream,
|
||||||
@ -48,9 +45,8 @@ export const Stream = ({ className = '' }) => {
|
|||||||
if (!videoRef.current) return
|
if (!videoRef.current) return
|
||||||
if (!mediaStream) return
|
if (!mediaStream) return
|
||||||
videoRef.current.srcObject = mediaStream
|
videoRef.current.srcObject = mediaStream
|
||||||
setFileId(uuidv4())
|
|
||||||
setZoom(videoRef.current.getBoundingClientRect().height / 2)
|
setZoom(videoRef.current.getBoundingClientRect().height / 2)
|
||||||
}, [mediaStream, engineCommandManager, setFileId])
|
}, [mediaStream, engineCommandManager])
|
||||||
|
|
||||||
const handleMouseDown: MouseEventHandler<HTMLVideoElement> = ({
|
const handleMouseDown: MouseEventHandler<HTMLVideoElement> = ({
|
||||||
clientX,
|
clientX,
|
||||||
|
@ -7,7 +7,6 @@ import { useNavigate } from 'react-router-dom'
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { paths } from '../Router'
|
import { paths } from '../Router'
|
||||||
import makeUrlPathRelative from '../lib/makeUrlPathRelative'
|
import makeUrlPathRelative from '../lib/makeUrlPathRelative'
|
||||||
import { ExportButton } from './ExportButton'
|
|
||||||
|
|
||||||
const UserSidebarMenu = ({ user }: { user?: User }) => {
|
const UserSidebarMenu = ({ user }: { user?: User }) => {
|
||||||
const displayedName = getDisplayName(user)
|
const displayedName = getDisplayName(user)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { parser_wasm } from './abstractSyntaxTree'
|
import { parser_wasm } from './abstractSyntaxTree'
|
||||||
import { initPromise } from './rust'
|
import { initPromise } from './rust'
|
||||||
import { enginelessExecutor, executor } from '../lib/testHelpers'
|
import { enginelessExecutor } from '../lib/testHelpers'
|
||||||
|
|
||||||
beforeAll(() => initPromise)
|
beforeAll(() => initPromise)
|
||||||
|
|
||||||
|
@ -543,7 +543,7 @@ export const _executor = async (
|
|||||||
}
|
}
|
||||||
_programMemory.return = expression.arguments as any // todo memory redo
|
_programMemory.return = expression.arguments as any // todo memory redo
|
||||||
} else {
|
} else {
|
||||||
if (_programMemory.root[functionName] == undefined) {
|
if (_programMemory.root[functionName] === undefined) {
|
||||||
throw new KCLSemanticError(`No such name ${functionName} defined`, [
|
throw new KCLSemanticError(`No such name ${functionName} defined`, [
|
||||||
[statement.start, statement.end],
|
[statement.start, statement.end],
|
||||||
])
|
])
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
isTypeInValue,
|
isTypeInValue,
|
||||||
getNodePathFromSourceRange,
|
getNodePathFromSourceRange,
|
||||||
} from './queryAst'
|
} from './queryAst'
|
||||||
import { lexer } from './tokeniser'
|
|
||||||
import { initPromise } from './rust'
|
import { initPromise } from './rust'
|
||||||
import { enginelessExecutor } from '../lib/testHelpers'
|
import { enginelessExecutor } from '../lib/testHelpers'
|
||||||
import {
|
import {
|
||||||
|
@ -134,7 +134,6 @@ show(mySketch001)`
|
|||||||
|
|
||||||
describe('testing addNewSketchLn', () => {
|
describe('testing addNewSketchLn', () => {
|
||||||
const lineToChange = 'lineTo([-1.59, -1.54], %)'
|
const lineToChange = 'lineTo([-1.59, -1.54], %)'
|
||||||
const lineAfterChange = 'lineTo([2, 3], %)'
|
|
||||||
test('addNewSketchLn', async () => {
|
test('addNewSketchLn', async () => {
|
||||||
// Enable rotations #152
|
// Enable rotations #152
|
||||||
const code = `
|
const code = `
|
||||||
@ -146,6 +145,7 @@ show(mySketch001)`
|
|||||||
const ast = parser_wasm(code)
|
const ast = parser_wasm(code)
|
||||||
const programMemory = await enginelessExecutor(ast)
|
const programMemory = await enginelessExecutor(ast)
|
||||||
const sourceStart = code.indexOf(lineToChange)
|
const sourceStart = code.indexOf(lineToChange)
|
||||||
|
expect(sourceStart).toBe(66)
|
||||||
const { modifiedAst } = addNewSketchLn({
|
const { modifiedAst } = addNewSketchLn({
|
||||||
node: ast,
|
node: ast,
|
||||||
programMemory,
|
programMemory,
|
||||||
|
@ -116,7 +116,7 @@ function makeId(seed: string | any) {
|
|||||||
|
|
||||||
export const lineTo: SketchLineHelper = {
|
export const lineTo: SketchLineHelper = {
|
||||||
fn: (
|
fn: (
|
||||||
{ sourceRange, engineCommandManager, code },
|
{ sourceRange, code },
|
||||||
data:
|
data:
|
||||||
| [number, number]
|
| [number, number]
|
||||||
| {
|
| {
|
||||||
@ -131,10 +131,6 @@ export const lineTo: SketchLineHelper = {
|
|||||||
const from = getCoordsFromPaths(sketchGroup, sketchGroup.value.length - 1)
|
const from = getCoordsFromPaths(sketchGroup, sketchGroup.value.length - 1)
|
||||||
const to = 'to' in data ? data.to : data
|
const to = 'to' in data ? data.to : data
|
||||||
|
|
||||||
const lineData: LineData = {
|
|
||||||
from: [...from, 0],
|
|
||||||
to: [...to, 0],
|
|
||||||
}
|
|
||||||
const id = makeId({
|
const id = makeId({
|
||||||
code,
|
code,
|
||||||
sourceRange,
|
sourceRange,
|
||||||
@ -672,10 +668,6 @@ export const angledLine: SketchLineHelper = {
|
|||||||
from[0] + length * Math.cos((angle * Math.PI) / 180),
|
from[0] + length * Math.cos((angle * Math.PI) / 180),
|
||||||
from[1] + length * Math.sin((angle * Math.PI) / 180),
|
from[1] + length * Math.sin((angle * Math.PI) / 180),
|
||||||
]
|
]
|
||||||
const lineData: LineData = {
|
|
||||||
from: [...from, 0],
|
|
||||||
to: [...to, 0],
|
|
||||||
}
|
|
||||||
const id = makeId({
|
const id = makeId({
|
||||||
code,
|
code,
|
||||||
sourceRange,
|
sourceRange,
|
||||||
|
@ -25,9 +25,8 @@ import {
|
|||||||
lastSegY,
|
lastSegY,
|
||||||
} from './sketchConstraints'
|
} from './sketchConstraints'
|
||||||
import { getExtrudeWallTransform, extrude } from './extrude'
|
import { getExtrudeWallTransform, extrude } from './extrude'
|
||||||
import { SketchGroup, ExtrudeGroup, Position, Rotation } from '../executor'
|
|
||||||
|
|
||||||
import { InternalFn, InternalFnNames, InternalFirstArg } from './stdTypes'
|
import { InternalFn, InternalFnNames } from './stdTypes'
|
||||||
|
|
||||||
// const transform: InternalFn = <T extends SketchGroup | ExtrudeGroup>(
|
// const transform: InternalFn = <T extends SketchGroup | ExtrudeGroup>(
|
||||||
// { sourceRange }: InternalFirstArg,
|
// { sourceRange }: InternalFirstArg,
|
||||||
|
@ -7,7 +7,6 @@ import Units from './Units'
|
|||||||
import Camera from './Camera'
|
import Camera from './Camera'
|
||||||
import Sketching from './Sketching'
|
import Sketching from './Sketching'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { paths } from '../../Router'
|
|
||||||
import makeUrlPathRelative from '../../lib/makeUrlPathRelative'
|
import makeUrlPathRelative from '../../lib/makeUrlPathRelative'
|
||||||
|
|
||||||
export const onboardingPaths = {
|
export const onboardingPaths = {
|
||||||
|
@ -2,7 +2,6 @@ import '@testing-library/jest-dom'
|
|||||||
import { WebSocket } from 'ws'
|
import { WebSocket } from 'ws'
|
||||||
|
|
||||||
class MockRTCPeerConnection {
|
class MockRTCPeerConnection {
|
||||||
constructor() {}
|
|
||||||
createDataChannel() {
|
createDataChannel() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
SourceRange,
|
SourceRange,
|
||||||
} from './lang/executor'
|
} from './lang/executor'
|
||||||
import { recast } from './lang/recast'
|
import { recast } from './lang/recast'
|
||||||
import { asyncLexer } from './lang/tokeniser'
|
|
||||||
import { EditorSelection } from '@codemirror/state'
|
import { EditorSelection } from '@codemirror/state'
|
||||||
import { BaseDirectory } from '@tauri-apps/api/fs'
|
import { BaseDirectory } from '@tauri-apps/api/fs'
|
||||||
import {
|
import {
|
||||||
@ -20,7 +19,7 @@ import {
|
|||||||
SourceRangeMap,
|
SourceRangeMap,
|
||||||
EngineCommandManager,
|
EngineCommandManager,
|
||||||
} from './lang/std/engineConnection'
|
} from './lang/std/engineConnection'
|
||||||
import { KCLError, KCLUndefinedValueError } from './lang/errors'
|
import { KCLError } from './lang/errors'
|
||||||
|
|
||||||
export type Selection = {
|
export type Selection = {
|
||||||
type: 'default' | 'line-end' | 'line-mid'
|
type: 'default' | 'line-end' | 'line-mid'
|
||||||
|
Reference in New Issue
Block a user