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 consumed #173

Closed
mvorisek opened this issue Dec 17, 2022 · 1 comment
Closed

Last semicolon in file is not consumed #173

mvorisek opened this issue Dec 17, 2022 · 1 comment

Comments

@mvorisek
Copy link

mvorisek commented Dec 17, 2022

(originally posted in postcss as postcss/postcss#1806)

LESS

@variable: {
  field: something;
};

Actual Behavior

is currently parsed wrongly and the raws property (in postcss) contains:

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

Expected Behavior

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

@mvorisek
Copy link
Author

I belive the problem is not here, but in prettier directly - 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

1 participant