diff options
14 files changed, 36 insertions, 75 deletions
diff --git a/server/sonar-web/.eslintrc b/server/sonar-web/.eslintrc index 58a1645c8b9..c1cff1a0ef4 100644 --- a/server/sonar-web/.eslintrc +++ b/server/sonar-web/.eslintrc @@ -26,40 +26,40 @@ ], "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 index 4b865a25859..00000000000 --- a/server/sonar-web/.jscsrc +++ /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 -} diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index c16172f1192..3bc34ccd86f 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -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": { diff --git a/server/sonar-web/src/main/js/apps/code/utils.js b/server/sonar-web/src/main/js/apps/code/utils.js index b236ee82d92..eb63248fb13 100644 --- a/server/sonar-web/src/main/js/apps/code/utils.js +++ b/server/sonar-web/src/main/js/apps/code/utils.js @@ -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, diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/IconBubbles.js b/server/sonar-web/src/main/js/apps/component-measures/components/IconBubbles.js index a0914801a08..b5411d4cc81 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/IconBubbles.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/IconBubbles.js @@ -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" diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/IconHistory.js b/server/sonar-web/src/main/js/apps/component-measures/components/IconHistory.js index 06057097841..85dac4e9dec 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/IconHistory.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/IconHistory.js @@ -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" diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/IconList.js b/server/sonar-web/src/main/js/apps/component-measures/components/IconList.js index 116c5395ac0..6725685c36b 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/IconList.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/IconList.js @@ -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" diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/IconTree.js b/server/sonar-web/src/main/js/apps/component-measures/components/IconTree.js index cbd60958e7f..1b9cb2ca79d 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/IconTree.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/IconTree.js @@ -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" diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.js b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.js index 1d972030e00..b83eaf2e090 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileInheritance.js @@ -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'; diff --git a/server/sonar-web/src/main/js/components/controls/DateInput.js b/server/sonar-web/src/main/js/components/controls/DateInput.js index 59581521bc4..2d15e9130c7 100644 --- a/server/sonar-web/src/main/js/components/controls/DateInput.js +++ b/server/sonar-web/src/main/js/components/controls/DateInput.js @@ -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 diff --git a/server/sonar-web/src/main/js/components/controls/FavoriteBase.js b/server/sonar-web/src/main/js/components/controls/FavoriteBase.js index 5d1f68361be..04ee1fc4640 100644 --- a/server/sonar-web/src/main/js/components/controls/FavoriteBase.js +++ b/server/sonar-web/src/main/js/components/controls/FavoriteBase.js @@ -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 diff --git a/server/sonar-web/src/main/js/components/shared/pending-icon.js b/server/sonar-web/src/main/js/components/shared/pending-icon.js index 51dbfa48dcb..8a9488ff0e5 100644 --- a/server/sonar-web/src/main/js/components/shared/pending-icon.js +++ b/server/sonar-web/src/main/js/components/shared/pending-icon.js @@ -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)"> diff --git a/server/sonar-web/src/main/js/components/shared/pin-icon.js b/server/sonar-web/src/main/js/components/shared/pin-icon.js index 5a6c1870697..418dadc9b34 100644 --- a/server/sonar-web/src/main/js/components/shared/pin-icon.js +++ b/server/sonar-web/src/main/js/components/shared/pin-icon.js @@ -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 = () => ( diff --git a/server/sonar-web/src/main/js/helpers/handlebars/changelog.js b/server/sonar-web/src/main/js/helpers/handlebars/changelog.js index 01ef3366245..ab583714f33 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/changelog.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/changelog.js @@ -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); |