Skip to content

Add /* autoprefixer: ignore next warning */ control comment - #1560

Merged
ai merged 3 commits into
postcss:mainfrom
dualfroz:fix/1386-ignore-next-warning
Oct 7, 2026
Merged

ai merged 3 commits into
postcss:mainfrom
dualfroz:fix/1386-ignore-next-warning

Conversation

@dualfroz

@dualfroz dualfroz commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

hides warnings for the next node only, prefixes are still added. the ignore next regex also matched this text, so it skips ignore next warning now, otherwise the new comment would turn prefixing off too

Fixes #1386

Comment thread lib/processor.js Outdated
Instead of testing every comment in the stylesheet and marking the
next node, the warning filter walks back from each warned node over
the prefixed copies inserted before it and checks the comment there.
Comment thread lib/processor.js Outdated
})

// Remove warnings hidden by ignore next warning control comments
result.messages = result.messages.filter(i => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is a dirty way—why we add warning if we don't need it?

It is better to add warn() function which will do the check on its one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added a warn() helper to utils that checks for the comment before calling result.warn, all warnings go through it now so nothing gets added and filtered out later

@ai
ai merged commit 0efb61b into postcss:main Oct 7, 2026
9 checks passed
@ai

ai commented Oct 7, 2026

Copy link
Copy Markdown
Member

Thanks. I will release it later this month with some other features.

Am I right, that you do not need this feature, and it is just LLM contribution.

@dualfroz

dualfroz commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

i picked it from the issue tracker, not from my own project. i use AI tools for parts of the work, but i read, test and stand behind every change myself

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.

Can not find grid areas: intentional-left-blank

2 participants