diff --git a/.vscode/settings.json b/.vscode/settings.json index 66b5a4d..2f5de95 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,7 +14,8 @@ // Silent the stylistic rules in you IDE, but still auto-fix them "eslint.rules.customizations": [ - { "rule": "@stylistic/*", "severity": "off" }, + { "rule": "style/*", "severity": "off" }, + { "rule": "format/*", "severity": "off" }, { "rule": "*-indent", "severity": "off" }, { "rule": "*-spacing", "severity": "off" }, { "rule": "*-spaces", "severity": "off" }, diff --git a/docs/guide/openapi-types.md b/docs/guide/openapi-types.md index 997ece6..81dee2d 100644 --- a/docs/guide/openapi-types.md +++ b/docs/guide/openapi-types.md @@ -123,7 +123,7 @@ type FooModel = components['schemas']['FooModel'] Nuxt API Party provides helper types to extract the request and response types for a given endpoint. The helper type is named based on your endpoint name. For example, `petStre` would result in `PetStoreRequest` and `PetStoreResponse`. ```ts -import type { MyApiResponse, MyApiRequestBody } from '#nuxt-api-party/myApi' +import type { MyApiRequestBody, MyApiResponse } from '#nuxt-api-party/myApi' type FooResponse = MyApiResponse<'getFoo'> // ^? { id?: number; bar: string }[] @@ -176,5 +176,4 @@ const resultPost = await $myApi('/foo', { bar: 'string' } }) - ``` diff --git a/eslint.config.mjs b/eslint.config.mjs index 6f29bd3..bf3035f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,43 +1,8 @@ // @ts-check -import { createConfigForNuxt } from '@nuxt/eslint-config/flat' -import perfectionist from 'eslint-plugin-perfectionist' +import antfu from '@antfu/eslint-config' -export default createConfigForNuxt({ - features: { - tooling: true, - stylistic: true, - }, - dirs: { - src: [ - './playground', - ], +export default antfu({ + rules: { + 'no-console': 'off', }, }) - // @ts-ignore - .append({ - plugins: { - perfectionist, - }, - rules: { - 'import/order': 'off', - 'perfectionist/sort-exports': ['error', { order: 'asc', type: 'natural' }], - 'perfectionist/sort-imports': ['error', { - groups: [ - 'type', - ['parent-type', 'sibling-type', 'index-type'], - 'builtin', - 'external', - ['internal', 'internal-type'], - ['parent', 'sibling', 'index'], - 'side-effect', - 'object', - 'unknown', - ], - newlinesBetween: 'ignore', - order: 'asc', - type: 'natural', - }], - 'perfectionist/sort-named-exports': ['error', { order: 'asc', type: 'natural' }], - 'perfectionist/sort-named-imports': ['error', { order: 'asc', type: 'natural' }], - }, - }) diff --git a/package.json b/package.json index 22ce37e..0cbe6d8 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,9 @@ "test:types": "tsc --noEmit", "release": "bumpp" }, + "peerDependencies": { + "openapi-typescript": "^5 || ^6 || ^7" + }, "dependencies": { "@nuxt/kit": "^3.14.1592", "defu": "^6.1.4", @@ -57,17 +60,13 @@ "scule": "^1.3.0", "ufo": "^1.5.4" }, - "peerDependencies": { - "openapi-typescript": "^5 || ^6 || ^7" - }, "devDependencies": { - "@nuxt/eslint-config": "^0.7.2", + "@antfu/eslint-config": "^3.10.0", "@nuxt/module-builder": "^0.8.4", "@nuxt/test-utils": "^3.14.4", "@types/node": "^22.10.0", "bumpp": "^9.8.1", "eslint": "^9.15.0", - "eslint-plugin-perfectionist": "^4.1.2", "nuxt": "^3.14.1592", "openapi-typescript": "^7.4.3", "typescript": "^5.7.2", diff --git a/playground/pages/petStore.vue b/playground/pages/petStore.vue index 83c37af..768fc9a 100644 --- a/playground/pages/petStore.vue +++ b/playground/pages/petStore.vue @@ -1,5 +1,5 @@