allow to opt-out from css pure linting#898
Merged
devongovett merged 1 commit intoparcel-bundler:masterfrom Mar 14, 2025
Merged
Conversation
devongovett
approved these changes
Mar 14, 2025
joshuadavidthomas
pushed a commit
to joshuadavidthomas/lightningcss
that referenced
this pull request
Mar 17, 2025
joshuadavidthomas
pushed a commit
to joshuadavidthomas/lightningcss
that referenced
this pull request
Mar 17, 2025
samcx
added a commit
to vercel/next.js
that referenced
this pull request
Apr 2, 2025
… like View Transitions (#77321) ## What? This PR adds support for `cssmodules-pure-no-check` in CSS Modules by upgrading `postcss-modules-local-by-default` from 4.0.4 to 4.2.0 (`cssmodules-pure-no-check` was also recently [merged into LightningCSS 1.29.3](parcel-bundler/lightningcss#898)) ## Why? Global CSS selectors like View Transitions API require global scope to work properly. Currently, there's no clean way to use these selectors with CSS Modules in Next.js, which causes issues when: 1. Using the View Transitions API 2. Migrating from css-in-js libraries like styled-components to React Server Components with CSS Modules ## How? - Upgrades `postcss-modules-local-by-default` to 4.2.0 - Adds support for the `/* cssmodules-pure-no-check */` comment pattern in CSS files which disables CSS Modules localization for that file - This mirrors established escape hatches in other tools (`@ts-nocheck`, `/* eslint-disable */`) - Added tests (similar to one @samcx wrote previously) to ensure functionality works correctly The approach was previously approved by @samcx in issue #77232, who mentioned that LightningCSS was already bumped, but we needed to bump the PostCSS side Fixes #77232 --------- Co-authored-by: Sam Ko <sam@vercel.com>
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.
This PR adds support for the
/* cssmodules-pure-no-check */comment which allows users to disable thepureCSS modules check for the entire file (similar to// @ts-nocheck)The feature is a port from postcss
Details
/* cssmodules-pure-no-check */comment at the beginning of the CSS file and setspuretofalseincss_modulesoptions.Solves #889