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



Copy link

@ljharb 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?

Please show your full 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

Copy link

@cking cking commented Feb 14, 2018

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

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

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

Copy link

@rachx rachx commented Feb 17, 2018

Working on this

not-an-aardvark added 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
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.