From c1356bfe7067d5659af8a2a32ab79aeb11829e7d Mon Sep 17 00:00:00 2001 From: 1ncounter <1ncounter.100@gmail.com> Date: Wed, 24 Jul 2024 11:15:05 +0800 Subject: [PATCH] chore: lint and build --- eslint.config.js | 1 + vite.base.config.ts | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 98b568825..8182c0931 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -46,6 +46,7 @@ export default tseslint.config({ '@stylistic/semi': ['error', 'always'], '@stylistic/eol-last': ['error', 'always'], '@stylistic/jsx-quotes': ['error', 'prefer-double'], + '@stylistic/max-len': 'off', '@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }], '@typescript-eslint/no-explicit-any': 'off', diff --git a/vite.base.config.ts b/vite.base.config.ts index 5a67d9f3f..638326333 100644 --- a/vite.base.config.ts +++ b/vite.base.config.ts @@ -22,13 +22,13 @@ export default async ({ }: Options) => { const formats = (env['FORMATS']?.split(',') ?? defaultFormats) as LibraryFormats[]; - let externals: string[] = []; + const { peerDependencies = {}, dependencies = {} } = await getPackageJson( + resolvePath('package.json'), + ); + const externals: string[] = [...Object.keys(peerDependencies)]; if (externalDeps) { - const { peerDependencies = {}, devDependencies = {} } = await getPackageJson( - resolvePath('package.json'), - ); - externals = [...Object.keys(peerDependencies), ...Object.keys(devDependencies)]; + externals.push(...Object.keys(dependencies)); } return defineConfig({