Navigation Menu

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

Fix: improve newline-per-chained-call message (fixes #6340) #6360

Merged
merged 1 commit into from Jun 14, 2016

Conversation

mysticatea
Copy link
Member

fixes #6340.

  • Changed the message to Expected line break before 'PropertyName'.
    • Property is shorter than object if it's chained.
    • The error locations are at properties, so it's more consistent.

@eslintbot
Copy link

LGTM

}, {
message: "Expected line break after `m1().m2\\n.m3().m4().m5().m6()`."
message: "Expected line break before `.end`."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to add some test cases for computed properties.

@eslintbot
Copy link

LGTM

@mysticatea mysticatea force-pushed the newline-per-chained-call/fix-for-long-message branch from f9bbd76 to a035cf0 Compare June 10, 2016 03:29
@mysticatea
Copy link
Member Author

Thank you for the review!

I updated this.

  • Added suffix for a single line computed property.
  • Added a test for computed properties.

function getPropertyText(node) {
var prefix = node.computed ? "[" : ".";
var lines = sourceCode.getText(node.property).split(/\r\n|\r|\n/g);
var surfix = node.computed && lines.length === 1 ? "]" : "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surfix -> suffix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I updated it.

@mysticatea mysticatea force-pushed the newline-per-chained-call/fix-for-long-message branch from a035cf0 to 675e3c7 Compare June 14, 2016 09:18
@eslintbot
Copy link

LGTM

1 similar comment
@nzakas
Copy link
Member

nzakas commented Jun 14, 2016

LGTM

@nzakas nzakas merged commit ed84c4c into master Jun 14, 2016
@mysticatea mysticatea deleted the newline-per-chained-call/fix-for-long-message branch June 16, 2016 11:48
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong output indentation in all messages if one message has a long multiline quote
5 participants