Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
jgerigmeyer wants to merge3 commits intoprettier:main
base:main
Choose a base branch
Loading
fromoddbird:sass-parser-2

Conversation

jgerigmeyer
Copy link

Description

See#17732.

This draft PR integratessass-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:

yarn test tests/format/scss/

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:
    • selector parsing is not yet implemented
    • nodes are missingraws data
    • declaration.important throws an error
    • configuration nodes are missingsource.span (throws an error)
    • should@extend nodes expose a parsedselector?
  • In addition, some Prettier-specific features have also not yet been implemented in this PR

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in thedocs/ directory).
  • (If the change is user-facing) I’ve added my changes tochangelog_unreleased/*/XXXX.md file followingchangelog_unreleased/TEMPLATE.md.
  • I’ve read thecontributing guidelines.

* 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)  ...
@netlifyNetlify
Copy link

netlifybot commentedSep 18, 2025
edited
Loading

Deploy Preview forprettier ready!

Builtwithout sensitive environment variables

NameLink
🔨 Latest commit41bbe88
🔍 Latest deploy loghttps://app.netlify.com/projects/prettier/deploys/68d705d50ad8820008cad2e0
😎 Deploy Previewhttps://deploy-preview-17915--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify project configuration.

@alexander-akait
Copy link
Member

Please don't change existing tests add this as a new css (sass) parser like we have for js/ts/etc

@jgerigmeyer
Copy link
Author

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 existingpostcss-scss parser for Sass inlanguage-css, and thus the tests informat/scss/ would run against this new parser. (I kept it in a newlanguage-sassparser dir temporarily so that the output of the two could be more easily compared.) Are you asking me to leave the currentformat/scss/ tests unchanged, and temporarily add a newformat/sassparser/ test dir? I can do that, and/or move the new parser into alanguage-css/sassparser.js file if that's helpful.

@jgerigmeyer
Copy link
Author

@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!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@jgerigmeyer@alexander-akait

[8]ページ先頭

©2009-2025 Movatter.jp