Skip to content

Conversation

@lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Jun 22, 2025

Prerequisites checklist

What is the purpose of this pull request?

In this PR, I’ve updated the tsconfig.json file to include all .js and .ts files in the src directory.

Previously, due to the changes introduced in #383, type checking was only applied to src/index.js, and the rest of the src directory was skipped. As a result, newly added rules and other files did not benefit from type checking.

Here’s a minimal way to reproduce the issue:

  • Create a test.js file at src/rules/test.js:

    image

    The Set doesn’t have a push method, but type checking doesn’t catch this error.

  • After updating the tsconfig.json:

    image

    Type checking works as intended.

What changes did you make? (Give an overview)

Related Issues

Is there anything you'd like reviewers to focus on?

@@ -1,5 +1,5 @@
{
"files": ["src/index.js"],
"include": ["src/**/*.js", "src/**/*.ts"],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use the files field, glob patterns are not supported.

@lumirlumir lumirlumir marked this pull request as ready for review June 22, 2025 11:08
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jun 22, 2025
Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has changed the dist directory structure.

Before

Screenshot 2025-06-23 at 10 23 33 AM

After

Screenshot 2025-06-23 at 10 23 03 AM

@snitin315 snitin315 moved this from Needs Triage to Evaluating in Triage Jun 23, 2025
@snitin315
Copy link
Contributor

So the package export's aren't valid anymore:

markdown/package.json

Lines 11 to 24 in 589323f

"main": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"exports": {
".": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"./types": {
"types": "./dist/esm/types.d.ts"
}
},
"files": [
"dist"
],

@lumirlumir
Copy link
Member Author

lumirlumir commented Jun 23, 2025

@snitin315 Thanks for sharing the context.

However, the changes you mentioned originate from #383, not from this PR. (I believe the latest changes from #383 are not yet reflected in your local environment.)

Even if we revert the changes in this PR, the dist folder remains the same — the differences shown in your screenshot are due to #383.

So the package exports aren't valid anymore:

That’s exactly why #383 was marked as a breaking change — the file structure in the dist folder was changed in that PR.

@lumirlumir lumirlumir requested a review from snitin315 June 23, 2025 08:43
@snitin315
Copy link
Contributor

Ah! Got it, thanks for the explanation. My local main branch was outdated.

@snitin315 snitin315 merged commit b24cafc into main Jun 23, 2025
23 checks passed
@snitin315 snitin315 deleted the chore-fix-tsconfig-json-to-include-js-and-ts-files-in-src-dir branch June 23, 2025 08:55
@github-project-automation github-project-automation bot moved this from Evaluating to Complete in Triage Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants