调整 tsconfig 配置

This commit is contained in:
liaoxuezhi 2022-06-01 15:30:44 +08:00
parent ebb798edf6
commit 7a83562589
7 changed files with 30 additions and 12 deletions

View File

@ -786,7 +786,7 @@ export function eachTree<T extends TreeItem>(
tree.map((item, index) => {
iterator(item, index, level);
if (item.children && item.children.splice) {
if (item.children?.splice) {
eachTree(item.children, iterator, level + 1);
}
});
@ -897,7 +897,7 @@ export function filterTree<T extends TreeItem>(
return tree
.filter((item, index) => iterator(item, index, level))
.map(item => {
if (item.children && item.children.splice) {
if (item.children?.splice) {
let children = filterTree(
item.children,
iterator,
@ -937,7 +937,7 @@ export function everyTree<T extends TreeItem>(
return tree.every((item, index) => {
const value: any = iterator(item, index, level, paths, indexes);
if (value && item.children && item.children.splice) {
if (value && item.children?.splice) {
return everyTree(
item.children,
iterator,

View File

@ -3,8 +3,16 @@
"compilerOptions": {
"rootDir": "./",
"outDir": "./dist",
"typeRoots": ["./node_modules/@types", "../../types"]
"typeRoots": [
"../../types",
"./node_modules/@types",
"../../node_modules/@types"
]
},
"include": ["src/**/*"],
"references": []
"references": [
{
"path": "../amis-formula"
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,11 @@
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"typeRoots": ["./node_modules/@types"]
"typeRoots": [
"../../types",
"./node_modules/@types",
"../../node_modules/@types"
]
},
"include": ["src/**/*"],
"references": []

View File

@ -9,6 +9,11 @@
"../../node_modules/@types"
]
},
"include": ["src/**/*", "__tests__/**/*", "src/custom.d.ts"],
"include": [
"src/**/*",
"__tests__/**/*",
"src/custom.d.ts",
"../amis-core/src/utils/formula.ts"
],
"references": [{"path": "../amis-core"}]
}

View File

@ -3,9 +3,12 @@
"compilerOptions": {
"outDir": "lib",
"rootDir": "./",
"typeRoots": ["./node_modules/@types", "../../types"]
"typeRoots": [
"../../types",
"./node_modules/@types",
"../../node_modules/@types"
]
},
"include": ["src/**/*"],
"references": []
// "references": [{"path": "../amis-core"}, {"path": "../../"}]
"references": [{"path": "../amis-core"}, {"path": "../amis-ui"}]
}

File diff suppressed because one or more lines are too long