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

Fixed: max-line-length rule is now reported correct column for SASS comments. #2340

Merged
merged 1 commit into from Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/rules/max-line-length/__tests__/index.js
Expand Up @@ -97,9 +97,27 @@ testRule(rule, {
message: messages.expected(20),
line: 1,
column: 48,
}, {
code: "a {\n /* Lorem ipsum dolor sit amet. The comment Lorem ipsum dolor sit amet, consectetur adipisicing elit. Praesentium officia fugiat unde deserunt sit, tenetur! Incidunt similique blanditiis placeat ad quia possimus libero, reiciendis excepturi non esse deserunt a odit. */\n}",
message: messages.expected(20),
line: 2,
column: 272,
} ],
})

testRule(rule, {
ruleName,
syntax: "scss",
config: [20],

reject: [{
code: "a {\n // Lorem ipsum dolor sit amet. The comment Lorem ipsum dolor sit amet, consectetur adipisicing elit. Praesentium officia fugiat unde deserunt sit, tenetur! Incidunt similique blanditiis placeat ad quia possimus libero, reiciendis excepturi non esse deserunt a odit.\n}",
message: messages.expected(20),
line: 2,
column: 269,
}],
})

testRule(rule, {
ruleName,
config: [30],
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/max-line-length/index.js
Expand Up @@ -33,7 +33,7 @@ const rule = function (maxLength, options) {
return
}

const rootString = root.toString()
const rootString = root.source.input.css

const ignoreNonComments = optionsMatches(options, "ignore", "non-comments")
const ignoreComments = optionsMatches(options, "ignore", "comments")
Expand Down