Skip to content

Commit 24c3ebd

Browse files
committed
fix: fix ts issues
1 parent 1ad00f0 commit 24c3ebd

File tree

3 files changed

+15
-22
lines changed

3 files changed

+15
-22
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@
4545
},
4646
"dependencies": {
4747
"@babel/core": "^7.27.4",
48-
"babel-plugin-module-resolver": "^5.0.2",
49-
"deepmerge": "^4.3.1"
48+
"@dword-design/defu": "^1.0.0",
49+
"babel-plugin-module-resolver": "^5.0.2"
5050
},
5151
"devDependencies": {
5252
"@dword-design/base": "^13.0.1",
53-
"@dword-design/defu": "^1.0.0",
5453
"@playwright/test": "^1.52.0",
5554
"depcheck-package-name": "^3.0.1",
5655
"endent": "npm:@dword-design/endent@^1.4.1",

pnpm-lock.yaml

Lines changed: 8 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rules/prefer-alias.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import pathLib from 'node:path';
22

33
import { OptionManager } from '@babel/core';
4+
import defu from '@dword-design/defu';
45
import { resolvePath as defaultResolvePath } from 'babel-plugin-module-resolver';
5-
import deepmerge from 'deepmerge';
66

77
const isParentImport = path => /^(\.\/)?\.\.\//.test(path);
88

@@ -41,11 +41,10 @@ export default {
4141

4242
const plugin = babelConfig.plugins.find(_ => _.key === 'module-resolver');
4343

44-
const options = deepmerge.all([
45-
{ alias: [], cwd: context.cwd },
46-
plugin?.options || {},
47-
context.options[0] || {},
48-
]);
44+
const options = defu(context.options[0] || {}, plugin?.options || {}, {
45+
alias: [],
46+
cwd: context.cwd,
47+
});
4948

5049
if (options.alias.length === 0) {
5150
throw new Error(

0 commit comments

Comments
 (0)