]> source.dussan.org Git - sonarqube.git/commitdiff
update js linters
authorStas Vilchik <vilchiks@gmail.com>
Wed, 29 Jun 2016 08:19:22 +0000 (10:19 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 29 Jun 2016 08:19:22 +0000 (10:19 +0200)
14 files changed:
server/sonar-web/.eslintrc
server/sonar-web/.jscsrc [deleted file]
server/sonar-web/package.json
server/sonar-web/src/main/js/apps/code/utils.js
server/sonar-web/src/main/js/apps/component-measures/components/IconBubbles.js
server/sonar-web/src/main/js/apps/component-measures/components/IconHistory.js
server/sonar-web/src/main/js/apps/component-measures/components/IconList.js
server/sonar-web/src/main/js/apps/component-measures/components/IconTree.js
server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.js
server/sonar-web/src/main/js/components/controls/DateInput.js
server/sonar-web/src/main/js/components/controls/FavoriteBase.js
server/sonar-web/src/main/js/components/shared/pending-icon.js
server/sonar-web/src/main/js/components/shared/pin-icon.js
server/sonar-web/src/main/js/helpers/handlebars/changelog.js

index 58a1645c8b92c283be5eda41388ee1d054333ca1..c1cff1a0ef40598f802ce05a37adebf58317e727 100644 (file)
   ],
 
   "rules": {
-    "arrow-spacing": 1,
-    "comma-spacing": [1, { "before": false, "after": true }],
+    "arrow-spacing": 2,
+    "comma-spacing": 2,
     "curly": 2,
-    "eol-last": 1,
+    "eol-last": 2,
     "eqeqeq": [2, "smart"],
-    "indent": [1, 2, { "SwitchCase": 1, "VariableDeclarator": 2 }],
-    "jsx-quotes": 1,
-    "key-spacing": [1, { "beforeColon": false, "afterColon": true }],
-    "no-multi-spaces": 1,
+    "indent": [2, 2, { "SwitchCase": 1, "VariableDeclarator": 2 }],
+    "jsx-quotes": 2,
+    "key-spacing": 2,
+    "no-multi-spaces": 2,
     "no-self-compare": 2,
     "no-unexpected-multiline": 2,
-    "max-len": 0,
+    "max-len": [2, 120],
     "no-const-assign": 2,
-    "no-multiple-empty-lines": [1, { "max": 3 }],
-    "no-spaced-func": 1,
+    "no-multiple-empty-lines": [2, { "max": 3 }],
+    "no-spaced-func": 2,
     "no-this-before-super": 2,
-    "no-trailing-spaces": 1,
-    "no-unneeded-ternary": 1,
-    "object-curly-spacing": [1, "always"],
+    "no-trailing-spaces": 2,
+    "no-unneeded-ternary": 2,
+    "object-curly-spacing": [2, "always"],
     "no-var": 2,
     "object-shorthand": 2,
-    "one-var": [1, { "let": "never", "const": "never" }],
-    "quotes": [1, "single", "avoid-escape"],
+    "one-var": [2, { "let": "never", "const": "never" }],
+    "quotes": [2, "single", "avoid-escape"],
     "prefer-const": 2,
-    "semi": [1, "always"],
-    "keyword-spacing": 1,
+    "semi": [2, "always"],
+    "keyword-spacing": 2,
 
-    "react/jsx-closing-bracket-location": [1, "after-props"],
+    "react/jsx-closing-bracket-location": [2, "after-props"],
     "react/jsx-handler-names": 0,
-    "react/jsx-max-props-per-line": [1, { "maximum": 3 }],
+    "react/jsx-max-props-per-line": [2, { "maximum": 3 }],
     "react/jsx-no-duplicate-props": 2,
     "react/jsx-no-undef": 2,
-    "react/jsx-pascal-case": 1,
-    "react/jsx-uses-react": 1,
+    "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"],
@@ -69,7 +69,7 @@
     "react/prop-types": 0,
     "react/react-in-jsx-scope": 2,
     "react/self-closing-comp": 2,
-    "react/sort-comp": 1
+    "react/sort-comp": 2
   },
 
   "settings": {
diff --git a/server/sonar-web/.jscsrc b/server/sonar-web/.jscsrc
deleted file mode 100644 (file)
index 4b865a2..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-    "preset": "airbnb",
-    "esnext": true,
-    "excludeFiles": [
-      "src/main/js/libs/**"
-    ],
-
-    "disallowSpacesInFunctionDeclaration": false,
-    "requireTrailingComma": false,
-    "requirePaddingNewLinesAfterBlocks": false,
-    "requireShorthandArrowFunctions": false,
-    "disallowQuotedKeysInObjects": false,
-    "requireSpacesInFunctionDeclaration": {
-      "beforeOpeningRoundBrace": true,
-      "beforeOpeningCurlyBrace": true
-    },
-    "requireDotNotation": {
-      "allExcept": [
-        "snake_case"
-      ]
-    },
-    "disallowSpaceAfterObjectKeys": false,
-    "maximumLineLength": 120,
-    "safeContextKeyword": [
-      "that"
-    ],
-    "requireDollarBeforejQueryAssignment": false,
-    "requireDotNotation": false,
-    "disallowArrayDestructuringReturn": false,
-    "requireEnhancedObjectLiterals": true,
-    "requireObjectKeysOnNewLine": {
-      "allExcept": ["sameLine"]
-    },
-    "requireSpaceBeforeDestructuredValues": true,
-    "requireSpaceBeforeObjectValues": true,
-    "requireSpacesInsideObjectBrackets": "all",
-    "requirePaddingNewLinesBeforeLineComments": false
-}
index c16172f11920da2c56ef3e401000a687e8d8f7f6..3bc34ccd86fde3bcdbb50c0a23977daa221f451a 100644 (file)
@@ -26,9 +26,9 @@
     "d3": "3.5.6",
     "del": "2.0.2",
     "enzyme": "2.2.0",
-    "eslint": "^2.9.0",
-    "eslint-plugin-import": "^1.8.0",
-    "eslint-plugin-react": "^5.1.1",
+    "eslint": "^2.13.1",
+    "eslint-plugin-import": "^1.9.2",
+    "eslint-plugin-react": "^5.2.2",
     "event-stream": "3.3.1",
     "expose-loader": "0.7.1",
     "express": "4.13.4",
@@ -47,7 +47,6 @@
     "history": "2.0.0",
     "imports-loader": "0.6.5",
     "jquery": "2.2.0",
-    "jscs": "^2.11.0",
     "jsdom": "6.5.1",
     "lodash": "4.6.1",
     "mocha": "2.3.4",
@@ -88,7 +87,7 @@
     "build": "gulp build",
     "test": "mocha --opts tests/mocha.opts src/main/js/**/__tests__/**/*",
     "coverage": "nyc --exclude tests,**/__tests__/** mocha --opts tests/mocha.opts src/main/js/**/__tests__/**/* && nyc report --reporter lcov --report-dir target/coverage",
-    "lint": "eslint src/main/js && jscs src/main/js",
+    "lint": "eslint src/main/js",
     "dev": "NODE_ENV=hot node devServer"
   },
   "engines": {
index b236ee82d924d52c434e57ca5c8b09ed9e6c6555..eb63248fb13b72d327ea7ce1a278c675c6d95c7c 100644 (file)
@@ -18,7 +18,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import without from 'lodash/without';
-import sortBy from 'lodash/sortBy';
 
 import {
     addComponent,
index a0914801a0899a1efc1bf2c2d8afd3cbfe17ded4..b5411d4cc812a91b6a7c38e145f8c81043e99efd 100644 (file)
@@ -20,7 +20,7 @@
 import React from 'react';
 
 export default function IconBubbles () {
-  /* jscs:disable maximumLineLength */
+  /* eslint max-len: 0 */
   return (
       <svg className="measure-tab-icon"
            viewBox="0 0 512 448"
index 06057097841c53e3fb2c4e26f2e00a6f38469f76..85dac4e9decf772dd834673dacca6d4026d20f43 100644 (file)
@@ -20,7 +20,7 @@
 import React from 'react';
 
 export default function IconHistory () {
-  /* jscs:disable maximumLineLength */
+  /* eslint max-len: 0 */
   return (
       <svg className="measure-tab-icon"
            viewBox="0 0 512 448"
index 116c5395ac0a132d446b112fe5e6ae69fc5a4d70..6725685c36bf380e9f8ac773ef65edc981ec10c0 100644 (file)
@@ -20,7 +20,7 @@
 import React from 'react';
 
 export default function ListIcon () {
-  /* jscs:disable maximumLineLength */
+  /* eslint max-len: 0 */
   return (
       <svg className="measure-tab-icon"
            viewBox="0 0 448 448"
index cbd60958e7f25405f6e652bd22dcfdad7c50f3b6..1b9cb2ca79dab2e8944b987b3c0b08ca96af8db7 100644 (file)
@@ -20,7 +20,7 @@
 import React from 'react';
 
 export default function IconTree () {
-  /* jscs:disable maximumLineLength */
+  /* eslint max-len: 0 */
   return (
       <svg className="measure-tab-icon"
            viewBox="0 0 448 448"
index 1d972030e00970338f81ec5b0d17922d7a02e8e9..b83eaf2e0900de4ae9d75d55aab60398b5a653e6 100644 (file)
@@ -20,7 +20,7 @@
 import React from 'react';
 import ProfileInheritanceBox from './ProfileInheritanceBox';
 import ChangeParentView from '../views/ChangeParentView';
-import { ProfileType, ProfilesListType } from '../propTypes';
+import { ProfileType } from '../propTypes';
 import { translate } from '../../../helpers/l10n';
 import { getProfileInheritance } from '../../../api/quality-profiles';
 
index 59581521bc4dd976093cead5b8a62475b5198981..2d15e9130c775e65704f842aaf9d9def8a06ee0b 100644 (file)
@@ -65,6 +65,7 @@ export default class DateInput extends React.Component {
   render () {
     const inputProps = pick(this.props, ['placeholder', 'name']);
 
+    /* eslint max-len: 0 */
     return (
         <span className="date-input-control">
           <input
index 5d1f68361bee8bc7825c72e9ab8925ad800e1ab9..04ee1fc464089544f7a7e5114b4506a9479b6f74 100644 (file)
@@ -67,7 +67,7 @@ export default class FavoriteBase extends React.Component {
   }
 
   renderSVG () {
-    /* jscs:disable maximumLineLength */
+    /* eslint max-len: 0 */
     return (
         <svg width="16" height="16">
           <path
index 51dbfa48dcbaf8fa61fb0872928bc8247fe3a011..8a9488ff0e51cba2b86f4543c7500737451d34d6 100644 (file)
@@ -21,7 +21,7 @@ import React from 'react';
 
 export default React.createClass({
   render() {
-    /* jscs:disable maximumLineLength */
+    /* eslint max-len: 0 */
     return (
         <svg width="16" height="16" className="icon-pending">
           <g transform="matrix(0.0364583,0,0,0.0364583,1,-0.166667)">
index 5a6c1870697f288134c0c76f9140a7a97e990949..418dadc9b340b85b2e76bda4e1b547f8c51e4c53 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-/* jscs:disable maximumLineLength */
+/* eslint max-len: 0 */
 import React from 'react';
 
 const PinIcon = () => (
index 01ef33662451a6ee9fef42a88b07a4b2fb10f342..ab583714f336ba4a031bef4a38512ca2a1cc1cae 100644 (file)
@@ -25,7 +25,7 @@ module.exports = function (diff) {
   if (diff.key === 'file') {
     return translate('issue.change.issue_was_moved');
   }
-  
+
   if (diff.newValue != null) {
     message = translateWithParameters('issue.changelog.changed_to',
         translate('issue.changelog.field', diff.key), diff.newValue);