Skip to content

Commit a21a706

Browse files
refactor: remove unused variables (#1052)
1 parent cce7800 commit a21a706

File tree

16 files changed

+19
-74
lines changed

16 files changed

+19
-74
lines changed

docs/.vitepress/components/UseModeList.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<script setup lang="ts">
2-
import { useRouter } from 'vitepress'
3-
4-
const router = useRouter()
52
const list = [
63
{
74
name: 'Vite Plugin',

eslint.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export default antfu({
1919

2020
'no-console': 'off',
2121
'antfu/top-level-function': 'off',
22-
'unused-imports/no-unused-vars': 'off',
22+
'unused-imports/no-unused-vars': ['error', {
23+
args: 'none',
24+
caughtErrors: 'none',
25+
ignoreRestSiblings: true,
26+
}],
2327

2428
'node/prefer-global/process': 'off',
2529

@@ -37,6 +41,11 @@ export default antfu({
3741
rules: {
3842
'devtools/no-vue-runtime-import': ['error', { prefer: 'shared/stub-vue' }],
3943
},
44+
}, {
45+
files: ['packages/playground/**/*.vue', '**/*.md/*'],
46+
rules: {
47+
'unused-imports/no-unused-vars': 'off',
48+
},
4049
}, {
4150
ignores: [
4251
'dist',

packages/applet/src/components/tree/TreeViewer.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import { vTooltip } from '@vue/devtools-ui'
55
import NodeTag from '~/components/basic/NodeTag.vue'
66
import ToggleExpanded from '~/components/basic/ToggleExpanded.vue'
77
import ComponentTreeViewer from '~/components/tree/TreeViewer.vue'
8-
import { useSelect } from '~/composables/select'
98
import { useToggleExpanded } from '~/composables/toggle-expanded'
109
11-
const props = withDefaults(defineProps<{
10+
withDefaults(defineProps<{
1211
data: ComponentTreeNode[] | InspectorTree[]
1312
depth: number
1413
withTag: boolean
@@ -19,7 +18,6 @@ const props = withDefaults(defineProps<{
1918
const emit = defineEmits(['hover', 'leave'])
2019
const selectedNodeId = defineModel()
2120
const { expanded, toggleExpanded } = useToggleExpanded()
22-
const { select: _select } = useSelect()
2321
2422
function normalizeLabel(item: ComponentTreeNode | InspectorTree) {
2523
return ('name' in item && item?.name) || ('label' in item && item.label)

packages/applet/src/modules/pinia/components/Settings.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const settings = inject<Ref<{
1111
}>>('pluginSettings')!
1212
const options = computed(() => settings.value.options)
1313
const values = computed(() => settings.value.values)
14-
const inspectorId = 'pinia'
1514
1615
function update(_settings) {
1716
settings.value = _settings

packages/applet/src/modules/pinia/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const routes = computed(() => {
4141
].filter(Boolean) as VirtualRoute[]
4242
})
4343
44-
const { VirtualRouterView, restoreRouter } = registerVirtualRouter(routes, {
44+
const { VirtualRouterView } = registerVirtualRouter(routes, {
4545
defaultRoutePath: '/store',
4646
})
4747

packages/chrome-extension/src/devtools-overlay.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
if (document instanceof HTMLDocument) {
2-
const body = document.getElementsByTagName('body')[0]
3-
42
// create detector script
53
const detector = document.createElement('script')
64
detector.src = chrome.runtime.getURL('dist/detector.js')

packages/client/src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Pane, Splitpanes } from 'splitpanes'
66
useDevToolsColorMode()
77
const router = useRouter()
88
const route = useRoute()
9-
const hostEnv = useHostEnv()
109
const { connected, clientConnected, activeAppRecordId: _activeAppRecordId, appRecords: _appRecords } = useDevToolsState()
1110
const clientState = devtoolsClientState
1211

packages/client/src/components/timeline/TimelineLayers.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ const devtoolsState = useDevToolsState()
1313
const recordingState = computed(() => devtoolsState.timelineLayersState.value.recordingState)
1414
const timelineLayersState = computed(() => devtoolsState.timelineLayersState.value)
1515
const recordingTooltip = computed(() => recordingState.value ? 'Stop recording' : 'Start recording')
16-
const { colorMode } = useDevToolsColorMode()
17-
const isDark = computed(() => colorMode.value === 'dark')
16+
useDevToolsColorMode()
1817
const selected = defineModel()
1918
function select(id: string) {
2019
selected.value = id

packages/client/src/composables/editor.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ export function useCopy() {
99
const { copy: _copy, copied } = useClipboard()
1010

1111
const copy = (text: string, options: CopyOptions = {}) => {
12-
const {
13-
silent = false,
14-
type = '',
15-
} = options
12+
const { silent = false } = options
1613
_copy(text).then(() => {
1714
if (!silent) {
1815
showVueNotification({

packages/devtools-kit/src/core/plugin/components.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function createComponentsDevToolsPlugin(app: App): [PluginDescriptor, Plu
8686
api.sendInspectorState(INSPECTOR_ID)
8787
}, 120)
8888

89-
const componentAddedCleanup = hook.on.componentAdded(async (app, uid, parentUid, component) => {
89+
hook.on.componentAdded(async (app, uid, parentUid, component) => {
9090
if (devtoolsState.highPerfModeEnabled)
9191
return
9292

@@ -121,7 +121,7 @@ export function createComponentsDevToolsPlugin(app: App): [PluginDescriptor, Plu
121121
debounceSendInspectorTree()
122122
})
123123

124-
const componentUpdatedCleanup = hook.on.componentUpdated(async (app, uid, parentUid, component) => {
124+
hook.on.componentUpdated(async (app, uid, parentUid, component) => {
125125
if (devtoolsState.highPerfModeEnabled)
126126
return
127127

@@ -156,7 +156,7 @@ export function createComponentsDevToolsPlugin(app: App): [PluginDescriptor, Plu
156156
debounceSendInspectorTree()
157157
debounceSendInspectorState()
158158
})
159-
const componentRemovedCleanup = hook.on.componentRemoved(async (app, uid, parentUid, component) => {
159+
hook.on.componentRemoved(async (app, uid, parentUid, component) => {
160160
if (devtoolsState.highPerfModeEnabled)
161161
return
162162

0 commit comments

Comments
 (0)