Browse Source

更新eslint 配置

caner 1 year ago
parent
commit
8eb6208d17
4 changed files with 11 additions and 7 deletions
  1. 3 0
      .eslintignore
  2. 3 3
      src/pages/views/draw/index.vue
  3. 4 4
      src/pages/views/home/index.vue
  4. 1 0
      tsconfig.json

+ 3 - 0
.eslintignore

@@ -0,0 +1,3 @@
+/src/pages/views/draw/draw.js
+/src/pages/views/home/Painter.js
+/src/pages/views/home/Recorder.js

+ 3 - 3
src/pages/views/draw/index.vue

@@ -36,7 +36,7 @@
 </template>
 </template>
 <script setup lang='ts'>
 <script setup lang='ts'>
 import { h, onMounted, ref } from 'vue'
 import { h, onMounted, ref } from 'vue'
-import { DrawCanvas } from './js/draw'
+import { DrawCanvas } from './js/draw.js'
 
 
 const drawCanvas = new DrawCanvas()
 const drawCanvas = new DrawCanvas()
 const options = [
 const options = [
@@ -202,7 +202,7 @@ const dicTypePath = {
   0: 'M175.000036,0.5 C222.664535,0.5 265.865535,21.1909654 297.358963,54.7296453 C328.90593,88.3253418 348.705559,134.812441 349.476653,186.303442 L349.490723,188.280824 L349.5,247.5 L0.5,247.5 L0.5,188.283766 C0.787224943,136.359137 20.4197058,89.3998566 51.9881066,55.4283849 C83.5364037,21.4785471 127.005458,0.5 175.000036,0.5 Z'
   0: 'M175.000036,0.5 C222.664535,0.5 265.865535,21.1909654 297.358963,54.7296453 C328.90593,88.3253418 348.705559,134.812441 349.476653,186.303442 L349.490723,188.280824 L349.5,247.5 L0.5,247.5 L0.5,188.283766 C0.787224943,136.359137 20.4197058,89.3998566 51.9881066,55.4283849 C83.5364037,21.4785471 127.005458,0.5 175.000036,0.5 Z'
 }
 }
 
 
-function renderLabel(option) {
+function renderLabel(option: { icon: string | URL; label: string; }) {
   return h('div', {
   return h('div', {
     style: {
     style: {
       display: 'flex',
       display: 'flex',
@@ -225,7 +225,7 @@ function renderLabel(option) {
   ])
   ])
 }
 }
 
 
-function changeOption(v, option) {
+function changeOption(v: null, option: { label: string; icon: string; value: number; w: number; h: number; }) {
   console.log('切换', v, option)
   console.log('切换', v, option)
   drawCanvas._executionArr.type = v
   drawCanvas._executionArr.type = v
 }
 }

+ 4 - 4
src/pages/views/home/index.vue

@@ -28,7 +28,7 @@
     />
     />
   </div>
   </div>
 </template>
 </template>
-<script lang="ts" setup>
+<script setup lang="ts">
 import { Painter } from './js/Painter.js'
 import { Painter } from './js/Painter.js'
 import { Recorder } from './js/Recorder.js'
 import { Recorder } from './js/Recorder.js'
 import {
 import {
@@ -36,8 +36,8 @@ import {
 } from 'vue'
 } from 'vue'
 import { io } from 'socket.io-client'
 import { io } from 'socket.io-client'
 
 
-const painters: any = {}
-let recorder: any = null
+const painters: Any = {}
+let recorder: Any = null
 let ptime = 0
 let ptime = 0
 const status = ref('🟡')
 const status = ref('🟡')
 const colors = [ '⚫️', '🔵', '🟢', '🟣', '🔴', '🟤', '🟠', '🟡', '⚪️' ]
 const colors = [ '⚫️', '🔵', '🟢', '🟣', '🔴', '🟤', '🟠', '🟡', '⚪️' ]
@@ -93,7 +93,7 @@ socket.on('connect', () => {
   status.value = colors[2]
   status.value = colors[2]
 })
 })
 
 
-socket.on('msg', (data: any) => {
+socket.on('msg', (data) => {
   const dataview = new DataView(data)
   const dataview = new DataView(data)
   const id = dataview.getUint8(0)
   const id = dataview.getUint8(0)
   if (painters[id] === undefined) {
   if (painters[id] === undefined) {

+ 1 - 0
tsconfig.json

@@ -11,6 +11,7 @@
     "resolveJsonModule": true,
     "resolveJsonModule": true,
     "isolatedModules": true,
     "isolatedModules": true,
     "esModuleInterop": true,
     "esModuleInterop": true,
+    "noImplicitAny": false,
     "lib": [
     "lib": [
       "ESNext",
       "ESNext",
       "DOM"
       "DOM"