dart-lang / pub-dev

The pub.dev website
https://pub.dev
BSD 3-Clause "New" or "Revised" License
796 stars 146 forks source link

Consider finding a formatter for scss files #8076

Open jonasfj opened 2 months ago

jonasfj commented 2 months ago

I might have an extension in vscode I can't figure out, or vscode has formatting for scss files built-in.

Is this something we should consider enabling?

I'm not sure if there is a good formatting for SASS, and if so, if we need to configure settings etc.

I'm just noting that having automatic formatting isn't the worst idea, if it's easily available, and we all have the same settings. Of course if we risk having different settings, then it becomes a massive pain.

isoos commented 2 months ago

I think the VSCode plugin uses this project: https://github.com/beautifier/js-beautify

We should investigate how hard it would be to make a formatter using the parser and visitor from https://pub.dev/packages/csslib

isoos commented 5 days ago

I've checked https://pub.dev/packages/sass_api and it seems to me that it has a great AST + visitor pattern that we could use to create a canonical format for our sass files.