Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add scripts to check pkg in attw / expectedVersionFailures #1133

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hkleungai
Copy link
Contributor

@hkleungai hkleungai commented Jan 17, 2025

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/utils is 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.ts is moved to packages/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 throwing Error: 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.json and expectedVersionFailures.txt in future github action development.

pnpm-lock.yaml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants