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

Comments

@ljharb
Copy link
Contributor

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

@cking

This comment has been minimized.

Copy link

@cking 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

This comment has been minimized.

Copy link
Contributor

@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
This was referenced Mar 22, 2018
@eslint eslint 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.
You can’t perform that action at this time.