feat: add scripts to check pkg in attw / expectedVersionFailures #1133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A much more formal script setup for #1130. See if the code makes sense to DT-tools maintainer first, then I will proceed to incorporating them into github actions.
This PR involve some refactoring on existing dtslint code. Few things you may want to take notes on.
feat(dtslint): apply mangleScopedPackage() for package name
mangleScopedPackage()from@definitelytyped/utilsis used for package name. This shall faciliate code reuse.refactor: extract functions into util folder with minor fix
Some assertions in
packages/dtslint/src/index.tsis moved topackages/dtslint/src/util.ts, with small modifications.In
findDTRootAndPackageNameFrom(), the assertions are reordered, to make the code more readable.In
assertPathIsInDefinitelyTyped(), the condition is modified. Hence if a non-existing type lib is used to run test in DT, e.g.pnpm run abc, then the error is this assertion will be properly thrown. Note that it will replace the current behaviour of throwingError: ENOENT: no such file or directory, scandir '/<root-dir>/DefinitelyTyped/types/abc'in non-existing type lib test.feat: add scripts to check pkg in attw / expectedVersionFailures
Two relatively simple scripts are added, aiming to check (failed) package in
attw.jsonandexpectedVersionFailures.txtin future github action development.