diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 21ba78fb..d56325d9 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -36,7 +36,10 @@ const config = { }, }, rules: { - '@typescript-eslint/array-type': 'off', + '@typescript-eslint/array-type': [ + 'error', + { default: 'generic', readonly: 'generic' }, + ], '@typescript-eslint/ban-types': 'off', '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/consistent-type-definitions': 'off', @@ -45,16 +48,16 @@ const config = { { prefer: 'type-imports' }, ], '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/method-signature-style': ['error', 'property'], '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-unnecessary-condition': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-inferrable-types': [ 'error', - { - ignoreParameters: true, - }, + { ignoreParameters: true }, ], 'import/default': 'off', 'import/export': 'off', @@ -80,7 +83,6 @@ const config = { ], }, ], - 'no-redeclare': 'off', 'no-shadow': 'error', 'no-undef': 'off', diff --git a/src/build/index.d.ts b/src/build/index.d.ts index 22694c77..5d962e64 100644 --- a/src/build/index.d.ts +++ b/src/build/index.d.ts @@ -2,15 +2,15 @@ import type { UserConfig } from 'vite' export type Options = { /** Entry file, e.g. `./src/index.ts` */ - entry: string | string[] + entry: string | Array /** Source directory used for type generation, e.g. `./src` */ srcDir: string /** Excluded from type generation, e.g. `[./src/tests]` */ - exclude?: string[] + exclude?: Array /** Directory where build output will be placed, e.g. `./dist` */ outDir?: string - /** Additional externals to include` */ - bundledDeps?: string[] + /** Additional dependencies to externalize if not detected by `vite-plugin-externalize-deps` */ + externalDeps?: Array } export function tanstackBuildConfig(config: Options): UserConfig diff --git a/src/build/index.js b/src/build/index.js index 4e48da1c..c13baa43 100644 --- a/src/build/index.js +++ b/src/build/index.js @@ -14,7 +14,7 @@ export const tanstackBuildConfig = (options) => { return defineConfig({ plugins: [ - externalizeDeps({ except: options.bundledDeps || [] }), + externalizeDeps({ include: options.externalDeps ?? [] }), preserveDirectives(), dts({ outDir: `${outDir}/esm`, diff --git a/src/publish/types.d.ts b/src/publish/types.d.ts index 9640b19e..c241761c 100644 --- a/src/publish/types.d.ts +++ b/src/publish/types.d.ts @@ -48,7 +48,7 @@ export type RunOptions = { // Contains config for publishable branches. branchConfigs: Record // List your npm packages here. The first package will be used as the versioner. - packages: Package[] + packages: Array rootDir: string // The branch to publish. Defaults to the current branch if none supplied. branch?: string