diff --git a/.eslintrc.js b/.eslintrc.js index 9c1deb6..efa7cfe 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -38,19 +38,12 @@ module.exports = defineConfig({ '@typescript-eslint/ban-types': 'off', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-unused-vars': [ - 'error', - { - argsIgnorePattern: '^_', - varsIgnorePattern: '^_', - }, - ], + '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '.*', args: 'none' }], 'no-unused-vars': [ 'error', - { - argsIgnorePattern: '^_', - varsIgnorePattern: '^_', - }, + // we are only using this rule to check for unused arguments since TS + // catches unused variables but not args. + { varsIgnorePattern: '.*', args: 'none' }, ], 'space-before-function-paren': 'off', diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts index edbb48f..38cebf9 100644 --- a/src/components/Table/src/types/table.ts +++ b/src/components/Table/src/types/table.ts @@ -1,6 +1,6 @@ -import type { TableBaseColumn } from 'naive-ui/lib/data-table/src/interface'; +import type { InternalRowData, TableBaseColumn } from 'naive-ui/lib/data-table/src/interface'; import { ComponentType } from './componentType'; -export interface BasicColumn extends TableBaseColumn { +export interface BasicColumn extends TableBaseColumn { //编辑表格 edit?: boolean; editRow?: boolean; diff --git a/src/views/list/basicList/columns.ts b/src/views/list/basicList/columns.ts index a4fe697..910b839 100644 --- a/src/views/list/basicList/columns.ts +++ b/src/views/list/basicList/columns.ts @@ -1,7 +1,16 @@ import { h } from 'vue'; import { NAvatar } from 'naive-ui'; - -export const columns = [ +import { BasicColumn } from '@/components/Table'; +export interface ListData { + id: string; + name: string; + avatar: string; + address: string; + beginTime: string; + endTime: string; + date: string; +} +export const columns: BasicColumn[] = [ { title: 'id', key: 'id', diff --git a/src/views/list/basicList/index.vue b/src/views/list/basicList/index.vue index af63d90..7b9db60 100644 --- a/src/views/list/basicList/index.vue +++ b/src/views/list/basicList/index.vue @@ -9,7 +9,7 @@ declare module '*.vue' { import { DefineComponent } from 'vue'; const Component: DefineComponent<{}, {}, any>;