fix(react): update template comment to be valid css#33169
fix(react): update template comment to be valid css#33169Coly010 merged 2 commits intonrwl:masterfrom
Conversation
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Changed // Your style here to /* Your style here */ in styled-components template to use proper CSS comment syntax.
|
View your CI Pipeline Execution ↗ for commit aa8a357
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
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
<!-- 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)
<!-- 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>
|
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. |

Current Behavior
The
//comment in the styled template is not valid css and is causing stylelint to throw errors upon creating new appsExpected Behavior
It should be valid css
Related Issue(s)
#33579