Formatting SCSS `Unexpected token, expected`
See original GitHub issueHello!
I wonder if somebody can shed some light on this issue: after spending a couple of hours trying to get the Prettier
plugin working for SCSS files (it works wonderfully for JS files), I’ve given up.
I tried changing settings all over the place (rc file, workplace settings, global settings) and read all the top 10 results on Google. Am i missing something basic here?
Is css/sass unsuported without additional config?
RC files:
After running CMD + SHIFT + P:
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Unexpected token, expected ";" for .css files using Prettier ...
When I am running npm run prettier -- --list-different all of my css files are getting the error SyntaxError: Unexpected token, expected ";" ......
Read more >SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >Syntax checking (hints) SASS language "Unexpected token ...
This is false error reporting. The file complies correctly. This error appears only a flaw in the editor's hint rules for SASS/SCSS language....
Read more >Unexpected token issue, scss variables - Codecademy Forums
<In what way does your code behave incorrectly? Include ALL error messages.> keep getting unexpected token, dont use ids in selectors. Still ...
Read more >How to configure CSS and CSS modules in webpack
With a loader, you can translate another type of file to a format that ... src/styles.css 1:0 Module parse failed: Unexpected token (1:0)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Babylon was the default parser. ie: when none was specified. The parser is now inferred from file’s extension. In your case, you just said: Use babylon whatever file I’m using. In this case a CSS file which indeed couldn’t be parsed by it
I have removed all prettier specific Workspace and User settings. I’ve only got
"editor.formatOnSave": true
enabled forjson
,javascript
andscss
, however:It looks like removing the
"parser": "babylon"
setting fixes the issue. SCSS now formats as expected!It’s kinda strange though, is it not? I was under the impression that Babylon was the default parser.