Skip to content

Commit

Permalink
chore: update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Dec 9, 2024
1 parent ae6606a commit 62717f0
Show file tree
Hide file tree
Showing 121 changed files with 1,327 additions and 637 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,9 @@ In your tests you can use the Programmatic API to start the server, run scripts,
After your test run, you can destroy the instance with `destroy`.

```ts
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import type { MoquerieInstance } from 'moquerie'
import { addResolvers, createTestInstance, startServer, useSnapshot } from 'moquerie'
import { afterEach, beforeEach, describe, expect, it } from 'vitest'

describe('fetch', () => {
let mq: MoquerieInstance
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"devDependencies": {
"@akryum/sheep": "^0.5.2",
"@antfu/eslint-config": "^2.6.3",
"eslint": "^8.57.0"
"@antfu/eslint-config": "^3.11.2",
"eslint": "^9.16.0"
},
"pnpm": {
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/AppNavItem.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Tooltip } from 'floating-vue'
import { NuxtLink } from '#components'
import { Tooltip } from 'floating-vue'
const props = defineProps<{
to?: any
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/LinkList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup generic="TItem = any">
import { vTooltip } from 'floating-vue'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { vTooltip } from 'floating-vue'
const props = defineProps<{
id?: string
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/LinkListItem.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { Tooltip } from 'floating-vue'
import type { RouteLocationRaw } from 'vue-router'
import { NuxtLink } from '#components'
import { Tooltip } from 'floating-vue'
const props = defineProps<{
to?: string | RouteLocationRaw
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import SuperJSON from 'superjson'
import type { ResourceFactory, ScriptItem } from '@moquerie/core'
import SuperJSON from 'superjson'
const emit = defineEmits<{
close: []
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/factory/FactoryFakerInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import * as monaco from 'monaco-editor'
import { Dropdown } from 'floating-vue'
import type { ResourceFactoryField, ResourceSchemaType } from '@moquerie/core'
import { Dropdown } from 'floating-vue'
import * as monaco from 'monaco-editor'
const props = defineProps<{
resourceType: ResourceSchemaType
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/factory/FactoryField.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { Dropdown } from 'floating-vue'
import type { ResourceFactoryField, ResourceSchemaType } from '@moquerie/core'
import { isAnyOpen } from '../resource/resourceInstanceValueOverlays.js'
import type { FlatField } from './formTypes.js'
import { Dropdown } from 'floating-vue'
import { isAnyOpen } from '../resource/resourceInstanceValueOverlays.js'
export const selectedField = ref<string | null>(null)
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/factory/FactoryFieldSummary.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { vTooltip } from 'floating-vue'
import type { ResourceFactoryField, ResourceSchemaType } from '@moquerie/core'
import { vTooltip } from 'floating-vue'
const props = defineProps<{
factoryField: ResourceFactoryField
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/factory/FactoryFields.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { ResourceFactoryField, ResourceFactoryFieldsMap, ResourceSchemaType } from '@moquerie/core'
import type { FlatField } from './formTypes.js'
import { set } from '@moquerie/core/util'
import clone from 'just-clone'
import { selectedField } from './FactoryField.vue'
import type { FlatField } from './formTypes.js'
const props = defineProps<{
resourceType: ResourceSchemaType
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/factory/FactoryForm.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import { Dropdown } from 'floating-vue'
import type { ResourceFactory, ResourceSchemaType } from '@moquerie/core'
import SuperJSON from 'superjson'
import type { FactoryData } from './formTypes.js'
import { Dropdown } from 'floating-vue'
import SuperJSON from 'superjson'
import { useTagModel } from '~/utils/form.js'
const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/factory/FactoryList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { useRouteQuery } from '@vueuse/router'
import type { DBLocation, ResourceFactory } from '@moquerie/core'
import { useRouteQuery } from '@vueuse/router'
const route = useRoute()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/factory/FactoryPreview.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Dropdown } from 'floating-vue'
import type { FactoryData } from './formTypes.js'
import { Dropdown } from 'floating-vue'
const props = defineProps<{
factory: FactoryData
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/history/HistoryRecordView.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import SuperJSON from 'superjson'
import type { HistoryRecord } from '@moquerie/core'
import { vTooltip } from 'floating-vue'
import { diffApply } from 'just-diff-apply'
import clone from 'just-clone'
import { diffApply } from 'just-diff-apply'
import SuperJSON from 'superjson'
import { HistoryIcons } from './icons.js'
const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/monaco.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import configTypes from '@moquerie/core/src/types/config.js?raw'
import * as monaco from 'monaco-editor'
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
import TsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
import GraphQLWorker from 'monaco-graphql/esm/graphql.worker?worker'
import configTypes from '@moquerie/core/src/types/config.js?raw'

// Language support

Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/resource/ResourceBulkEditForm.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Dropdown } from 'floating-vue'
import type { ResourceSchemaField, ResourceSchemaType } from '@moquerie/core'
import { Dropdown } from 'floating-vue'
import { isAnyOpen } from './resourceInstanceValueOverlays.js'
const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/resource/ResourceInfo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { vTooltip } from 'floating-vue'
import type { ResourceSchemaType } from '@moquerie/core'
import { vTooltip } from 'floating-vue'
defineProps<{
type: ResourceSchemaType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { ResourceFactory, ResourceInstance } from '@moquerie/core'
import { Tooltip } from 'floating-vue'
import SuperJSON from 'superjson'
import type { ResourceFactory, ResourceInstance } from '@moquerie/core'
import { isAnyOpen } from './resourceInstanceValueOverlays.js'
const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/resource/ResourceInstanceInfo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { vTooltip } from 'floating-vue'
import type { ResourceInstance } from '@moquerie/core'
import { vTooltip } from 'floating-vue'
const props = defineProps<{
instance: ResourceInstance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import * as monaco from 'monaco-editor'
import { Dropdown, vTooltip } from 'floating-vue'
import * as monaco from 'monaco-editor'
import { isFakerOpen } from './resourceInstanceValueOverlays.js'
const props = defineProps<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Dropdown, Tooltip } from 'floating-vue'
import type { ResourceInstance, ResourceSchemaType } from '@moquerie/core'
import { Dropdown, Tooltip } from 'floating-vue'
import { isAnyOpen } from './resourceInstanceValueOverlays.js'
const props = defineProps<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Dropdown, Menu, Tooltip } from 'floating-vue'
import type { ResourceSchemaField, ResourceSchemaType } from '@moquerie/core'
import { Dropdown, Menu, Tooltip } from 'floating-vue'
import * as monaco from 'monaco-editor'
// @TODO Handle required/non-null fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import SuperJSON from 'superjson'
import { Tooltip, vTooltip } from 'floating-vue'
import type { FilterActive, ResourceInstance, ResourceInstanceReference, ResourceSchemaField, ResourceSchemaType } from '@moquerie/core'
import { Tooltip, vTooltip } from 'floating-vue'
import SuperJSON from 'superjson'
import { isReferencesOpen } from './resourceInstanceValueOverlays.js'
const props = defineProps<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import SuperJSON from 'superjson'
import { vTooltip } from 'floating-vue'
import type { FilterActive, ResourceInstance, ResourceSchemaField, ResourceSchemaType } from '@moquerie/core'
import { vTooltip } from 'floating-vue'
import SuperJSON from 'superjson'
const props = defineProps<{
field: ResourceSchemaField & {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/resource/ResourceTableRow.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { Menu, Tooltip, vTooltip } from 'floating-vue'
import type { ResourceInstance, ResourceSchemaType } from '@moquerie/core'
import type { Col } from './tableTypes.js'
import { Menu, Tooltip, vTooltip } from 'floating-vue'
const props = defineProps<{
resourceType: ResourceSchemaType
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/rest/RestPlayground.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import * as monaco from 'monaco-editor'
import { vTooltip } from 'floating-vue'
import * as monaco from 'monaco-editor'
const path = useLocalStorage('moquerie.rest.playground.path', '')
const method = useLocalStorage('moquerie.rest.playground.method', 'GET')
Expand Down
4 changes: 2 additions & 2 deletions packages/app/components/snapshot/SnapshotForm.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { DBLocation, DatabaseSnapshot } from '@moquerie/core'
import SuperJSON from 'superjson'
import type { DatabaseSnapshot, DBLocation } from '@moquerie/core'
import { Dropdown } from 'floating-vue'
import SuperJSON from 'superjson'
const props = defineProps<{
snapshot?: DatabaseSnapshot
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/snapshot/SnapshotList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { DatabaseSnapshot, DBLocation } from '@moquerie/core'
import { useRouteQuery } from '@vueuse/router'
import type { DBLocation, DatabaseSnapshot } from '@moquerie/core'
import LinkList from '../LinkList.vue'
const route = useRoute()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/user/UserAvatar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { Menu } from 'floating-vue'
import type { User } from '@moquerie/core'
import { Menu } from 'floating-vue'
defineProps<{
user: User
Expand Down
2 changes: 1 addition & 1 deletion packages/app/server/api/branches/index.get.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'node:fs'
import path from 'pathe'
import { getLocalDbFolder, resourceInstancesFolders } from '@moquerie/core'
import path from 'pathe'

export default defineEventHandler(async () => {
const folder = path.join(getLocalDbFolder(getMq()), ...resourceInstancesFolders)
Expand Down
2 changes: 1 addition & 1 deletion packages/app/server/api/debug.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import envinfo from 'envinfo'
import { getLocalDbFolder, getRepositoryDbFolder, resolveConfig } from '@moquerie/core'
import { getProjectName } from '@moquerie/core/util'
import envinfo from 'envinfo'

export default defineEventHandler(async () => {
const mq = getMq()
Expand Down
4 changes: 2 additions & 2 deletions packages/app/server/api/factories/[factoryId]/index.get.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SuperJSON from 'superjson'
import { getFactoryStorage } from '@moquerie/core'
import type { ResourceFactory } from '@moquerie/core'
import { getFactoryStorage } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler(async (event) => {
const { factoryId } = getRouterParams(event, {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/server/api/factories/[factoryId]/index.patch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { nanoid } from 'nanoid'
import type { FactoryData } from '@/components/factory/formTypes.js'
import { getFactoryStorage } from '@moquerie/core'
import { nanoid } from 'nanoid'
import SuperJSON from 'superjson'
import type { FactoryData } from '@/components/factory/formTypes.js'

export default defineEventHandler<{ body: FactoryData }>(async (event) => {
const { factoryId } = getRouterParams(event, {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/server/api/factories/count.get.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getFactoryStorage } from '@moquerie/core'
import type { DBLocation } from '@moquerie/core'
import { getFactoryStorage } from '@moquerie/core'

export default defineEventHandler<{ query: { resourceName: string, location?: DBLocation } }, Promise<Record<DBLocation, number>>>(async (event) => {
const query = getQuery(event)
Expand Down
6 changes: 3 additions & 3 deletions packages/app/server/api/factories/create.post.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ResourceFactory } from '@moquerie/core'
import type { FactoryData } from '~/components/factory/formTypes.js'
import { getCurrentUser, getFactoryFilename, getFactoryStorage } from '@moquerie/core'
import { nanoid } from 'nanoid'
import path from 'pathe'
import { getCurrentUser, getFactoryFilename, getFactoryStorage } from '@moquerie/core'
import type { ResourceFactory } from '@moquerie/core'
import SuperJSON from 'superjson'
import type { FactoryData } from '~/components/factory/formTypes.js'

export default defineEventHandler(async (event) => {
const body: FactoryData = await readBody(event)
Expand Down
4 changes: 2 additions & 2 deletions packages/app/server/api/factories/index.get.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SuperJSON from 'superjson'
import { getFactoryStorage } from '@moquerie/core'
import type { DBLocation, ResourceFactory } from '@moquerie/core'
import { getFactoryStorage } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler<{ query: { resourceName: string, location?: DBLocation } }, Promise<ResourceFactory[]>>(async (event) => {
const query = getQuery(event)
Expand Down
2 changes: 1 addition & 1 deletion packages/app/server/api/factories/preview.post.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FactoryData } from '@/components/factory/formTypes.js'
import { createInstanceFromFactory, getCurrentUser, serializeFactory } from '@moquerie/core'
import { printCode } from '@moquerie/core/util'
import type { FactoryData } from '@/components/factory/formTypes.js'

export default defineEventHandler<{ body: FactoryData }>(async (event) => {
const mq = getMq()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/server/api/faker/preview.post.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SuperJSON from 'superjson'
import { generateValueFromFaker, getFaker } from '@moquerie/core'
import SuperJSON from 'superjson'

interface Body {
factory: string
Expand Down
2 changes: 1 addition & 1 deletion packages/app/server/api/history/index.get.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SuperJSON from 'superjson'
import type { HistoryRecordForList } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler(async (event) => {
const mq = getMq()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/server/api/resources/create.post.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SuperJSON from 'superjson'
import { createResourceInstance } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler(async (event) => {
const mq = getMq()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SuperJSON from 'superjson'
import { findResourceInstanceById } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler(async (event) => {
const mq = getMq()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SuperJSON from 'superjson'
import { updateResourceInstanceById } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler(async (event) => {
const mq = getMq()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ResourceInstance } from '@moquerie/core'
import { deactiveOtherSingletonResourceInstances, findResourceInstanceById, getResourceInstanceStorage } from '@moquerie/core'
import { nanoid } from 'nanoid'
import SuperJSON from 'superjson'
import { deactiveOtherSingletonResourceInstances, findResourceInstanceById, getResourceInstanceStorage } from '@moquerie/core'
import type { ResourceInstance } from '@moquerie/core'

export default defineEventHandler(async (event) => {
const mq = getMq()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SuperJSON from 'superjson'
import { findResourceInstanceById } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler(async (event) => {
const mq = getMq()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SuperJSON from 'superjson'
import { findAllResourceInstances } from '@moquerie/core'
import SuperJSON from 'superjson'

export default defineEventHandler(async (event) => {
const mq = getMq()
Expand Down
Loading

0 comments on commit 62717f0

Please sign in to comment.