question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should no-irregular-whitespace skip template strings by default?

See original GitHub issue

What rule do you want to change?

no-irregular-whitespace

Does this change cause the rule to produce more or fewer warnings?

Fewer

How will the change be implemented? (New option, new default behavior, etc.)?

New default behavior

Please provide some example code that this change will affect:

/* eslint no-irregular-whitespace: error */

` <-- non-breaking space`;

What does the rule currently do for this code?

3:2 - Irregular whitespace not allowed. (no-irregular-whitespace)

What will the rule do after it’s changed?

No error (template strings will be skipped by default, just like other strings)


This is currently working as intended since we have skipTemplates: true option available. The question here is, should we change the default behavior with the 5.0 release so that template strings are skipped by default? Seems like this would be the more natural behavior given that skipStrings is also true by default. My guess is we added skipTemplates in a semver-minor release and just never went back to change the default behavior around templates.

The change would be to have skipTemplates default to true.

Inspired by #10159.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pfgithubcommented, Apr 1, 2018

Shouldn’t this use the feature request format instead of bug report format?

0reactions
eslint-deprecated[bot]commented, Dec 11, 2018

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-irregular-whitespace - ESLint - Pluggable JavaScript Linter
"skipTemplates": true allows any whitespace characters in template literals. skipStrings. Examples of incorrect code for this rule with the default { " ...
Read more >
vue/no-irregular-whitespace
Options # · skipStrings : if true , allows any whitespace characters in string literals. · skipComments : if true , allows any...
Read more >
Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >
ES6 Template Literals (Template Strings) - CanIUse
Template literals are string literals allowing embedded expressions using backtick characters (`). You can use multi-line strings and string interpolation ...
Read more >
TSLint core rules - Palantir Open Source
unified-signatures - Warns for any two overloads that could be unified into ... no-invalid-template-strings - Warns on use of ${ in non-template strings....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found