stylelint: Column start (x) greater than line length (y) error in Atom

Looks like the coordinates for errors are not always correct (value for col is greater than expected). Here’s an example (client/main.less):

.class {
  .mixin();
  .mixin2;
}
$ stylelint --syntax less client/main.less

client/main.less
 2:13  ✖  Unexpected extra semicolon   no-extra-semicolons
 3:12  ✖  Unexpected extra semicolon   no-extra-semicolons

Instead of 2:13 and 3:12, I was expecting to see 2:12 and 3:11 (or even 2:11 and 3:12?). Because there are no characters at 2:13 and 3:12, Atom fires an exception:

Error: Column start (11) greater than line length (10)
Error: Column start (11) greater than line length (10)
    at Object.rangeFromLineNumber (/home/[username]/.atom/packages/linter-stylelint/node_modules/atom-linter/lib/index.js:181:11)
    at /home/[username]/.atom/packages/editorconfig/node_modules/lazy-req/index.js:20:26
    at createRange (/home/[username]/.atom/packages/linter-stylelint/lib/index.js:65:10)
    at /home/[username]/.atom/packages/linter-stylelint/lib/index.js:110:14
    at Array.map (native)
    at stylelint.lint.then.error.type (/home/[username]/.atom/packages/linter-stylelint/lib/index.js:104:38)

.stylelintrc:

{
  "extends": "stylelint-config-standard",
  "rules": {
  }
}

Stylelint v6.5.1

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 24 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Hi guys!

Sorry, I will try to add some tests later, now I don’t have much time 😦

@kachkaev Can you please create new issues for each of the above please

@ntwb will do this tomorrow morning – don’t have the project around at the moment. Thank you!