Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4.6k
Use new sass-parser for Sass parsing#17915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
* main: (140 commits) chore(deps): update dependency esbuild to v0.25.10 (prettier#17913) chore(deps): update dependency sdbm to v3 (prettier#17914) Prevent matching mixin calls inside arguments (prettier#17903) chore(deps): update dependency oxc-parser to v0.89.0 (prettier#17912) Improve emoji width measurement (prettier#17813) Unify `require()` and `import()` formatting logic (prettier#17902) Allow `parser.preprocess` to return a `Promise` (prettier#17679) Fix config file names order (prettier#17685) Fix format of comments around `ChainExpression` (prettier#17723) Cleanup cspell.json (2025-09-11) (prettier#17901) Add automated job to clean cspell.json yearly (prettier#17900) Add missing parentheses to arrow function in `TSInstantiationExpression` (prettier#17724) Increased level of self-documentation of code (prettier#17765) Fix crash on CSS custom properties (prettier#17899) doc: update related-projects.md (prettier#17804) docs: add monaco-prettier integration (prettier#17815) Build: stop transforming optional chaining (prettier#17863) Remove unnecessary path parameters (prettier#17867) chore(deps): update dependency nano-spawn to v1.0.3 (prettier#17898) chore(deps): update dependency knip to v5.63.1 (prettier#17896) ...
netlifybot commentedSep 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview forprettier ready!Builtwithout sensitive environment variables
To edit notification comments on pull requests, go to yourNetlify project configuration. |
Please don't change existing tests add this as a new css (sass) parser like we have for js/ts/etc |
@alexander-akait Can you help clarify to be sure I understand? My intention is that this would eventuallyreplace the existing |
@alexander-akait Any feedback on my questions above? I'm happy to adjust this PR once I have a clearer sense for what you're requesting. Thanks! |
Description
See#17732.
This draft PR integrates
sass-parser
into Prettier for Sass parsing (and presumably could be expanded to include CSS parsing as well). For ease of initial testing, this first draft adds a newsassparser
parsing language, and leaves the existingscss
parser intact. Sass tests are modified to run against the new parser, so that test failures highlight formatting differences:There are currently a lot of test failures. Many of them should hopefully be resolved with fixes/additions to the underlying Sass parser, but some of them represent possible formatting improvements, and/or edge cases that still need to be addressed.
Todo
sass-parser
isn't production-ready, and is still missing some critical features. Many of these are documented with// TODO
comments in the new parser, including:raws
datadeclaration.important
throws an errorconfiguration
nodes are missingsource.span
(throws an error)@extend
nodes expose a parsedselector
?@prettier-placeholder
(see alsoProposal: refactor css placeholder for TemplateLiteral #6790)Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.