Closed
Bug 1222718
Opened 9 years ago
Closed 9 years ago
Enable already-passing non-default eslint rules
Categories
(Tree Management :: Treeherder, defect, P3)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: emorley)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
We already use eslint, however it's mostly only running the default "recommended" ruleset.
We want to turn on more rules - and a quick win is to enable all of the rules that already pass with no changes on our side, for the rules that we think make sense.
Later on we can go through the non-passing rules and see which we wish to enable.
| Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8684587 -
Flags: review?(wlachance)
Comment 2•9 years ago
|
||
Comment on attachment 8684587 [details] [review]
Enable non-default eslint rules that already pass
Makes sense! As you say, we can always adjust later.
Attachment #8684587 -
Flags: review?(wlachance) → review+
Comment 3•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/4adb6d5627027faf8deb7e159f4bcc82181e16a5
Bug 1222718 - Enable non-default eslint rules that already pass
The following rules are already passing, without any code changes on our
side. I've reduced the list down to just the rules that I think we want
to enforce. The fact that we currently pass them means that these rules
generally aren't too contentious, however I'm happy to adjust as needed,
either now or when we first hit failures in them.
accessor-pairs:
Enforces getter/setter pairs in objects
http://eslint.org/docs/rules/accessor-pairs
comma-style:
enforce one true comma style
http://eslint.org/docs/rules/comma-style
eol-last:
enforce newline at the end of file, with no multiple empty lines
http://eslint.org/docs/rules/eol-last
guard-for-in:
make sure for-in loops have an if statement
http://eslint.org/docs/rules/guard-for-in
linebreak-style:
disallow mixed 'LF' and 'CRLF' as linebreaks
http://eslint.org/docs/rules/linebreak-style
new-cap:
require a capital letter for constructors
http://eslint.org/docs/rules/new-cap
new-parens:
disallow the omission of parentheses when invoking a constructor with no arguments
http://eslint.org/docs/rules/new-parens
no-array-constructor:
disallow use of the Array constructor
http://eslint.org/docs/rules/no-array-constructor
no-bitwise:
disallow use of bitwise operators
http://eslint.org/docs/rules/no-bitwise
no-caller:
disallow use of arguments.caller or arguments.callee
http://eslint.org/docs/rules/no-caller
no-div-regex:
disallow division operators explicitly at beginning of regular expression
http://eslint.org/docs/rules/no-div-regex
no-empty-label:
disallow use of labels for anything other than loops and switches
http://eslint.org/docs/rules/no-empty-label
no-empty-pattern:
disallow use of empty destructuring patterns
http://eslint.org/docs/rules/no-empty-pattern
no-eval:
disallow use of eval()
http://eslint.org/docs/rules/no-eval
no-extend-native:
disallow adding to native types
http://eslint.org/docs/rules/no-extend-native
no-extra-bind:
disallow unnecessary function binding
http://eslint.org/docs/rules/no-extra-bind
no-floating-decimal:
disallow the use of leading or trailing decimal points in numeric literals
http://eslint.org/docs/rules/no-floating-decimal
no-implied-eval:
disallow use of eval()-like methods
http://eslint.org/docs/rules/no-implied-eval
no-iterator:
disallow usage of __iterator__ property
http://eslint.org/docs/rules/no-iterator
no-label-var:
disallow labels that share a name with a variable
http://eslint.org/docs/rules/no-label-var
no-labels:
disallow use of labeled statements
http://eslint.org/docs/rules/no-labels
no-lone-blocks:
disallow unnecessary nested blocks
http://eslint.org/docs/rules/no-lone-blocks
no-multi-str:
disallow use of multiline strings
http://eslint.org/docs/rules/no-multi-str
no-native-reassign:
disallow reassignments of native objects
http://eslint.org/docs/rules/no-native-reassign
no-new:
disallow use of the new operator when not part of an assignment or comparison
http://eslint.org/docs/rules/no-new
no-new-func:
disallow use of new operator for Function object
http://eslint.org/docs/rules/no-new-func
no-new-object:
disallow the use of the Object constructor
http://eslint.org/docs/rules/no-new-object
no-new-wrappers:
disallows creating new instances of String,Number, and Boolean
http://eslint.org/docs/rules/no-new-wrappers
no-octal-escape:
disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
http://eslint.org/docs/rules/no-octal-escape
no-proto:
disallow usage of __proto__ property
http://eslint.org/docs/rules/no-proto
no-return-assign:
disallow use of assignment in return statement
http://eslint.org/docs/rules/no-return-assign
no-script-url:
disallow use of javascript: urls.
http://eslint.org/docs/rules/no-script-url
no-self-compare:
disallow comparisons where both sides are exactly the same
http://eslint.org/docs/rules/no-self-compare
no-sequences:
disallow use of the comma operator
http://eslint.org/docs/rules/no-sequences
no-shadow-restricted-names:
disallow shadowing of names such as arguments
http://eslint.org/docs/rules/no-shadow-restricted-names
no-spaced-func:
disallow space between function identifier and application
http://eslint.org/docs/rules/no-spaced-func
no-trailing-spaces:
disallow trailing whitespace at the end of lines
http://eslint.org/docs/rules/no-trailing-spaces
no-undef-init:
disallow use of undefined when initializing variables
http://eslint.org/docs/rules/no-undef-init
no-unexpected-multiline:
Avoid code that looks like two expressions but is actually one
http://eslint.org/docs/rules/no-unexpected-multiline
no-unused-expressions:
disallow usage of expressions in statement position
http://eslint.org/docs/rules/no-unused-expressions
no-useless-call:
disallow unnecessary .call() and .apply()
http://eslint.org/docs/rules/no-useless-call
no-void:
disallow use of the void operator
http://eslint.org/docs/rules/no-void
no-with:
disallow use of the with statement
http://eslint.org/docs/rules/no-with
semi:
require or disallow use of semicolons instead of ASI
http://eslint.org/docs/rules/semi
space-return-throw-case:
require a space after return, throw, and case
http://eslint.org/docs/rules/space-return-throw-case
strict:
controls location of Use Strict Directives
http://eslint.org/docs/rules/strict
yoda:
require or disallow Yoda conditions
http://eslint.org/docs/rules/yoda
| Assignee | ||
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•3 years ago
|
Component: Treeherder: Docs & Development → TreeHerder
You need to log in
before you can comment on or make changes to this bug.
Description
•