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

Add max-len rule ? #22

Closed
Waxo opened this issue Apr 27, 2016 · 5 comments
Closed

Add max-len rule ? #22

Waxo opened this issue Apr 27, 2016 · 5 comments
Labels

Comments

@Waxo
Copy link

Waxo commented Apr 27, 2016

http://eslint.org/docs/rules/max-len

I know that this rule is controversial, but in most of case developpers have their IDE configured to have 2 files side by side with the max length set to 80.

Maybe 120 and configurable in the package.json with an option max-len: 80 to be less painful for common people.

@sindresorhus
Copy link
Member

Why? Editors today can soft-wrap, so just set the line-length you prefer in your editor.

@Waxo
Copy link
Author

Waxo commented Apr 27, 2016

Yes but not anyone is using modern editors, by the way it's an usal convention I always met. Maybe just add the option for configuration in package.json.

@sindresorhus
Copy link
Member

I'm pretty sure every code editor in existence today can soft-wrap. I'm aware it's a common convention to hard-wrap, but I don't do stuff just because it's a convention. You can already use this rule yourself in your ESLint config or the rules option if you use XO ;)

I'll keep this open for discussion.

@Waxo
Copy link
Author

Waxo commented Apr 27, 2016

Ok it works by using :

"xo": {
    "esnext": true,
    "rules": {
      "max-len": ["error", 80, 2] // ["error", max-len, tab-witdh] (i use 2, default is 4)
    }

Thanks for your help ! 👍

@Waxo Waxo closed this as completed Apr 27, 2016
@fregante
Copy link
Member

fregante commented May 1, 2019

Editors can soft wrap, but is a line like this considered "linted"?

const element = <div className="AvatarStack AvatarStack--three-plus AvatarStack--right clearfix d-inline-block" style={{marginTop: 1}}><div className="AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1" aria-label={usernames}>{avatars}</div></div>;

Perhaps there should still be a sensible limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants