]> source.dussan.org Git - sonarqube.git/commitdiff
improve code quality
authorStas Vilchik <vilchiks@gmail.com>
Tue, 6 Sep 2016 15:44:55 +0000 (17:44 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 6 Sep 2016 15:44:55 +0000 (17:44 +0200)
server/sonar-web/.eslintrc
server/sonar-web/package.json
server/sonar-web/src/main/js/apps/background-tasks/components/TaskId.js
server/sonar-web/src/main/js/apps/overview/main/enhance.js
server/sonar-web/src/main/js/apps/permission-templates/components/Header.js
server/sonar-web/src/main/js/apps/project-admin/key/views/UpdateKeyConfirmation.js
server/sonar-web/src/main/js/apps/project-admin/store/actions.js
server/sonar-web/src/main/js/apps/project-admin/store/links.js
server/sonar-web/src/main/js/apps/quality-profiles/changelog/ParameterChange.js
server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js

index 06d77b7ab505dd19137fb3e23bb30e3c7ac7df8a..d0a6a17a2eacba18404312771059edb32b764d1d 100644 (file)
@@ -1,6 +1,7 @@
 {
   "extends": [
     "eslint:recommended",
+    "plugin:react/recommended",
     "plugin:import/errors",
     "plugin:import/warnings"
   ],
     "semi": [2, "always"],
     "keyword-spacing": 2,
 
-    "react/jsx-closing-bracket-location": [2, "after-props"],
-    "react/jsx-handler-names": 0,
-    "react/jsx-max-props-per-line": [2, { "maximum": 3 }],
-    "react/jsx-no-duplicate-props": 2,
-    "react/jsx-no-undef": 2,
-    "react/jsx-pascal-case": 2,
-    "react/jsx-uses-react": 2,
-    "react/jsx-uses-vars": 2,
-    "react/no-did-mount-set-state": [2, "allow-in-func"],
-    "react/no-did-update-set-state": [2, "allow-in-func"],
-    "react/no-direct-mutation-state": 2,
-    "react/no-multi-comp": 0,
-    "react/no-unknown-property": 2,
-    "react/prop-types": 0,
-    "react/react-in-jsx-scope": 2,
-    "react/self-closing-comp": 2,
-    "react/sort-comp": 2
+    "react/display-name": 0,
+    "react/no-find-dom-node": 0,
+    "react/prop-types": 0
   },
 
   "settings": {
index 25aa6b38c18dfea4f8c8719ca9f1675df7297e91..efc4aaea629384f888e4a82f5bcc745fdae64bc6 100644 (file)
@@ -29,9 +29,9 @@
     "css-loader": "0.23.1",
     "d3": "3.5.6",
     "enzyme": "2.2.0",
-    "eslint": "^2.13.1",
-    "eslint-plugin-import": "^1.9.2",
-    "eslint-plugin-react": "^5.2.2",
+    "eslint": "^3.4.0",
+    "eslint-plugin-import": "^1.14.0",
+    "eslint-plugin-react": "^6.2.0",
     "expose-loader": "0.7.1",
     "express": "4.13.4",
     "express-http-proxy": "0.6.0",
index 1cf24890c16f8e3a3fa74e9587b5e3bb26ea6a31..719f7517d02fb7a3c1947faf567c7cee90c17d01 100644 (file)
@@ -19,8 +19,6 @@
  */
 import React from 'react';
 
-import { translate } from '../../../helpers/l10n';
-
 const TaskId = ({ task }) => {
   return (
       <td className="thin nowrap">
index 26e57e1afa777b3dcdffd004b979ddd9f1968f37..00a6df79e93be8517ebcd149cfc1d44f8b32229f 100644 (file)
@@ -25,16 +25,16 @@ import { DonutChart } from '../../../components/charts/donut-chart';
 import Rating from './../../../components/ui/Rating';
 import Timeline from '../components/Timeline';
 import {
-    formatMeasure,
-    formatMeasureVariation,
-    isDiffMetric,
-    getPeriodValue,
-    getShortType
+  formatMeasure,
+  formatMeasureVariation,
+  isDiffMetric,
+  getPeriodValue,
+  getShortType,
+  getRatingTooltip
 } from '../../../helpers/measures';
-import { translateWithParameters, translate } from '../../../helpers/l10n';
+import { translateWithParameters } from '../../../helpers/l10n';
 import { getPeriodDate } from '../../../helpers/periods';
 import { getComponentIssuesUrl } from '../../../helpers/urls';
-import { getRatingTooltip } from '../../../helpers/measures';
 
 export default function enhance (ComposedComponent) {
   return class extends React.Component {
index 97590dc0ce313870efc96c952423f8b268233d40..578e42822c8014acce94ab0cda6037754b8e17e1 100644 (file)
@@ -45,7 +45,7 @@ export default class Header extends React.Component {
             this.context.router.push({
               pathname: '/',
               query: { id: r.permissionTemplate.id }
-            })
+            });
           });
         })
         .render();
index 4ece410093bbfc8f2aa4c99a081aa2962db221cb..5a8d14417f4a81441dd1f0efcd0eee3f5abb555f 100644 (file)
@@ -19,7 +19,6 @@
  */
 import ModalForm from '../../../../components/common/modal-form';
 import Template from './UpdateKeyConfirmation.hbs';
-import { parseError } from '../../../code/utils';
 
 export default ModalForm.extend({
   template: Template,
index ca20001b763134f35acad765eccf0442a16c7033..18eb9917862cf9b9b042cfbe0bbce6feee56e440 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import {
-    getQualityProfiles,
-    associateProject,
-    dissociateProject
-} from '../../../api/quality-profiles';
+import { getQualityProfiles, associateProject, dissociateProject } from '../../../api/quality-profiles';
 import { getProfileByKey } from './rootReducer';
 import {
-    fetchQualityGates,
-    getGateForProject,
-    associateGateWithProject,
-    dissociateGateWithProject
+  fetchQualityGates,
+  getGateForProject,
+  associateGateWithProject,
+  dissociateGateWithProject
 } from '../../../api/quality-gates';
 import { getProjectLinks, createLink } from '../../../api/projectLinks';
-import { getTree } from '../../../api/components';
-import { changeKey as changeKeyApi } from '../../../api/components';
+import { getTree, changeKey as changeKeyApi } from '../../../api/components';
 import { addGlobalSuccessMessage } from '../../../components/store/globalMessages';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 
index 9a79d3d790542a426616e520ef49b3f14ee68b45..b1e4dea7f658f998ad5567adacb920212f5908cb 100644 (file)
@@ -19,8 +19,7 @@
  */
 import keyBy from 'lodash/keyBy';
 import omit from 'lodash/omit';
-import { RECEIVE_PROJECT_LINKS, DELETE_PROJECT_LINK } from './actions';
-import { ADD_PROJECT_LINK } from './actions';
+import { RECEIVE_PROJECT_LINKS, DELETE_PROJECT_LINK, ADD_PROJECT_LINK } from './actions';
 
 const links = (state = {}, action = {}) => {
   if (action.type === RECEIVE_PROJECT_LINKS) {
index d3ea5ecedb044332a61e4c5f7bd42ec2bb92f4f0..6a79f5c27234fc6524718c5c96df4959e5d50032 100644 (file)
@@ -31,7 +31,7 @@ export default class ParameterChange extends React.Component {
 
     if (value == null) {
       return (
-          <div style={{ whiteSpace: 'normal '}}>
+          <div style={{ whiteSpace: 'normal}}>
             {translateWithParameters(
                 'quality_profiles.changelog.parameter_reset_to_default_value',
                 name
@@ -41,7 +41,7 @@ export default class ParameterChange extends React.Component {
     }
 
     return (
-        <div style={{ whiteSpace: 'normal '}}>
+        <div style={{ whiteSpace: 'normal}}>
           {translateWithParameters(
               'quality_profiles.parameter_set_to',
               name,
index 24a8d5f0a25d214bc1f993c647455617268f46f0..505256358348b1cecbff55300558a5b36c8bc2ca 100644 (file)
@@ -18,7 +18,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import qs from 'querystring';
-import _ from 'underscore';
 import classNames from 'classnames';
 import React from 'react';
 import LinksMixin from '../links-mixin';