Skip to content

Commit 72dc4c1

Browse files
fix: replace bundledDeps with externalDeps (#59)
* fix: replace bundledDeps with externalDeps * Add missing eslint rules
1 parent 62f0cb4 commit 72dc4c1

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

.eslintrc.cjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const config = {
3636
},
3737
},
3838
rules: {
39-
'@typescript-eslint/array-type': 'off',
39+
'@typescript-eslint/array-type': [
40+
'error',
41+
{ default: 'generic', readonly: 'generic' },
42+
],
4043
'@typescript-eslint/ban-types': 'off',
4144
'@typescript-eslint/ban-ts-comment': 'off',
4245
'@typescript-eslint/consistent-type-definitions': 'off',
@@ -45,16 +48,16 @@ const config = {
4548
{ prefer: 'type-imports' },
4649
],
4750
'@typescript-eslint/explicit-module-boundary-types': 'off',
51+
'@typescript-eslint/method-signature-style': ['error', 'property'],
4852
'@typescript-eslint/no-empty-interface': 'off',
4953
'@typescript-eslint/no-explicit-any': 'off',
5054
'@typescript-eslint/no-non-null-assertion': 'off',
5155
'@typescript-eslint/no-unnecessary-condition': 'error',
56+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
5257
'@typescript-eslint/no-unused-vars': 'off',
5358
'@typescript-eslint/no-inferrable-types': [
5459
'error',
55-
{
56-
ignoreParameters: true,
57-
},
60+
{ ignoreParameters: true },
5861
],
5962
'import/default': 'off',
6063
'import/export': 'off',
@@ -80,7 +83,6 @@ const config = {
8083
],
8184
},
8285
],
83-
8486
'no-redeclare': 'off',
8587
'no-shadow': 'error',
8688
'no-undef': 'off',

src/build/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import type { UserConfig } from 'vite'
22

33
export type Options = {
44
/** Entry file, e.g. `./src/index.ts` */
5-
entry: string | string[]
5+
entry: string | Array<string>
66
/** Source directory used for type generation, e.g. `./src` */
77
srcDir: string
88
/** Excluded from type generation, e.g. `[./src/tests]` */
9-
exclude?: string[]
9+
exclude?: Array<string>
1010
/** Directory where build output will be placed, e.g. `./dist` */
1111
outDir?: string
12-
/** Additional externals to include` */
13-
bundledDeps?: string[]
12+
/** Additional dependencies to externalize if not detected by `vite-plugin-externalize-deps` */
13+
externalDeps?: Array<string | RegExp>
1414
}
1515

1616
export function tanstackBuildConfig(config: Options): UserConfig

src/build/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const tanstackBuildConfig = (options) => {
1414

1515
return defineConfig({
1616
plugins: [
17-
externalizeDeps({ except: options.bundledDeps || [] }),
17+
externalizeDeps({ include: options.externalDeps ?? [] }),
1818
preserveDirectives(),
1919
dts({
2020
outDir: `${outDir}/esm`,

src/publish/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type RunOptions = {
4848
// Contains config for publishable branches.
4949
branchConfigs: Record<string, BranchConfig>
5050
// List your npm packages here. The first package will be used as the versioner.
51-
packages: Package[]
51+
packages: Array<Package>
5252
rootDir: string
5353
// The branch to publish. Defaults to the current branch if none supplied.
5454
branch?: string

0 commit comments

Comments
 (0)