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

🐛 Bug: Writing Multi stage config results having null in include files array #2113

Closed
3 tasks done
rubiesonthesky opened this issue Jan 7, 2025 · 1 comment · Fixed by #2114
Closed
3 tasks done
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :( 🐛

Comments

@rubiesonthesky
Copy link
Collaborator

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

Include array should not contain null value

 "include": [
            "test/**/*.{ts,tsx}"
        ]

Actual

 "include": [
            "test/**/*.{ts,tsx}",
            null
        ]

Additional Info

I generated typestat.json for this repo by selecting all possible options in improvements section: Which improvements would you like to make?

The bug is in writeSingleTypeScriptConfig function where sourceFiles is not being checked for being present before adding it to array.

It would help to catch bugs if those configs would be type checked. By trying to type check them, I found another possible bug: printImprovements adds inferableTypes: true, when it should probably be noInferableTypes.

My answers

✔ What are you trying to accomplish? · Improve typings in my TypeScript files
✔ Where is your tsconfig.json? · ./tsconfig.json
✔ Which improvements would you like to make? · Add missing property declarations to classes, Enable the --noImplicitAny compiler flag, Enable the --noImplicitThis compiler flag, Remove type annotations that don't change the meaning of code, Enable the --strictNullChecks compiler flag

✔ Which glob matches files you'd like to convert? · everything
✔ Which glob matches your test files? · test/**/*.{ts,tsx}

Full typestat.json

[
    {
        "fixes": {
            "incompleteTypes": true,
            "noImplicitAny": true,
            "noInferableTypes": true,
            "noImplicitThis": true,
            "strictNonNullAssertions": true
        },
        "projectPath": "./tsconfig.json",
        "types": {
            "strictNullChecks": true
        },
        "include": [
            "test/**/*.{ts,tsx}"
        ]
    },
    {
        "fixes": {
            "incompleteTypes": true,
            "noImplicitAny": true,
            "noInferableTypes": true,
            "noImplicitThis": true
        },
        "projectPath": "./tsconfig.json",
        "exclude": [
            "test/**/*.{ts,tsx}"
        ]
    },
    {
        "fixes": {
            "incompleteTypes": true,
            "noImplicitAny": true,
            "noInferableTypes": true,
            "noImplicitThis": true
        },
        "projectPath": "./tsconfig.json",
        "include": [
            "test/**/*.{ts,tsx}",
            null
        ]
    }
]
@rubiesonthesky rubiesonthesky added the type: bug Something isn't working :( 🐛 label Jan 7, 2025
@rubiesonthesky rubiesonthesky self-assigned this Jan 7, 2025
@rubiesonthesky rubiesonthesky added the status: accepting prs Please, send a pull request to resolve this! 🙏 label Jan 7, 2025
Copy link

🎉 This is included in version v0.8.10 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :( 🐛
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant