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.

`max-len` rule `ignoreTemplateLiterals` not ignore multi-line template literals

See original GitHub issue

Tell us about your environment

  • ESLint Version: 3.5.0
  • Node Version: 6.2.1
  • npm Version: 3.9.6

What parser (default, Babel-ESLint, etc.) are you using? Babel-eslint

Please show your full configuration: Isolated config and used only one rule.

        "max-len": [
            2,
            100, {
                "ignoreComments": true,
                "ignoreTrailingComments": true,
                "ignoreUrls": true,
                "ignoreStrings": true,
                "ignoreTemplateLiterals": true
            }
        ]

What did you do? Please include the actual source code causing the issue.

        this.x = `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaa`;

untitled

What did you expect to happen? I expected eslint to not throw a max-len error as I have ignoreTemplateLiterals turned on.

What actually happened? Please include the actual, raw output from ESLint. It threw an error for multi-line template literal.

/cc #5805 and #7049.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
RanadeepPolavarapucommented, Sep 13, 2016

@ljharb Thanks for the PR. I apologize for my late reply, I fell ill and was resting.

0reactions
ljharbcommented, Sep 13, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create Multi-Line String with Template Literals
It's super easy now to create multi-line strings with Template Literals in JavaScript. No more messy string line breaks. Yay, ES6!
Read more >
How to disable eslint rule max line length for paragraph in ...
Original Answer. AFAIK, there is no way to apply eslint rules to the template, and specifically to one line in a template. I...
Read more >
How To Use and Disable ESLint Max-Len (Line Length Rule)
Here are the configurations for ignoring comments, urls, strings, and template literals: “ignoreComments”: true; “ignoreUrls”: true; “ ...
Read more >
vue/max-len
This rule enforces a maximum line length to increase code readability and maintainability. This rule is the similar rule as core max-len ...
Read more >
max-len - ESLint - Pluggable JavaScript Linter
This rule enforces a maximum line length to increase code readability and ... "ignoreTemplateLiterals": true ignores lines that contain a template literal ......
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