Skip to content

Commit

Permalink
style: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrdtr committed May 1, 2024
1 parent d8eec4e commit 5d3d05a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

11 changes: 6 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
// Run `npx @eslint/config-inspector` to inspect the resolved config interactively
export default createConfigForNuxt({
features: {
// Rules for module authors
tooling: true,
// Rules for formatting
stylistic: true,
},
dirs: {
src: ['./playground'],
},
})
.append
// your custom flat config here...
()
.append({
ignores: [
'dist',
'node_modules',
],
})
6 changes: 3 additions & 3 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export default defineNuxtConfig({
modules: ['../src/module'],
appwrite: {
project: 'nuxt-playground'
project: 'nuxt-playground',
},
typescript: {
shim: false
}
shim: false,
},
})
13 changes: 7 additions & 6 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { defineNuxtModule, addPlugin, addImportsDir, createResolver, extendViteConfig } from '@nuxt/kit'

export type {
Models,
Payload,
QueryTypes,
QueryTypesList,
RealtimeResponseEvent,
UploadProgress
UploadProgress,
} from 'appwrite'

export interface ModuleOptions {
endpoint: string,
endpoint: string
project: string
}

export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'nuxt-appwrite',
configKey: 'appwrite'
configKey: 'appwrite',
},
defaults: {
endpoint: 'https://cloud.appwrite.io/v1',
project: ''
project: '',
},
setup (options, nuxt) {
setup(options, nuxt) {
const { resolve } = createResolver(import.meta.url)

if (!options.project) throw new Error('`appwrite.project` is required')
Expand All @@ -42,5 +43,5 @@ export default defineNuxtModule<ModuleOptions>({
console.info(`Appwrite Endpoint: ${options.endpoint}`)
console.info(`Appwrite Project: ${options.project}`)
})
}
},
})
3 changes: 2 additions & 1 deletion src/runtime/composables/useAppwrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useNuxtApp } from '#imports'

export const useAppwrite = () => {
const { $appwrite } = useNuxtApp()
if (!$appwrite) { throw new Error('Appwrite plugin not accessible') }
if (!$appwrite) throw new Error('Appwrite plugin not accessible')

return $appwrite as Appwrite
}
2 changes: 1 addition & 1 deletion test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { setup, $fetch } from '@nuxt/test-utils'

describe('ssr', async () => {
await setup({
rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url))
rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url)),
})

it('renders the index page', async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/basic/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import nuxtAppwrite from '../../../src/module'
export default defineNuxtConfig({
modules: [nuxtAppwrite as NuxtModule<Partial<ModuleOptions>>],
appwrite: {
project: 'nuxt-playground'
}
project: 'nuxt-playground',
},
})

0 comments on commit 5d3d05a

Please sign in to comment.