Skip to content

fix(core): prefer later entries of an extends array for cmkOptions - #473

Closed
RClaudiuM wants to merge 1 commit into
mizdra:mainfrom
RClaudiuM:fix/453-extends-array-precedence
Closed

RClaudiuM wants to merge 1 commit into
mizdra:mainfrom
RClaudiuM:fix/453-extends-array-precedence

Conversation

@RClaudiuM

@RClaudiuM RClaudiuM commented Nov 8, 2026 •

Copy link
Copy Markdown

Fixes #453

What

readConfigFile merged the extended tsconfig files in the flattened order of extendedSourceFiles and never overwrote an option that was already set. For a chain of extends, that order puts the nearest file first, so the precedence was right. For an extends array it let the earliest entry win, while TypeScript lets the latest entry win for compilerOptions.

Now the inherited options are resolved per extends entry. A later entry, together with the files it extends in turn, takes precedence over an earlier one. The file's own cmkOptions still win over everything it extends. Diagnostics are collected the same way as before.

extendedSourceFiles only gives the flattened list, so the direct entries are recovered by skipping the files each entry extends in turn. There is one case this can't tell apart: an entry that also appears earlier in the list because an earlier entry extends it ("extends": ["./a.json", "./c.json"] where a.json extends c.json). That case keeps the old precedence.

Tests

Two tests added to packages/core/src/config.test.ts:

  • prefers a later entry of an `extends` array over an earlier one: the example from the issue (dtsOutDir is now generated2, same source as compilerOptions.module)
  • prefers the tsconfig extended by a later entry of an `extends` array over an earlier entry

Before the fix, both tests fail (dtsOutDir resolves to generated1). After the fix:

  • vp test: 43 files, 502 passed
  • vp check: passes
  • vp run build: passes

I did not run vp run vscode-test locally.

@changeset-bot

changeset-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e4122a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@css-modules-kit/core Patch
@css-modules-kit/ts-plugin Patch
@css-modules-kit/codegen Patch
@css-modules-kit/content-mapper Patch
@css-modules-kit/core-strada Patch
@css-modules-kit/eslint-plugin Patch
@css-modules-kit/stylelint-plugin Patch
css-modules-kit-vscode Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

readConfigFile merged the extended tsconfig files in the flattened order of extendedSourceFiles and never overwrote an option that was already set. That is right for a chain of extends, but for an extends array it let the earliest entry win, while TypeScript lets the latest entry win.

Resolve the inherited options per extends entry instead, so a later entry (and the files it extends) takes precedence over an earlier one.

Fixes mizdra#453
@RClaudiuM
RClaudiuM force-pushed the fix/453-extends-array-precedence branch from 7651013 to e4122a3 Compare November 10, 2026 17:01
@mizdra mizdra added the Type: Bug Bug or Bug fixes label Nov 12, 2026
@mizdra

mizdra commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

You created 157 PRs across 140 repositories in the 3 days from November 6 to November 8, 2026. This is clearly beyond the scope of what you can reasonably manage to seriously address feedback from reviewers. Even if I leave review comments, you likely won't examine them carefully and will just let AI handle the replies. That is completely unacceptable.

I cannot accept your PRs, so I am closing them.

@mizdra mizdra closed this Nov 12, 2026
@RClaudiuM

Copy link
Copy Markdown
Author

Fair enough, it's your repo. Though "let AI handle it" is a funny objection when Claude co-authored 20 of the last 23 commits on main here. No hard feelings.

@mizdra

mizdra commented Nov 12, 2026

Copy link
Copy Markdown
Owner

We welcome the use of AI. However, we ask that you respond carefully to reviewers’ comments. It’s fine to understand the intent behind the reviewers’ comments, work with the AI to determine a course of action, have the AI make the corrections, and then commit the changes.

However, it is unacceptable for you to instruct the AI to make corrections without even looking at the reviewer’s feedback, and then have the AI generate a response to the reviewer without even reviewing the AI’s output. I want you to understand the reviewer’s feedback and verify the AI’s output before pushing the changes.

To be honest, I don’t know if you’re leaving everything up to the AI. But judging by the large number of PRs you’re creating, that’s how it appears to me.

@RClaudiuM

Copy link
Copy Markdown
Author

Agreed, that's fair. I had some extra AI usage, so I went through open issues and used it to open PRs, which is where the volume came from. I do follow the review threads, but I understand why it looks the way it does, especially now that everything is "agentic". 🙄
If you're open to reviewing this, I'll read your comments myself and check the AI's changes before pushing anything.

@mizdra

mizdra commented Nov 12, 2026

Copy link
Copy Markdown
Owner

I am glad that my point got across.

If you're open to reviewing this

I appreciate the sentiment, but I cannot do that. The issue is not just that you are acting as a meat proxy in css-modules-kit. The problem is that you are doing so in many other repositories as well. It is difficult to trust someone when they say, "I act as a meat proxy in other repositories, but I won't do it in this one. Please trust me." In other words, you have lost my trust.

I do not plan to accept contributions from you for a certain period of time. After some time has passed and I can confirm that you are no longer acting as a meat proxy for other repositories, I might be able to accept your contributions again.

@RClaudiuM
RClaudiuM deleted the fix/453-extends-array-precedence branch November 12, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Bug or Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An earlier entry of an extends array takes precedence over a later one for cmkOptions

2 participants