From: Stas Vilchik Date: Wed, 6 Jan 2016 15:25:06 +0000 (+0100) Subject: improve code quality X-Git-Tag: 5.4-M4~29 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d0205df442e158fe30a5d5d8131dc4ccf9a9f872;p=sonarqube.git improve code quality --- diff --git a/server/sonar-web/.eslintrc b/server/sonar-web/.eslintrc index 77cfb1f6edd..439fd299c4c 100644 --- a/server/sonar-web/.eslintrc +++ b/server/sonar-web/.eslintrc @@ -55,7 +55,6 @@ "react/jsx-closing-bracket-location": [1, "after-props"], "react/jsx-handler-names": 0, - "react/jsx-key": 2, "react/jsx-max-props-per-line": [1, { "maximum": 3 }], "react/jsx-no-duplicate-props": 2, "react/jsx-no-undef": 2, @@ -73,7 +72,6 @@ "react/sort-comp": 1, "import/no-unresolved": 2, - "import/named": 2, "import/export": 2, "import/no-duplicates": 2, "import/imports-first": 2 diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.js b/server/sonar-web/src/main/js/apps/code/components/Search.js index e3bc76fd502..2a6c602926f 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.js +++ b/server/sonar-web/src/main/js/apps/code/components/Search.js @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import _ from 'underscore'; import React, { Component } from 'react'; import { connect } from 'react-redux'; diff --git a/server/sonar-web/src/main/js/apps/metrics/delete-view.js b/server/sonar-web/src/main/js/apps/metrics/delete-view.js index de66c3b36fb..aa28d8b87ad 100644 --- a/server/sonar-web/src/main/js/apps/metrics/delete-view.js +++ b/server/sonar-web/src/main/js/apps/metrics/delete-view.js @@ -23,7 +23,7 @@ import Template from './templates/metrics-delete.hbs'; export default ModalForm.extend({ template: Template, - onFormSubmit: function (e) { + onFormSubmit: function () { ModalForm.prototype.onFormSubmit.apply(this, arguments); this.sendRequest(); }, @@ -45,5 +45,3 @@ export default ModalForm.extend({ }); } }); - - diff --git a/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js b/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js index 5fd46cfdbb9..ed9efe1326c 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/eachChanged.js @@ -17,6 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import _ from 'underscore'; + module.exports = function (context, property, options) { var ret = ''; context.forEach(function (d, i) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifHasExtraActions.js b/server/sonar-web/src/main/js/helpers/handlebars/ifHasExtraActions.js index 00408023dd6..3775d91df9a 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/ifHasExtraActions.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/ifHasExtraActions.js @@ -17,6 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import _ from 'underscore'; + const DEFAULT_ACTIONS = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity', 'set_tags']; module.exports = function (actions, options) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/pluginActions.js b/server/sonar-web/src/main/js/helpers/handlebars/pluginActions.js index eec12b6d318..66ce7d40fe3 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/pluginActions.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/pluginActions.js @@ -17,6 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import _ from 'underscore'; + const DEFAULT_ACTIONS = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity', 'set_tags']; module.exports = function (actions, options) { diff --git a/server/sonar-web/src/main/js/helpers/handlebars/sources.js b/server/sonar-web/src/main/js/helpers/handlebars/sources.js index 09f8f0d57ec..2aac07987e3 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/sources.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/sources.js @@ -17,6 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import _ from 'underscore'; + module.exports = function (source, scm, options) { if (options == null) { options = scm;