Fix lint warnings (#289)

This commit is contained in:
Adam Chalmers
2023-08-18 17:14:35 -05:00
committed by GitHub
parent 6ea3a37e8a
commit a8d23f5c0d
16 changed files with 8 additions and 31 deletions

View File

@ -79,7 +79,6 @@ export function App() {
setIsStreamReady,
isStreamReady,
isMouseDownInStream,
fileId,
cmdId,
setCmdId,
token,
@ -120,7 +119,6 @@ export function App() {
isStreamReady: s.isStreamReady,
setIsStreamReady: s.setIsStreamReady,
isMouseDownInStream: s.isMouseDownInStream,
fileId: s.fileId,
cmdId: s.cmdId,
setCmdId: s.setCmdId,
token: s.token,

View File

@ -11,7 +11,6 @@ import { SetAngleLength } from './components/Toolbar/setAngleLength'
import { ConvertToVariable } from './components/Toolbar/ConvertVariable'
import { SetAbsDistance } from './components/Toolbar/SetAbsDistance'
import { SetAngleBetween } from './components/Toolbar/SetAngleBetween'
import { ExportButton } from './components/ExportButton'
export const Toolbar = () => {
const {

View File

@ -9,7 +9,6 @@ import {
findUniqueName,
} from '../lang/modifyAst'
import { findAllPreviousVariables, PrevVariable } from '../lang/queryAst'
import { lexer } from '../lang/tokeniser'
import { useStore } from '../useStore'
export const AvailableVars = ({

View File

@ -1,5 +1,4 @@
import { fireEvent, render, screen } from '@testing-library/react'
import { User } from '../useStore'
import { BrowserRouter } from 'react-router-dom'
import ProjectSidebarMenu from './ProjectSidebarMenu'
import { ProjectWithEntryPointMetadata } from '../Router'

View File

@ -1,5 +1,5 @@
import { Dialog, Transition } from '@headlessui/react'
import { Fragment, useState } from 'react'
import { Fragment } from 'react'
import { useCalc, CreateNewVariable } from './AvailableVarsHelpers'
export const SetVarNameModal = ({

View File

@ -20,8 +20,6 @@ export const Stream = ({ className = '' }) => {
mediaStream,
engineCommandManager,
setIsMouseDownInStream,
fileId,
setFileId,
setCmdId,
didDragInStream,
setDidDragInStream,
@ -32,7 +30,6 @@ export const Stream = ({ className = '' }) => {
isMouseDownInStream: s.isMouseDownInStream,
setIsMouseDownInStream: s.setIsMouseDownInStream,
fileId: s.fileId,
setFileId: s.setFileId,
setCmdId: s.setCmdId,
didDragInStream: s.didDragInStream,
setDidDragInStream: s.setDidDragInStream,
@ -48,9 +45,8 @@ export const Stream = ({ className = '' }) => {
if (!videoRef.current) return
if (!mediaStream) return
videoRef.current.srcObject = mediaStream
setFileId(uuidv4())
setZoom(videoRef.current.getBoundingClientRect().height / 2)
}, [mediaStream, engineCommandManager, setFileId])
}, [mediaStream, engineCommandManager])
const handleMouseDown: MouseEventHandler<HTMLVideoElement> = ({
clientX,

View File

@ -7,7 +7,6 @@ import { useNavigate } from 'react-router-dom'
import { useState } from 'react'
import { paths } from '../Router'
import makeUrlPathRelative from '../lib/makeUrlPathRelative'
import { ExportButton } from './ExportButton'
const UserSidebarMenu = ({ user }: { user?: User }) => {
const displayedName = getDisplayName(user)

View File

@ -1,6 +1,6 @@
import { parser_wasm } from './abstractSyntaxTree'
import { initPromise } from './rust'
import { enginelessExecutor, executor } from '../lib/testHelpers'
import { enginelessExecutor } from '../lib/testHelpers'
beforeAll(() => initPromise)

View File

@ -543,7 +543,7 @@ export const _executor = async (
}
_programMemory.return = expression.arguments as any // todo memory redo
} else {
if (_programMemory.root[functionName] == undefined) {
if (_programMemory.root[functionName] === undefined) {
throw new KCLSemanticError(`No such name ${functionName} defined`, [
[statement.start, statement.end],
])

View File

@ -5,7 +5,6 @@ import {
isTypeInValue,
getNodePathFromSourceRange,
} from './queryAst'
import { lexer } from './tokeniser'
import { initPromise } from './rust'
import { enginelessExecutor } from '../lib/testHelpers'
import {

View File

@ -134,7 +134,6 @@ show(mySketch001)`
describe('testing addNewSketchLn', () => {
const lineToChange = 'lineTo([-1.59, -1.54], %)'
const lineAfterChange = 'lineTo([2, 3], %)'
test('addNewSketchLn', async () => {
// Enable rotations #152
const code = `
@ -146,6 +145,7 @@ show(mySketch001)`
const ast = parser_wasm(code)
const programMemory = await enginelessExecutor(ast)
const sourceStart = code.indexOf(lineToChange)
expect(sourceStart).toBe(66)
const { modifiedAst } = addNewSketchLn({
node: ast,
programMemory,

View File

@ -116,7 +116,7 @@ function makeId(seed: string | any) {
export const lineTo: SketchLineHelper = {
fn: (
{ sourceRange, engineCommandManager, code },
{ sourceRange, code },
data:
| [number, number]
| {
@ -131,10 +131,6 @@ export const lineTo: SketchLineHelper = {
const from = getCoordsFromPaths(sketchGroup, sketchGroup.value.length - 1)
const to = 'to' in data ? data.to : data
const lineData: LineData = {
from: [...from, 0],
to: [...to, 0],
}
const id = makeId({
code,
sourceRange,
@ -672,10 +668,6 @@ export const angledLine: SketchLineHelper = {
from[0] + length * Math.cos((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({
code,
sourceRange,

View File

@ -25,9 +25,8 @@ import {
lastSegY,
} from './sketchConstraints'
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>(
// { sourceRange }: InternalFirstArg,

View File

@ -7,7 +7,6 @@ import Units from './Units'
import Camera from './Camera'
import Sketching from './Sketching'
import { useCallback } from 'react'
import { paths } from '../../Router'
import makeUrlPathRelative from '../../lib/makeUrlPathRelative'
export const onboardingPaths = {

View File

@ -2,7 +2,6 @@ import '@testing-library/jest-dom'
import { WebSocket } from 'ws'
class MockRTCPeerConnection {
constructor() {}
createDataChannel() {
return
}

View File

@ -12,7 +12,6 @@ import {
SourceRange,
} from './lang/executor'
import { recast } from './lang/recast'
import { asyncLexer } from './lang/tokeniser'
import { EditorSelection } from '@codemirror/state'
import { BaseDirectory } from '@tauri-apps/api/fs'
import {
@ -20,7 +19,7 @@ import {
SourceRangeMap,
EngineCommandManager,
} from './lang/std/engineConnection'
import { KCLError, KCLUndefinedValueError } from './lang/errors'
import { KCLError } from './lang/errors'
export type Selection = {
type: 'default' | 'line-end' | 'line-mid'