This rule was adopted in js-openstack-lib and I propose
we adopt it here as well. Whether we enforce a space or
no space, so long as it is consistent.
Change-Id: I5881b46ea16112729f2327484e56bcb138e0c386
This upgrades the eslint version to 3.0.0, removes zombie rules, and
ensures all new rules are disabled.
Change-Id: I8ea98aeda7a42ed0e140164c0e9d5e28d54794b8
OpenStack starts to support ES6, so the config has been updated
with instructions how to enable ES6 support.
"ecmaFeatures" were moved under "parserOptions" as it's required
by ESLint 2.x, all ES6-related flags were removed as they're
enabled using env.es6.
Change-Id: I5531534e2ab12ece0859816679aa19deb974957e
Arrow functions can omit parentheses when they have exactly one
parameter. In all other cases the parameter(s) must be wrapped
in parentheses. This rule enforces the consistent use of
parentheses in arrow functions.
http://eslint.org/docs/rules/arrow-parens
Change-Id: I40fca3fc2ecaf99ebb8ab9c40e7eaed8e78bdbd7
In the constructor of derived classes, if this/super are used
before super() calls, it raises a reference error.
http://eslint.org/docs/rules/no-this-before-super
Change-Id: I7cd9f2e802dbc1b3e9e91ca708366cb2b461e7fb
If there are declarations of the same name in class members,
the last declaration overwrites other declarations silently.
It can cause unexpected behaviors.
http://eslint.org/docs/rules/no-dupe-class-members
Change-Id: I0279dd2f818ea893f26e6230ac7a7648dbae5520
This rule checks usage of super() calls in class constructors.
Constructors of derived classes must call super().
Constructors of non derived classes must not call super().
If this is not observed, the javascript engine will raise
a runtime error.
http://eslint.org/docs/rules/constructor-super
Change-Id: Ic5fd761584770bdd2ae1a361b85ccb0a0167fce3
Require spaces around arrow in arrow functions, like they are
required around keywords if, else, in, do, etc.
http://eslint.org/docs/rules/arrow-spacing
Change-Id: I1b8f2b4ed3619f0e8565a79ddcd439fa7851b5ad
This enforces a space before and after keywords such as else, if,
switch, case, catch, try, and import.
http://eslint.org/docs/rules/keyword-spacing
Change-Id: I71a9b0d3527ba7612b9af75a3a0e14eaf8b3665e
This rule ensures that parameters used to declare a loop, are modified
within the loop. If they are not, it is likely that this is an error.
Example:
while(foo) {
doSomething(foo);
}
http://eslint.org/docs/rules/no-unmodified-loop-condition
Change-Id: I8f5a0b2b1f48a9f93e0946c76c497e86a199f01e
This upgrades the eslint version to 2.4.0, removes zombie rules,
and ensures that all new rules are disabled.
Change-Id: I6249663f8e226c5fa2739481b4c79625f94c7eb5
This adds the builtinGlobals flag to the no-redeclare rule, which
will throw errors when known globals - such as Object, Array,
window, document, etc - are used as variable names.
http://eslint.org/docs/rules/no-redeclare
Change-Id: I36b94c69cdb1fbe5f42b99aec06af01205002cf6
This disables the no-undefined rule. Most JavaScript projects in
OpenStack, at this point, have adopted eslint-config-angular, which
declares the 'definedundefined' rule requiring angular.isDefined()
or angular.isUndefined() to handle this case. That makes this
rule redundant, while also forcing non-production pieces of code
(such as unit tests) to become unnecessarily verbose.
https://github.com/Gillespie59/eslint-plugin-angular/blob/master/docs/definedundefined.mdhttp://eslint.org/docs/rules/no-undefined
Change-Id: I35ae5c8bc9e7ebb5c455d4acbe79636653448f65
This patch updates our brace-style rule configuration to permit
the use of single-line statements.
http://eslint.org/docs/rules/brace-style
Change-Id: I4e36c7535de79b29928b10c8090a2bc93f096760
This patch removes all the TODO comments from the eslint file.
Individual rules may be brought up for discussion at any time.
Change-Id: Ie89d2ae6ff04044a728a4a144151b602e556a3d9
Disallow Early Use (no-use-before-define)
In JavaScript, prior to ES6, variable and function declarations are
hoisted to the top of a scope, so it's possible to use identifiers
before their formal declarations in code. This can be confusing and
some believe it is best to always declare variables and functions
before using them.
In ES6, block-level bindings (let and const) introduce a "temporal
dead zone" where a ReferenceError will be thrown with any attempt to
access the variable before its declaration.
http://eslint.org/docs/rules/no-use-before-define
Change-Id: Ia905b77e0938ac3e0279712bc6e5ccdb18a102e7
This rule aims to enforce use of quotes in property names, only
in cases where they are strictly required (such as +/- in the name).
In all other cases, it will point out unecessary quotes.
http://eslint.org/docs/rules/quote-props
Change-Id: I7925329a3291ddb836ba9d971bdab529848596de
This rule aims to enforce spacing around a semicolon. This rule
prevents the use of spaces before a semicolon in expressions.
http://eslint.org/docs/rules/semi-spacing
Change-Id: I20a123350ef923c7168c80fe56a9c3e5db0ff4a4