Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Please make checkTypeScriptVersions aggregate version mismatches #505

Open
SimonSchick opened this issue Oct 27, 2018 · 0 comments
Open

Comments

@SimonSchick
Copy link
Contributor

It's rather tedious that you have to re-run the tester every time you fix a version mismatch.

I "hacked" my local installation with something like this:

function checkTypeScriptVersions(allPackages) {
    const violations = [];
    for (const pkg of allPackages.allTypings()) {
        for (const dep of allPackages.allDependencyTypings(pkg)) {
            if (dep.minTypeScriptVersion > pkg.minTypeScriptVersion) {
                violations.push({
                    dep,
                    pkg,
                });
            }
        }
    }
    if (violations.length === 0) {
        return;
    }
    throw new Error(
        violations.map(
            ({ pkg, dep }) =>
                `${pkg.desc} depends on ${dep.desc} but has a lower required TypeScript version (${dep.minTypeScriptVersion} > ${pkg.minTypeScriptVersion}).`,
        )
        .join('\n'),
    );
}

Please consider this change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant