Files
Memoh/eslint.config.mjs
T
Acbox Liu a7a36df705 refactor: use Twilight AI SDK for model and provider connectivity tes… (#273)
* refactor: use Twilight AI SDK for model and provider connectivity testing

Replace hand-rolled HTTP probing with the Twilight AI SDK's built-in
Provider.Test() and TestModel() methods.

- Model test now runs Provider.Test() (connectivity + auth) followed by
  TestModel() (model availability) via the SDK
- Provider test auto-detects client_type from associated models and
  creates the correct SDK provider for accurate auth header handling
- Embedding models use a dedicated /embeddings endpoint probe since
  the SDK's chat Provider doesn't cover embedding APIs
- Latency measurement now covers the full test lifecycle
- Add TestStatusModelNotSupported for models not found by the provider
- Upgrade twilight-ai to v0.3.3-0.20260321100646-43c789b701dd which
  includes fallback probing for providers without GET /models/{id}

* fix: lint
2026-03-21 19:14:50 +08:00

64 lines
1.6 KiB
JavaScript

// @ts-check
import vueParser from 'vue-eslint-parser'
import tseslint from 'typescript-eslint'
import vue from 'eslint-plugin-vue'
export default [
...tseslint.configs.recommended,
...vue.configs['flat/recommended'],
{ ignores: ['**/node_modules/**', '**/dist/**', '**/cache/**', 'packages/sdk/src/**'] },
{
files: ['packages/**/*.{js,jsx,ts,tsx}', 'apps/**/*.{js,jsx,ts,tsx}'],
languageOptions: {
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
projectService: true,
},
},
rules: {
quotes: ['error', 'single'],
semi: ['error', 'never'],
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
}],
},
},
{
files: ['packages/**/*.vue', 'apps/**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: {
js: 'espree',
ts: tseslint.parser,
},
},
},
rules: {
quotes: ['error', 'single'],
semi: ['error', 'never'],
'vue/multi-word-component-names': 'off',
'vue/require-default-prop': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
}],
},
},
{
files: [
'apps/web/src/pages/chat/components/tool-call-edit.vue',
'apps/web/src/pages/chat/components/tool-call-write.vue',
],
rules: {
'vue/no-v-html': 'off',
},
},
]