Граф коммитов

12 Коммитов

Автор SHA1 Сообщение Дата
Shruti Jasoria 4c8d3f69e6 Bug 1289138 - Enable disabled eslint rules and fix corresponding js problems (#1736)
Enable the following rules and fixed corresponding problems:
* comma-dangle
* no-console
* no-redeclare
* no-unused-vars
* no-undef
* no-unused-vars
2016-08-04 16:18:00 -07:00
William Lachance 1aeb47055d Bug 1289127 - Enable eslint "no-multi-spaces" rule (#1721) 2016-07-25 10:41:23 -04:00
Cameron Dawson d4217d5382 Bug 1260901 - enable eqeqeq eslint directive for JavaScript
Requires “===“  and “!==“ instead of just “==“ and “!=“ for equality.
2016-03-31 14:59:44 -07:00
Ed Morley 0a72e45a5b Bug 1227682 - Enable the ESLint no-extra-semi rule & fix infringements
Disallows unnecessary semicolons
http://eslint.org/docs/rules/no-extra-semi
2015-11-24 20:15:28 +00:00
Ed Morley 4adb6d5627 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
2015-11-07 18:13:21 +00:00
Ed Morley 42c56716d1 Bug 1220479 - Mark .eslintrc as the root eslint config
Which saves eslint from having to traverse higher up the directory
structure, looking for parent `.eslintrc`s:
http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
2015-11-06 18:01:25 +00:00
Ed Morley 830d47924b Bug 1220479 - Update grunt-eslint to 17.3.1 and eslint to 1.8.0
The move to eslint 1.x changes the way rules are managed, see:
http://eslint.org/docs/user-guide/migrating-to-1.0.0

There are slightly fewer rules enabled with "eslint:recommended" than
were by default before, but we'll enable more non-default rules later.
2015-11-06 18:01:25 +00:00
Cameron Dawson 07d3513513 turn off no-catch-shadow eslint rule
We do not support IE 8 and earlier, so we turn this off.
See http://eslint.org/docs/rules/no-catch-shadow for more info.
2015-08-05 10:02:17 -07:00
William Lachance 1900b665e4 Bug 1185108 - Enforce 4 space indentation via an eslint rule 2015-07-17 17:27:51 -04:00
Ed Morley d6dbaefb7e Bug 1184775 - ESLint: Enable the 'semi' rule
semi: "require or disallow use of semicolons instead of ASI"
2015-07-17 18:34:38 +01:00
Ed Morley 97f6dd854f Bug 1184614 - ESLint: Switch from a whitelist to a blacklist approach
Previously we disabled all default rules, and only turned on those that
were explicitly listed in .eslintrc. Now we leave the default rules
alone, apart from those that we are currently failing.
2015-07-16 18:31:55 +01:00
William Lachance 658927bdf7 Bug 1183367 - Add a grunt target to run eslint on JS frontend 2015-07-14 13:40:18 -04:00