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

max-len ignoreStrings does not ignore jsx prop strings #9954

Closed
ljharb opened this issue Feb 6, 2018 · 2 comments · Fixed by Urigo/tortilla#62, #9985, mono-js/mono-doc#4, mono-js/mono-notifications#5 or mono-js/mono-mail#5
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly good first issue Good for people who haven't worked on ESLint before rule Relates to ESLint's core rules

Comments

@ljharb
Copy link
Sponsor Contributor

ljharb commented Feb 6, 2018

Tell us about your environment

  • ESLint Version: v4.16.0
  • Node Version: v8.9.1
  • npm Version: v5.6.0

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

Please show your full configuration:

Configuration
{
  "rules": {
    "max-len": [2, { "code": 5", "ignoreStrings": true }],
  },
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

<input placeholder="something long" />
eslint foo.js

What did you expect to happen?
No error.

What actually happened? Please include the actual, raw output from ESLint.
1:1 error Line 1 exceeds the maximum line length of 5 max-len

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Feb 6, 2018
@not-an-aardvark not-an-aardvark added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion good first issue Good for people who haven't worked on ESLint before and removed triage An ESLint team member will look at this issue soon labels Feb 9, 2018
@cking
Copy link

cking commented Feb 14, 2018

I have the same problem. Right now I'm using an ugly workaround:

        <div
          className={
            'flex-100 layout-row layout-wrap ' +
            'layout-align-space-between-center input_box_full'
          }
        >
          <input type="text" value={editor.city} name="city" onChange={this.handleChange} />
        </div>

As you can see, it's very ugly and distracting/confusing

@rachx
Copy link
Contributor

rachx commented Feb 17, 2018

Working on this

not-an-aardvark pushed a commit that referenced this issue Feb 23, 2018
* Fix: Make max-len ignoreStrings ignore JSXText (fixes #9954)

* Ignore JSXText token only if it is a child of a JSXAttribute node
This was referenced Mar 22, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 24, 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 Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.