Skip to content

fix(react): update template comment to be valid css#33169

Merged
Coly010 merged 2 commits intonrwl:masterfrom
jameskraus:master
Dec 12, 2025
Merged

fix(react): update template comment to be valid css#33169
Coly010 merged 2 commits intonrwl:masterfrom
jameskraus:master

Conversation

@jameskraus
Copy link
Copy Markdown
Contributor

@jameskraus jameskraus commented Oct 21, 2025

Current Behavior

The // comment in the styled template is not valid css and is causing stylelint to throw errors upon creating new apps

Expected Behavior

It should be valid css

Related Issue(s)

#33579

@jameskraus jameskraus requested a review from a team as a code owner October 21, 2025 18:34
@jameskraus jameskraus requested a review from Coly010 October 21, 2025 18:34
@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 21, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit aa8a357

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 12, 2025 5:53pm

@Coly010 Coly010 changed the title Update template comment to be valid css fix(react): update template comment to be valid css Dec 12, 2025
Changed // Your style here to /* Your style here */ in styled-components template to use proper CSS comment syntax.
@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Dec 12, 2025

View your CI Pipeline Execution ↗ for commit aa8a357

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ⏳ In Progress ... View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 31s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 13s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 9s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-12 18:19:24 UTC

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Important

A new CI pipeline execution was requested that may update the conclusion below...

Nx Cloud is proposing a fix for your failed CI:

These changes update the test snapshots to align with the PR's intention of using valid CSS comment syntax. We replaced the invalid // Your style here comments with valid CSS block comments /* Your style here */ in all 4 affected snapshots, ensuring the tests now pass with the corrected template output.

We verified this fix by re-running react:test.

Suggested Fix changes
diff --git a/packages/react/src/generators/application/__snapshots__/application.spec.ts.snap b/packages/react/src/generators/application/__snapshots__/application.spec.ts.snap
index b7b15b3115..129c2b29ed 100644
--- a/packages/react/src/generators/application/__snapshots__/application.spec.ts.snap
+++ b/packages/react/src/generators/application/__snapshots__/application.spec.ts.snap
@@ -5,7 +5,7 @@ exports[`app --bundler=rsbuild should generate valid rsbuild config files for @e
 import NxWelcome from "./nx-welcome";
 
 const StyledApp = styled.div\`
-    // Your style here
+    /* Your style here */
 \`;
 
 export function App() {
@@ -72,7 +72,7 @@ exports[`app --bundler=rsbuild should generate valid rsbuild config files for st
 import NxWelcome from "./nx-welcome";
 
 const StyledApp = styled.div\`
-    // Your style here
+    /* Your style here */
 \`;
 
 export function App() {
@@ -592,7 +592,7 @@ exports[`app should generate valid .babelrc JSON config for CSS-in-JS solutions
 import NxWelcome from "./nx-welcome";
 
 const StyledApp = styled.div\`
-    // Your style here
+    /* Your style here */
 \`;
 
 export function App() {
@@ -631,7 +631,7 @@ exports[`app should generate valid .babelrc JSON config for CSS-in-JS solutions
 import NxWelcome from "./nx-welcome";
 
 const StyledApp = styled.div\`
-    // Your style here
+    /* Your style here */
 \`;
 
 export function App() {

Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.

Apply changes locally with:

npx nx-cloud apply-locally fq1y-3Aeh

Apply fix locally with your editor ↗   View interactive diff ↗


🎓 Learn more about Self-Healing CI on nx.dev

@Coly010 Coly010 merged commit fe2bf86 into nrwl:master Dec 12, 2025
16 of 17 checks passed
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The `//` comment in the styled template [is not valid
css](https://stackoverflow.com/questions/12298890/is-it-bad-practice-to-prefix-single-lines-of-css-with-as-a-personal-comment-s/20192639#20192639)
and is causing [stylelint](https://stylelint.io/) to throw errors upon
creating new apps

## Expected Behavior
It should be valid css

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

#33579

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
(cherry picked from commit fe2bf86)
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
The `//` comment in the styled template [is not valid
css](https://stackoverflow.com/questions/12298890/is-it-bad-practice-to-prefix-single-lines-of-css-with-as-a-personal-comment-s/20192639#20192639)
and is causing [stylelint](https://stylelint.io/) to throw errors upon
creating new apps

## Expected Behavior
It should be valid css

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

#33579

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants