Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ESLint's 80 char rule

38 views
Skip to first unread message

Patrick Brosset

unread,
May 13, 2016, 12:23:49 PM5/13/16
to dev-developer-tools
We added ESLint in an effort to help us prevent errors, enforce a
consistent coding style, and hopefully have readable code.
>From my experience so far (bgrins will agree since we were just discussing
this on a bug), this rule is frustrating more often than not, doesn't
prevent any kind of errors, and doesn't help write readable code.

In fact, we've had to add a number of regex to the configuration so it
ignores things like long urls, require and other loader statements.

The problem when removing ESLint errors from an entire file and even an
entire directory is that you end up having to break lines that are just a
little longer than 80 characters for no other reasons than to please
ESLint. The is no really good option available to you when it comes to
choosing how to wrap a long line, and we don't have a consistent style for
doing it, nor another ESLint rule that enforces it.

I've made a poll some time ago on twitter:
https://twitter.com/patrickbrosset/status/703688265849819136
>From what I learned, most people don't really care.

So, please let me know if you think we should just disable the rule
altogether.
Let's vote in this thread:

- Let's disable the rule and try and stick to 80 but allow to go over if
need be: +1
- Let's keep the rule and continue wrapping lines:

Patrick

Tom Tromey

unread,
May 13, 2016, 12:32:01 PM5/13/16
to Patrick Brosset, dev-developer-tools
Patrick> - Let's keep the rule and continue wrapping lines:

+1

I prefer a line length limit because I find long lines more difficult to
read. If we have too many long lines then I think that's an indication
that something needs to be split up.

Tom

James Long

unread,
May 13, 2016, 12:38:08 PM5/13/16
to Tom Tromey, dev-developer-tools, Patrick Brosset
Would making the rules 90 or something remove the need to fix a lot of the
current files? I like the rule, but it's not something I feel strongly
about.
> _______________________________________________
> dev-developer-tools mailing list
> dev-devel...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-developer-tools
>

Patrick Brosset

unread,
May 13, 2016, 12:42:45 PM5/13/16
to James Long, Tom Tromey, dev-developer-tools
Thanks James, indeed, that's a 3rd option

- Let's disable the rule and try and stick to 80 but allow to go over if
need be: +1
- Let's keep the rule and continue wrapping lines: +1
- Let's configure the rule to 90, or 100, to avoid having to fix a lot of
files for lines that are just a bit too long:

Trevor Orsztynowicz

unread,
May 13, 2016, 12:43:27 PM5/13/16
to James Long, Tom Tromey, dev-developer-tools, Patrick Brosset
Im not sure why Im tagged in this. But I agree with Tom. Optionally we
could just keep the rule and set it on warning instead of error.

On Friday, 13 May 2016, James Long <jl...@mozilla.com> wrote:

> Would making the rules 90 or something remove the need to fix a lot of the
> current files? I like the rule, but it's not something I feel strongly
> about.
>
> On Fri, May 13, 2016 at 12:31 PM, Tom Tromey <ttr...@mozilla.com
> <javascript:;>> wrote:
>
> > Patrick> - Let's keep the rule and continue wrapping lines:
> >
> > +1
> >
> > I prefer a line length limit because I find long lines more difficult to
> > read. If we have too many long lines then I think that's an indication
> > that something needs to be split up.
> >
> > Tom
> > _______________________________________________
> > dev-developer-tools mailing list
> > dev-devel...@lists.mozilla.org <javascript:;>
> > https://lists.mozilla.org/listinfo/dev-developer-tools
> >
> _______________________________________________
> dev-developer-tools mailing list
> dev-devel...@lists.mozilla.org <javascript:;>
> https://lists.mozilla.org/listinfo/dev-developer-tools
>

Tom Tromey

unread,
May 13, 2016, 12:59:13 PM5/13/16
to Patrick Brosset, Tom Tromey, James Long, dev-developer-tools
Patrick> - Let's disable the rule and try and stick to 80 but allow to go over if need be: +1
Patrick> - Let's keep the rule and continue wrapping lines: +1
Patrick> - Let's configure the rule to 90, or 100, to avoid having to fix a lot of files for lines that are
Patrick> just a bit too long:

Also I wonder if it's possible to relax the rule specifically for string
constants; since IIUC this is where this came from.

Tom

Victor Porof

unread,
May 13, 2016, 1:56:22 PM5/13/16
to Tom Tromey, James Long, dev-developer-tools, Patrick Brosset
FWIW for Tofino we’re limiting to 100 chars, and it feels okay.
> _______________________________________________
> dev-developer-tools mailing list
> dev-devel...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-developer-tools

J. Ryan Stinnett

unread,
May 13, 2016, 2:43:25 PM5/13/16
to Victor Porof, Tom Tromey, James Long, dev-developer-tools, Patrick Brosset
I agree with Tom as well, I find it much easier to read when lines are
wrapped consistently.

So, I think we should keep the rule enabled. I am okay with 80 myself,
but I would also be okay with 90 or 100. I would just like there to be
some reasonable limit that we try to follow everywhere.

- Ryan

Jim Blandy

unread,
May 13, 2016, 4:28:04 PM5/13/16
to Patrick Brosset, Tom Tromey, James Long, dev-developer-tools
On Fri, May 13, 2016 at 9:42 AM, Patrick Brosset <pbro...@mozilla.com>
wrote:

> - Let's configure the rule to 90, or 100, to avoid having to fix a lot of
> files for lines that are just a bit too long:
>

+1

Brian Grinstead

unread,
May 25, 2016, 4:43:16 PM5/25/16
to Jim Blandy, Tom Tromey, James Long, dev-developer-tools, Patrick Brosset
Seems like there's been a consensus around this, so I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1275706 to tune it to 90 characters.

Brian
0 new messages