mirror of
https://github.com/robonen/tools.git
synced 2026-03-20 10:54:44 +00:00
feat(configs/oxlint): add linter
This commit is contained in:
@@ -26,7 +26,7 @@ const UnnamedComponentStub = defineComponent({
|
||||
template: `<div>{{ visibleCount }}</div>`,
|
||||
});
|
||||
|
||||
describe('useRenderInfo', () => {
|
||||
describe(useRenderInfo, () => {
|
||||
it('return uid if component name is not available', async () => {
|
||||
const wrapper = mount(UnnamedComponentStub);
|
||||
|
||||
@@ -42,8 +42,8 @@ describe('useRenderInfo', () => {
|
||||
expect(wrapper.vm.info.duration.value).toBeGreaterThan(0);
|
||||
expect(wrapper.vm.info.lastRendered).toBeGreaterThan(0);
|
||||
|
||||
let lastRendered = wrapper.vm.info.lastRendered;
|
||||
let duration = wrapper.vm.info.duration.value;
|
||||
const lastRendered = wrapper.vm.info.lastRendered;
|
||||
const duration = wrapper.vm.info.duration.value;
|
||||
|
||||
// Will not trigger a render
|
||||
wrapper.vm.hiddenCount++;
|
||||
@@ -76,8 +76,8 @@ describe('useRenderInfo', () => {
|
||||
expect(info.duration.value).toBe(0);
|
||||
expect(info.lastRendered).toBeGreaterThan(0);
|
||||
|
||||
let lastRendered = info.lastRendered;
|
||||
let duration = info.duration.value;
|
||||
const lastRendered = info.lastRendered;
|
||||
const duration = info.duration.value;
|
||||
|
||||
// Will not trigger a render
|
||||
wrapper.vm.hiddenCount++;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { timestamp } from '@robonen/stdlib';
|
||||
import { onBeforeMount, onBeforeUpdate, onMounted, onUpdated, readonly, ref, type ComponentInternalInstance } from 'vue';
|
||||
import { onBeforeMount, onBeforeUpdate, onMounted, onUpdated, readonly, ref } from 'vue';
|
||||
import type { ComponentInternalInstance } from 'vue';
|
||||
import { useRenderCount } from '../useRenderCount';
|
||||
import { getLifeCycleTarger } from '@/utils';
|
||||
|
||||
@@ -24,7 +25,7 @@ export function useRenderInfo(instance?: ComponentInternalInstance) {
|
||||
const duration = ref(0);
|
||||
let renderStartTime = 0;
|
||||
|
||||
const startMark = () => renderStartTime = performance.now();
|
||||
const startMark = () => { renderStartTime = performance.now(); };
|
||||
const endMark = () => {
|
||||
duration.value = Math.max(performance.now() - renderStartTime, 0);
|
||||
renderStartTime = 0;
|
||||
|
||||
Reference in New Issue
Block a user