This patch upgrades eslint to version 1.2.4, incorporating new rule
changes on no-undefined, brace-style, quote-props, space-in-parens,
no-use-before-define, no-uneeded-ternary, and quote.
For now, rules that have been activated that cause checks to fail
have been switched to warning-only. Additionally, rules that
have been entirely disabled have been removed.
Change-Id: Ifba7a19da669288cb19cfc8055bdfa7b94f00292
eslint-plugin-angular in use by the project is
quite old and the new library has changed rules.
This patch updates the library and fixes the code
where rule names have changed.
Change-Id: I2e60a07b899325f17f38b96d40325602b4b58219
Closes-Bug: #1527417
This patch enables both the "no-new" and the "guard-for-in" rules
from upstream eslint-config-openstack. There were no detected
violations for the former, and the latter is only set to "warn"
in eslint-config-openstack.
http://eslint.org/docs/rules/no-newhttp://eslint.org/docs/rules/guard-for-in
Change-Id: Iac9eaba6ac3532795ce26e55d1304ba3c67ccff2
This enables the no-redeclare linting rule from eslint-config-openstack,
and corrects any errors found.
Change-Id: I2835b3ee9e20b735901315aa19919eb810cf5b75
This patch enables the "semi-spacing" rule from eslint-config-openstack,
and corrects any errors found.
http://eslint.org/docs/rules/semi-spacing
Change-Id: Ib6a2d856f24b53b24c65c4165cec92a7c1428832
This rule enables the "consistent-return" eslint rule from eslint-config-openstack,
and corrects any linting errors found.
http://eslint.org/docs/rules/consistent-return
Change-Id: Icf048ff81d3a1339a27a15c42822c293d335d259
This rule enables the "strict" eslint rule from eslint-config-openstack,
and corrects any linting errors found.
http://eslint.org/docs/rules/strict
Change-Id: Id7d5a6ec89e664dbf391fc0e2a2e8491057ab2be
This enables the eqeqeq linting rule from eslint-config-openstack,
and corrects any errors found.
http://eslint.org/docs/rules/eqeqeq
Change-Id: Iad857ae3f9963c7cb93c494d351c3908d87cd4a0
This enables the no-unused-vars rule from the upstream
eslint-config-openstack, and corrects all linting errors found.
Change-Id: I9f5fb29cd9b2429698819ecf556ced933378b081
This updates eslint-config-openstack to 1.2.3, and downgrades the
new rules so we can tackle them one at a time.
Change-Id: I3d7a20a6141a8748a60ceefcd33a1310456302dd
The newer version of eslint comes with somewhat stricter rules
about indentation and whitespace, so some files have been
adjusted to accomodate.
The newer version of eslint-config-openstack includes a relaxed
version requirement for eslint, as well as a switch/case
indentation update.
The newer version of the angular eslint rules includes a
deprecation rule for $cookieStorage, which has been set to
warning.
Change-Id: Id201a42e3ab484222f938a541507df2e96da2dcf
Partially-Implements: blueprint jscs-cleanup
Instead of explicitly copying all the linting rules between projects,
openstack now publishes a set of rules (much like hacking) that can
be included in projects that want to adhere by our standards. This
patch switches horizon to use this set of rules.
Note: The rules in eslint-config-openstack are a verbatim copy
of what's currently in use in Horizon. Future versions will likely start
activating rules flagged as "TODO", however you can avoid build
instability by avoiding the use of fuzzy version matching in
package.json (which this patch does).
Change-Id: Ib93e0def096999ece7f636d028e3b1ecd4a4facc
This reverts commit 9b210766508bfeab6cb7f1c4d0c1524a51209613.
The original commit was merged with a -1. The concern raised was
that it does not force engineers to clean up after themselves, which
is a best practice explicitly mentioned in the John Papa style guides
under Y070. While this rule is only specific to directives, it's
common sense, and the directive to "clean up your pointers" goes
back as far as C.
https://github.com/johnpapa/angular-styleguide#style-y070
Change-Id: Iea243c2b0b3c6154c5b02fd9e29172e1d5e3b434
This rule forces the controller to be named vm. This is
too strict and also is a very overload term in OpenStack.
So, making this a warning and looking for ctrl.
Change-Id: Ieadf2f0b2d91c3c6979a6a65652d37f0c2980178
Partially-Implements: blueprint jscs-cleanup
This patch adds the files for eslint overrides in the two different
segments of horizon's codebase: Legacy and Dashboard. There are
quite a few rules that had to be deactivated, which will reduce
the effectiveness of legacy linting.
Note: You cannot disable plugins in .eslintrc files, you can
only enable them. This is why there appear to be two redundant
.eslintrc files that enable the angular rules.
Change-Id: I5768cbc43e788a4320a6bb637c263dc3c3df3db9
Partially-Implements: blueprint jscs-cleanup
Based on the discussion at
https://github.com/Gillespie59/eslint-plugin-angular/issues/114
it seems that the rule is only applicable when the watches are
assigned on the $rootScope.
This rule is also not a part of the JP style guide.
Change-Id: Ic8c218c7d46229a4a2e7d9dcd951433aedd9d1ca
Partially-Implements: blueprint jscs-cleanup
This patch switches horizon from using JSCS to using ESlint. It
adds the john papa style guides as an eslint plugin, and deactivates
additional linting rules so current cleanup efforts can focus on the
issues remaining from JSCS. Once that cleanup effort is complete,
we can switch our linting job to voting and move forward from there.
YAML for .eslintrc was chosen because the JSON specification does
not allow comments, and having comments (including rule links) will
make it easier to discuss linting changes.
Deactivated eslint rules have each been annotated with a # TODO
statement, so we can address them in the future. Links in the
documentation have been updated to new contributor guidelines, which
will be updated after this patch lands.
Linting may be executed by first installing npm dependencies using
`npm install`, and then executing `npm run lint` at any time in the
future. No python venv is required.
For clarification: We are switching to ESLint because JSCS explicitly
focuses on code-style, not on language use errors. For that purpose,
JSCS explicitly defers to JSHint, which due to the 'do no evil' license is
not usable. Since ESLint provides both the codestyle functionality, and
the language use checks, of both JSCS and JSHint, it was deemed the
only viable tool,
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067030.html
Change-Id: Ib4c3f77f8cc3cdaa3c7558b7bc3a6d1299b6dcbe
Partially-Implements: blueprint jscs-cleanup