feat(attw): add profile-based filtering and configurable error levels#313
Merged
sxzz merged 8 commits intorolldown:mainfrom Jun 12, 2025
Merged
feat(attw): add profile-based filtering and configurable error levels#313sxzz merged 8 commits intorolldown:mainfrom
sxzz merged 8 commits intorolldown:mainfrom
Conversation
- Add ATTW profiles (strict, node16, esmOnly) with corresponding resolution mode filters - Add configurable level option (error/warn) to control build behavior - Improve problem reporting with structured output format - Add proper TypeScript types for AttwOptions with profile and level configuration - Set working directory for npm pack command to respect project context - Filter problems based on selected profile to reduce noise This enhancement allows for more flexible ATTW checking by ignoring specific resolution failures based on the target environment and controlling whether type issues should fail the build or just warn.
❌ Deploy Preview for tsdown failed.
|
sxzz
reviewed
Jun 11, 2025
sxzz
reviewed
Jun 11, 2025
Co-authored-by: Kevin Deng <sxzz@sxzz.moe>
This reverts commit 16871b3.
Contributor
Author
|
@sxzz thanks for reviewing, I've reverted all changes to the docs folder. Let me know if there is anything missing. |
commit: |
sxzz
requested changes
Jun 12, 2025
Contributor
Author
|
@sxzz fixed |
sxzz
approved these changes
Jun 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR enhances the ATTW (Are The Types Wrong) integration by adding profile-based filtering and configurable error levels, making the type checking more flexible and practical for different project requirements.
Key improvements:
ATTW Profiles: Added three predefined profiles (
strict,node16,esmOnly) that filter out specific resolution mode failures based on the target environment:strict: Requires all resolutions (default behavior)node16: Ignores node10 resolution failuresesmOnly: Ignores CJS resolution failures (node10 and node16-cjs)Configurable Error Levels: Added
leveloption to control build behavior:error: Fails the build when type issues are foundwarn: Only warns about type issues (default behavior)Improved Problem Reporting: Enhanced the output format to show structured problem details including problem kind, resolution mode, and entry point
Better TypeScript Integration: Added proper
AttwOptionsinterface extending the core CheckPackageOptions with the new profile and level configurationsFixed Working Directory: Set the correct working directory for
npm packcommand to respect project contextThis enhancement addresses the common issue where ATTW reports false positives for specific environments (e.g., ESM-only packages getting CJS resolution failures) and provides better control over when type issues should fail the build vs. just warn.
Linked Issues
Additional context
Focus areas for reviewers:
profilesconstant and the problem filtering implementation to ensure it correctly excludes the intended resolution modesAttwOptionsinterface extends the core library types - please verify the type definitions are accurate and completelevel: 'error'is set - please review that this works as expected and doesn't break existing workflowsThe changes maintain full backward compatibility while providing new opt-in functionality for more granular control over ATTW checking behavior.