Closed
Bug 921398
Opened 12 years ago
Closed 12 years ago
Relax the jshint rules about non-IIFE function literals to avoid clashes with the current style
Categories
(Firefox OS Graveyard :: Gaia, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gsvelto, Assigned: julienw)
References
Details
Attachments
(1 file)
|
945 bytes,
patch
|
rik
:
review+
|
Details | Diff | Splinter Review |
I've noticed a minor inconsistency between 'make lint' and 'make hint', if I write something like this:
var foo = (function bar() {}).bind(this);
hint will complain:
Wrapping non-IIFE function literals in parens is unnecessary
However our current style mandates that type of notation, changing to this:
var foo = function bar() {}.bind(this);
Causes jslint to complain:
Missing semicolon after function assigned to a variable
We should probably relax the jshint rule to accommodate our current style.
| Assignee | ||
Comment 1•12 years ago
|
||
filed https://github.com/jshint/jshint/issues/1288 to implement this option.
If this does not happen quickly, I'll remove "immed" from our .jshintrc until it is implemented.
| Assignee | ||
Comment 2•12 years ago
|
||
Note that "Missing semicolon after function assigned to a variable" is obviously a bug in gjslint, so I reported a bug there too: http://code.google.com/p/closure-linter/issues/detail?id=77
Hopefully at least one of these will get fixed soon !
| Assignee | ||
Comment 4•12 years ago
|
||
This removes the "immed" and "newcap" rules.
The "immed" rule will be added back once gjslint bug 77 will be fixed or when
jshint adds another separate rule to warn about non-IIFE wrapped in parens.
---
.jshintrc | 2 --
1 file changed, 2 deletions(-)
The "newcap" rule won't likely be put back, I think this was a mistake to have it in the first place.
I'll file a bug to put "immed" back when we'll be able to.
Assignee: nobody → felash
Attachment #812588 -
Flags: review?(anthony)
Comment 5•12 years ago
|
||
Comment on attachment 812588 [details] [diff] [review]
patch v1
Review of attachment 812588 [details] [diff] [review]:
-----------------------------------------------------------------
Good for me!
Attachment #812588 -
Flags: review?(anthony) → review+
| Assignee | ||
Comment 6•12 years ago
|
||
master: 701fbdb8ef6095e702ec418c686217c2ccf2aed3
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•