mirror of
https://github.com/robonen/tools.git
synced 2026-03-20 19:04:46 +00:00
feat(configs/oxlint): add linter
This commit is contained in:
@@ -11,14 +11,14 @@ const ComponentStub = defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const isSupported = useSupported(() => props.location in window);
|
||||
const isSupported = useSupported(() => props.location in globalThis);
|
||||
|
||||
return { isSupported };
|
||||
},
|
||||
template: `<div>{{ isSupported }}</div>`,
|
||||
});
|
||||
|
||||
describe('useSupported', () => {
|
||||
describe(useSupported, () => {
|
||||
it('return whether the feature is supported', async () => {
|
||||
const component = mount(ComponentStub);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ export function useSupported(feature: () => unknown) {
|
||||
|
||||
return computed(() => {
|
||||
// add reactive dependency on isMounted
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
isMounted.value;
|
||||
|
||||
return Boolean(feature());
|
||||
|
||||
Reference in New Issue
Block a user