Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last semicolon in file is not parsed #1806

Closed
mvorisek opened this issue Dec 17, 2022 · 2 comments
Closed

Last semicolon in file is not parsed #1806

mvorisek opened this issue Dec 17, 2022 · 2 comments

Comments

@mvorisek
Copy link

LESS file:

@variable: {
  field: something;
};

is currently parsed wrongly and the raws property contains:

raws: { semicolon: false, after: ';\n' },

but I would expect:

raws: { semicolon: true, after: '\n' },

Observations:

  • the problem seems to be in lib/parser.js file
  • the semicolon is not consumed only for the last LESS variable in file
  • file like @variable: something; (ie. variable without curly brackets) has the semicolon consumed correctly
@ai
Copy link
Member

ai commented Dec 17, 2022

You need to open issue at PostCSS Less parser.

This repo is for standard CSS parser. It is illegal syntax for it.

@mvorisek
Copy link
Author

mvorisek commented Dec 17, 2022

Sorry for opening an issue here, I belive the problem is in prettier itself - see prettier/prettier#14007.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants