首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏前端从进阶到入院

    如何在大型代码仓库中删掉 6w 行废弃的文件和 exports?

    . ignore interfaces/type aliases that describe a parameter type in the same file) import { Project, TypeGuards tsconfig.json" }); for (const file of project.getSourceFiles()) { file.forEachChild((child) => { if (TypeGuards.isVariableStatement } else if (isExported(child)) checkNode(child); }); } function isExported(node: Node) { return TypeGuards.isExportableNode TypeGuards.isReferenceFindableNode(node)) return; const file = node.getSourceFile(); if ( node.findReferencesAsNodes length === 0 ) console.log( `[${file.getFilePath()}:${node.getStartLineNumber()}: ${ TypeGuards.hasName

    5.5K20编辑于 2022-03-10
  • 来自专栏前端劝退师

    如何在大型代码仓库中删掉废弃的文件和 exports?

    . ignore interfaces/type aliases that describe a parameter type in the same file) import { Project, TypeGuards tsconfig.json" }); for (const file of project.getSourceFiles()) { file.forEachChild((child) => { if (TypeGuards.isVariableStatement } else if (isExported(child)) checkNode(child); }); } function isExported(node: Node) { return TypeGuards.isExportableNode TypeGuards.isReferenceFindableNode(node)) return; const file = node.getSourceFile(); if ( node.findReferencesAsNodes length === 0 ) console.log( `[${file.getFilePath()}:${node.getStartLineNumber()}: ${ TypeGuards.hasName

    5.5K60发布于 2021-09-08
领券