-
Notifications
You must be signed in to change notification settings - Fork 79
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
Use dedent indents consistently #312
Conversation
Do you mind explaining what is inconsistent about the use of dedent here? |
I think I understand now. Did the linter not undo the change you are referring to? |
If we are making this change, we need a way to enforce it via the linter or a config that works for several editors. |
@pjkaufman no, linter doesn't touch those changes. |
As most examples in Internet are using single quotes
# Conflicts: # package.json
@pjkaufman I configured the linter rule to have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I agree with removing blank lines or trailing space. Can we not use a setting on the rule to avoid the hacky solution?
Note that linter removes trailing spaces and blank lines. In case if they are essential use the following trick to preserve them | ||
|
||
```js | ||
const str = dedent` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels very hacky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the source code of the plugin
They do unconditional trimming.
I'll send them a PR to make it configurable
But honestly invisible trailing spaces are difficult to read anyway. With this "hack" we improve code readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a closer look later on today.
`, | ||
after: dedent` | ||
# H1 | ||
Line with trailing spaces and tabs. | ||
Line with trailing spaces and tabs. ${''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there should be a tab present here based on the text. But maybe that is incorrect.
Fixes #311