question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missed semicolon has incorrect collumn

See original GitHub issue

Clearly describe the bug

The Missed semicolon error will produce an incorrect column.

Which rule, if any, is the bug related to?

CssSyntaxError

What code is needed to reproduce the bug?

e.g.

div {
        color: red !important
        background-color: #000
}

What stylelint configuration is needed to reproduce the bug?

CSSSyntaxError is enabled by default and not a rule.

{
  "rules": {}
}

Which version of stylelint are you using?

13.13.1

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

Demo, otherwise you can do it with stylelint test.css --config test.json

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

Nope.

What did you expect to happen?

Show the error:

test.css
 2:30  ✖  Missed semicolon   CssSyntaxError

With the column at 30 which is after !important and the correct place to add the semicolon

What actually happened (e.g. what warnings or errors did you get)?

Show the error:

test.css
 2:20  ✖  Missed semicolon   CssSyntaxError

With the the column at 20 which is before !important and not the correct place to add the semicolon. It should instead error at the correct place which is after !important and in this case at column 30.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ybiquitouscommented, Jul 21, 2021

@Gusted Great! The PR you created has been merged soon! 👏🏼

0reactions
Gustedcommented, Jul 21, 2021

It is not CSS/LESS/SCSS/SASS/etc, invalid CSS === linter doesn’t work

That’s correct, but the error in this one comes from a Syntaxerror, which should error at the correct place IMO. It’s a bit weird to go error at some place which is incorrect at it’s own.

you need custom parser for this weird CSS

Not sure how this is weird css I actually found about this bug when I forgot to add my semi-column and stylelint was erroring it should add an semi-column at the wrong place.

Anyway, thanks for diagnosing the bug - hopefully can be handled over at postcss.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple SQL query in Access fails with a missing semicolon error
Syntax is wrong, you need to remove the "VALUES" keyword. This is assuming that ID, [Name], [Some value] and [Some other value] are...
Read more >
8.1 - Missing Semicolons | STAT 480
My advice: when your SAS program won't run, and you have ERROR messages appearing in your log window, check to see if you...
Read more >
Missing semicolon (;) at end of SQL statement. - CodeProject
You have the word "VALUES" in your SQL twice: string query = "insert into arms_records values (...)" + " values (...)";
Read more >
SyntaxError: missing ; before statement - JavaScript | MDN
The JavaScript exception "missing ; before statement" occurs when there is a semicolon (;) missing somewhere and can't be added by automatic semicolon...
Read more >
SA0078 : Statement is not terminated with semicolon
The topic describes the SA0078 analysis rule. The rule checks for statements not terminated with semicolon. Consider terminating all statements with semicolon ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found