From cc0543d5dfba1cc632720c3b9ebe16b79b514d31 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Thu, 23 Jun 2016 16:57:26 -0700 Subject: [PATCH] Fix(lint): correct lint errors --- .eslintrc | 60 +++++++++---------- common/app/components/Footer/Footer.jsx | 51 ---------------- common/app/components/Footer/README.md | 1 - common/app/components/Footer/index.js | 1 - common/app/components/Footer/links.json | 44 -------------- common/app/components/Nav/NavItem.jsx | 6 +- .../challenges/components/classic/Editor.jsx | 6 +- .../challenges/components/classic/Preview.jsx | 6 +- .../challenges/components/project/Forms.jsx | 16 ++--- server/production-start.js | 2 +- server/utils/lang-passthrough-urls.js | 4 +- 11 files changed, 54 insertions(+), 143 deletions(-) delete mode 100644 common/app/components/Footer/Footer.jsx delete mode 100644 common/app/components/Footer/README.md delete mode 100644 common/app/components/Footer/index.js delete mode 100644 common/app/components/Footer/links.json diff --git a/.eslintrc b/.eslintrc index 795a204d27..c943753581 100644 --- a/.eslintrc +++ b/.eslintrc @@ -55,15 +55,15 @@ "complexity": 0, "consistent-return": 2, "curly": 2, - "default-case": 1, + "default-case": 2, "dot-notation": 0, - "eqeqeq": 1, - "guard-for-in": 1, - "no-alert": 1, + "eqeqeq": 2, + "guard-for-in": 2, + "no-alert": 2, "no-caller": 2, "no-div-regex": 2, "no-else-return": 0, - "no-eq-null": 1, + "no-eq-null": 2, "no-eval": 2, "no-extend-native": 2, "no-extra-bind": 2, @@ -73,8 +73,8 @@ "no-iterator": 2, "no-labels": 2, "no-lone-blocks": 2, - "no-loop-func": 1, - "no-multi-spaces": 1, + "no-loop-func": 2, + "no-multi-spaces": 2, "no-multi-str": 2, "no-native-reassign": 2, "no-new": 2, @@ -84,15 +84,15 @@ "no-octal-escape": 2, "no-process-env": 0, "no-proto": 2, - "no-redeclare": 1, + "no-redeclare": 2, "no-return-assign": 2, "no-script-url": 2, "no-self-compare": 2, "no-sequences": 2, "no-unused-expressions": 2, - "no-void": 1, + "no-void": 2, "no-warning-comments": [ - 1, + 2, { "terms": [ "fixme" @@ -115,7 +115,7 @@ "no-shadow-restricted-names": 2, "no-undef": 2, "no-undef-init": 2, - "no-undefined": 1, + "no-undefined": 2, "no-unused-vars": 2, "no-use-before-define": 0, @@ -132,7 +132,7 @@ "1tbs", { "allowSingleLine": true } ], - "camelcase": 1, + "camelcase": 2, "comma-spacing": [ 2, { @@ -158,11 +158,11 @@ "new-cap": 0, "new-parens": 2, "no-array-constructor": 2, - "no-inline-comments": 1, - "no-lonely-if": 1, + "no-inline-comments": 2, + "no-lonely-if": 2, "no-mixed-spaces-and-tabs": 2, "no-multiple-empty-lines": [ - 1, + 2, { "max": 2 } ], "no-nested-ternary": 2, @@ -170,7 +170,7 @@ "semi-spacing": [2, { "before": false, "after": true }], "no-spaced-func": 2, "no-ternary": 0, - "no-trailing-spaces": 1, + "no-trailing-spaces": 2, "no-underscore-dangle": 0, "one-var": 0, "operator-assignment": 0, @@ -199,7 +199,7 @@ "space-in-parens": 0, "space-infix-ops": 2, "space-unary-ops": [ - 1, + 2, { "words": true, "nonwords": false @@ -210,7 +210,7 @@ "always", { "exceptions": ["-"] } ], - "wrap-regex": 1, + "wrap-regex": 2, "max-depth": 0, "max-len": [ @@ -220,23 +220,23 @@ ], "max-params": 0, "max-statements": 0, - "no-bitwise": 1, + "no-bitwise": 2, "no-plusplus": 0, - "react/display-name": 1, - "react/jsx-boolean-value": [1, "always"], - "jsx-quotes": [1, "prefer-single"], - "react/jsx-no-undef": 1, - "react/jsx-sort-props": [1, { "ignoreCase": true }], - "react/jsx-uses-react": 1, - "react/jsx-uses-vars": 1, + "react/display-name": 2, + "react/jsx-boolean-value": [2, "always"], + "jsx-quotes": [2, "prefer-single"], + "react/jsx-no-undef": 2, + "react/jsx-sort-props": [2, { "ignoreCase": true }], + "react/jsx-uses-react": 2, + "react/jsx-uses-vars": 2, "react/no-did-mount-set-state": 2, "react/no-did-update-set-state": 2, "react/no-multi-comp": [2, { "ignoreStateless": true } ], "react/prop-types": 2, - "react/react-in-jsx-scope": 1, - "react/self-closing-comp": 1, - "react/wrap-multilines": 1, - "react/jsx-closing-bracket-location": [ 1, { "selfClosing": "line-aligned", "nonEmpty": "props-aligned" } ] + "react/react-in-jsx-scope": 2, + "react/self-closing-comp": 2, + "react/wrap-multilines": 2, + "react/jsx-closing-bracket-location": [ 2, { "selfClosing": "line-aligned", "nonEmpty": "props-aligned" } ] } } diff --git a/common/app/components/Footer/Footer.jsx b/common/app/components/Footer/Footer.jsx deleted file mode 100644 index 7325fa9d57..0000000000 --- a/common/app/components/Footer/Footer.jsx +++ /dev/null @@ -1,51 +0,0 @@ -import React from 'react'; -import { Col, Row, Grid } from 'react-bootstrap'; - -import links from './links.json'; - -export default class extends React.Component { - static displayName = 'Footer'; - renderLinks(mobile) { - return links.map(link => { - return ( - - { this.renderContent(mobile, link.content) } - - ); - }); - } - - renderContent(mobile, content) { - if (mobile) { - return ( - - content; - - ); - } - return content; - } - - render() { - return ( - - - - { this.renderLinks() } - - - { this.renderLinks(true) } - - - - ); - } -} diff --git a/common/app/components/Footer/README.md b/common/app/components/Footer/README.md deleted file mode 100644 index a8f04d0a40..0000000000 --- a/common/app/components/Footer/README.md +++ /dev/null @@ -1 +0,0 @@ -Currently not used diff --git a/common/app/components/Footer/index.js b/common/app/components/Footer/index.js deleted file mode 100644 index 07d4704d78..0000000000 --- a/common/app/components/Footer/index.js +++ /dev/null @@ -1 +0,0 @@ -export default from './Footer.jsx'; diff --git a/common/app/components/Footer/links.json b/common/app/components/Footer/links.json deleted file mode 100644 index acb50bde56..0000000000 --- a/common/app/components/Footer/links.json +++ /dev/null @@ -1,44 +0,0 @@ -[ - { - "className": "ion-speakerphone", - "content": " Blog ", - "href": "http://medium.freecodecamp.com", - "target": "_blank" - }, - { - "className": "ion-social-twitch-outline", - "content": " Twitch ", - "href": "http://www.twitch.tv/freecodecamp", - "target": "_blank" - }, - { - "className": "ion-social-github", - "content": " GitHub ", - "href": "http://github.com/freecodecamp", - "target": "_blank" - }, - { - "className": "ion-social-twitter", - "content": " Twitter ", - "href": "http://twitter.com/freecodecamp", - "target": "_blank" - }, - { - "className": "ion-social-facebook", - "content": " Facebook ", - "href": "http://facebook.com/freecodecamp", - "target": "_blank" - }, - { - "className": "ion-information-circled", - "content": " About ", - "href": "/learn-to-code", - "target": "_self" - }, - { - "className": "ion-locked", - "content": " Privacy ", - "href": "/privacy'", - "target": "_self" - } -] diff --git a/common/app/components/Nav/NavItem.jsx b/common/app/components/Nav/NavItem.jsx index 465cabf7df..4b53ccf483 100644 --- a/common/app/components/Nav/NavItem.jsx +++ b/common/app/components/Nav/NavItem.jsx @@ -77,12 +77,14 @@ export default React.createClass({ return (
  • + role='presentation' + > + className={ linkClassName } + > { children }
  • diff --git a/common/app/routes/challenges/components/classic/Editor.jsx b/common/app/routes/challenges/components/classic/Editor.jsx index 7712219305..d7256579bd 100644 --- a/common/app/routes/challenges/components/classic/Editor.jsx +++ b/common/app/routes/challenges/components/classic/Editor.jsx @@ -115,12 +115,14 @@ export class Editor extends PureComponent { return (
    + style={ style } + > + value={ content } + />
    ); diff --git a/common/app/routes/challenges/components/classic/Preview.jsx b/common/app/routes/challenges/components/classic/Preview.jsx index abb3a551b7..748e58c7f6 100644 --- a/common/app/routes/challenges/components/classic/Preview.jsx +++ b/common/app/routes/challenges/components/classic/Preview.jsx @@ -11,11 +11,13 @@ export default class extends PureComponent {
    + src='https://s3.amazonaws.com/freecodecamp/iphone6-frame.png' + />