Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Consider taking no-multiline-string out of the recommended preset #454

Closed
astorije opened this issue Jul 5, 2018 · 3 comments
Closed

Consider taking no-multiline-string out of the recommended preset #454

astorije opened this issue Jul 5, 2018 · 3 comments
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: Awaiting More Feedback Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Task Miscellaneous work.
Milestone

Comments

@astorije
Copy link
Contributor

astorije commented Jul 5, 2018

We use and love the recommended preset at @CloudHealth, but we find no-multiline-string to be an unnecessarily restrictive rule to recommend by default.

As far as I can tell, there is nothing inherently bad about multiline template strings, and they're not one of those things accepted to be dangerous or recommended not to use by the community such as eval or ==.

In our case, and this is probably the biggest reason why we disabled it (but not the only one), GraphQL queries are most of the time represented using multiline template strings:

query UserQuery($email: string) {
  user(id: $email) {
    name
    avatar
  }
}

This is true with both Apollo Client and Relay Client.

We also find this useful when building CLIs for example, but it's less easily found across our codebase.

So there is it, I suggest removing it from the recommended preset, from the point of view of a consumer :)
Thanks and keep up the good work!

@JoshuaKGoldberg
Copy link

This sounds reasonable (I too always disable it 😃). Let's wait a bit and see if there are any voices against it, and if in a few weeks time nobody has piped up, it sounds like a good Good First Issue 🙌.

@JoshuaKGoldberg JoshuaKGoldberg added Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Task Miscellaneous work. labels Jul 7, 2018
@astorije
Copy link
Contributor Author

astorije commented Jul 8, 2018

Let's wait a bit and see if there are any voices against it

That's totally reasonable. I opened #456 in preparation for it, so that when/if no one objects, it can be merged, or close if someone objects.
Thanks for the feedback @JoshuaKGoldberg!

@JoshuaKGoldberg
Copy link

Fixed in #456. Thanks astorije! 👌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: Awaiting More Feedback Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Task Miscellaneous work.
Projects
None yet
Development

No branches or pull requests

2 participants