Commit Graph

86 Commits

Author SHA1 Message Date
msmol 99c529ad47 Disallow space between a function & opening paren
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
2016-10-27 13:44:24 +00:00
Elizabeth Elwell 4f5cae9232 Upgraded eslint to 3.0.0
This upgrades the eslint version to 3.0.0, removes zombie rules, and
ensures all new rules are disabled.

Change-Id: I8ea98aeda7a42ed0e140164c0e9d5e28d54794b8
2016-08-05 14:55:18 +01:00
Jenkins b2b34d88df Merge "Enable no-unmodified-loop-condition" 2016-07-21 16:21:30 +00:00
Jenkins c5c8bcb6df Merge "Enable keyword-spacing" 2016-06-10 14:05:22 +00:00
Jenkins 036c63d97d Merge "Enable arrow-parens" 2016-06-02 16:08:51 +00:00
Jenkins 558bc17571 Merge "Enable no-this-before-super" 2016-06-02 16:08:35 +00:00
Jenkins 8ca096cd90 Merge "Enable constructor-super" 2016-06-02 16:08:29 +00:00
Jenkins 17ad4856db Merge "Enable arrow-spacing" 2016-06-02 16:08:19 +00:00
Jenkins e762ac5207 Merge "Enable no-const-assign" 2016-06-02 15:13:28 +00:00
Jenkins 486d09aaf2 Merge "Enable no-class-assign" 2016-06-02 15:11:16 +00:00
Jenkins 8a3c3c037c Merge "Enable no-dupe-class-members" 2016-06-02 15:11:09 +00:00
Vitaly Kramskikh a3151bef1d Update descriptions of ES6-related options
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
2016-05-12 16:01:19 +00:00
Vitaly Kramskikh 9df86496c2 Enable arrow-parens
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
2016-05-12 18:26:05 +03:00
Vitaly Kramskikh 425d919b8a Enable no-this-before-super
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
2016-05-12 18:23:18 +03:00
Vitaly Kramskikh 596fbf4c6f Enable no-dupe-class-members
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
2016-05-12 18:10:57 +03:00
Vitaly Kramskikh cd40c50186 Enable no-const-assign
Attempts to modify a constant cause runtime errors

http://eslint.org/docs/rules/no-const-assign

Change-Id: I89c0426c601f834fa91ea8315ca5b8ba0600c181
2016-05-12 17:30:28 +03:00
Vitaly Kramskikh ff4405854c Enable no-class-assign
Usually it makes no sense to reassign class variables

http://eslint.org/docs/rules/no-class-assign

Change-Id: Id556cd4e427c8772aed0e97aa68fa742f8692b7d
2016-05-12 16:54:48 +03:00
Vitaly Kramskikh 5fa93cef9e Enable constructor-super
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
2016-05-11 20:47:02 +03:00
Vitaly Kramskikh 80c4ef29b0 Enable arrow-spacing
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
2016-05-11 20:35:10 +03:00
Michael Krotscheck 9ece5ec21d
Enable keyword-spacing
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
2016-05-04 12:41:13 -07:00
Michael Krotscheck 8442d0103b
Enable no-unmodified-loop-condition
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
2016-05-04 12:40:36 -07:00
Michael Krotscheck 5b3112fe99
Enable no-self-assign
This will throw an error on all variants of a = a;

http://eslint.org/docs/rules/no-self-assign

Change-Id: Iaddc5e106da307e9ead62d2a37876805aaa86746
2016-05-04 12:40:10 -07:00
Jenkins 4ac471faf4 Merge "Upgraded eslint to 2.4.0" 2016-03-16 18:28:10 +00:00
Jenkins ac74a24757 Merge "Enable "no-empty-pattern"" 2016-03-16 18:27:07 +00:00
Jenkins 0c708db1c8 Merge "Enable "no-case-declarations"" 2016-03-16 18:27:02 +00:00
Jenkins f8d711cd54 Merge "Upgraded eslint version" 2016-03-16 18:24:08 +00:00
Michael Krotscheck 5bc48bf279 Upgraded eslint to 2.4.0
This upgrades the eslint version to 2.4.0, removes zombie rules,
and ensures that all new rules are disabled.

Change-Id: I6249663f8e226c5fa2739481b4c79625f94c7eb5
2016-03-16 08:08:50 -07:00
Jenkins 63fccc1d08 Merge "Enable builtinGlobals for no-redeclare" 2016-03-02 09:33:23 +00:00
Jenkins 03e6043554 Merge "Disable no-undefined" 2016-01-29 17:00:17 +00:00
Michael Krotscheck d5acf57357 Enable builtinGlobals for no-redeclare
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
2016-01-11 07:44:25 -08:00
Michael Krotscheck a7c3268b79 Disable no-undefined
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.md
http://eslint.org/docs/rules/no-undefined

Change-Id: I35ae5c8bc9e7ebb5c455d4acbe79636653448f65
2016-01-04 10:19:50 -08:00
Michael Krotscheck c59829bf76 Permit single-line statements in brace-style
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
2015-11-25 11:09:30 -08:00
Michael Krotscheck 12f04b33f3 Enable "no-empty-pattern"
This rule disallows empty destructuring patterns.
http://eslint.org/docs/rules/no-empty-pattern

Change-Id: Ida6dca6c9c9668ead5c91982f6e8479a0d54181e
2015-11-23 08:17:24 -08:00
Michael Krotscheck ab48e08d61 Enable "no-case-declarations"
This rule disallows lexical declarations in case statements.
http://eslint.org/docs/rules/no-case-declarations

Change-Id: Iaf209d0f5cd57da34f1ce5285badeb4ced6f9754
2015-11-23 08:14:15 -08:00
Michael Krotscheck c1f64a8684 Upgraded eslint version
This upgrades the eslint version to 1.10.1, and ensures that all
new rules are disabled.

Change-Id: I06c2da16e9647e368b6c69d7080b5af61d6643af
2015-11-23 08:11:20 -08:00
Michael Krotscheck a04b328444 Removed TODO comments
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
2015-11-17 09:55:05 -08:00
Jenkins e025a4105f Merge "Enable quote-props "as-needed"" 2015-11-17 17:39:24 +00:00
Michael Krotscheck 044ef8afd0 Upgraded eslint version
This upgrades the eslint version to 1.5.1, and ensures that all
new rules are disabled.

Change-Id: I9e5f0698af95b16f975b89f0a86c60a977acbf37
2015-11-13 06:54:36 -08:00
Jenkins a836806961 Merge "Enable space-in-parens" 2015-11-12 22:18:19 +00:00
Jenkins 5a77103c4f Merge "Enable no-unneeded-ternary" 2015-10-16 21:30:14 +00:00
Jenkins 03dec30959 Merge "Disable quote" 2015-10-08 23:55:21 +00:00
Diana Whitten 91b9608ab1 Enable no-use-before-define
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
2015-10-08 14:50:09 +00:00
Jenkins e31eb6dcd9 Merge "Enable brace-style" 2015-10-07 17:02:42 +00:00
Jenkins 51b6d82a02 Merge "Enable no-undefined" 2015-10-01 18:53:07 +00:00
Jenkins 68e0003259 Merge "Enable semi-spacing" 2015-09-29 14:53:22 +00:00
Jenkins fa9fa47ce1 Merge "Enable no-extra-parens" 2015-09-28 17:45:19 +00:00
Jenkins 8d60815613 Merge "Enabled eqeqeq" 2015-09-24 21:24:15 +00:00
Jenkins 5e7ed3e489 Merge "Disable yoda" 2015-09-24 21:23:36 +00:00
Michael Krotscheck 496aa03556 Enable quote-props "as-needed"
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
2015-09-22 10:31:59 -07:00
Michael Krotscheck 7bfdfc56d7 Enable semi-spacing
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
2015-09-22 10:29:18 -07:00