Repository navigation
Fix: docs(frontend): document CSP-safe styling conventions (no inline styles) - #1672
Merged
Merged
Conversation
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.
Closes #1670
Summary
Primary deliverable is documentation (frontend/docs/styling.md + pointers from CONTRIBUTING.md and frontend/README.md). The ESLint enforcement step is optional per the issue but recommended; before editing, verify which ESLint config format is actually active (the listed
.eslintrc.js/.eslintrc.jsonfiles appear empty, and the project uses ESLint 9 + eslint-config-next which typically uses flat config). Ensure the chosen rule (react/forbid-dom-propsforstyle) is compatible with the installed eslint-plugin-react version, and that adding it does not break existing code that legitimately usesstyle(e.g. dynamic CSS variables) — if such cases exist, document the approved escape hatch (e.g. CSS custom properties set via className) rather than disabling the rule. Reference commits 5bd5e51 and e80a15b in the doc for historical context.Changes
styleprops are stripped/blocked in production, causing silent rendering failures), document the required CSS-class / CSS-module pattern established by the migration, note that no lint rule currently enforces this and recommend addingreact/forbid-dom-props/react/forbid-component-propsforstyle, and reference the two fix commits (5bd5e51, e80a15b) as historical context. Include correct/incorrect code examples. (frontend/docs/styling.md)frontend/docs/styling.mdand summarizing the no-inline-styles rule, so the convention is discoverable from the main contributing guide. (CONTRIBUTING.md)docs/styling.md(e.g. under a 'Styling' or 'Documentation' section) so frontend contributors find the CSP-safe styling convention. (frontend/README.md)react/forbid-dom-propsrule (withstylein the forbid list) to the ESLint config to prevent regressions. Note: the repo currently has empty.eslintrc.js/.eslintrc.jsonplaceholders and uses ESLint 9 witheslint-config-next; confirm the active flat-config file (e.g.eslint.config.js/.mjs) and add the rule there, or create the appropriate config file if none exists. (frontend/.eslintrc.js).eslintrc.*, add thereact/forbid-dom-propsrule forstyleto the flat ESLint config sonpm run lint(and CI) enforces the CSP-safe styling convention. (frontend/package.json)