From bbdca578d52dc7824373e02883a0d92a30ae3905 Mon Sep 17 00:00:00 2001 From: Mohamed El Mahallawy Date: Fri, 23 Dec 2016 02:58:54 +0200 Subject: [PATCH] stylelint --- .eslintrc | 40 +- package.json | 55 +- src/client.js | 5 +- src/components/FontStyles/index.js | 4 +- src/components/FontStyles/selector.js | 2 +- src/components/Footer/index.js | 47 +- src/components/Home/LastVisit/index.js | 9 +- src/components/Home/QuickSurahs/spec.js | 14 +- src/components/Home/SurahsList/index.js | 3 +- src/components/Home/SurahsList/spec.js | 6 +- src/components/IndexHeader/Nav/index.js | 9 +- src/components/IndexHeader/index.js | 6 +- src/components/InformationToggle/index.js | 3 +- src/components/LazyLoad/index.js | 2 +- src/components/Line/index.js | 12 +- src/components/NightModeToggle/index.js | 33 +- src/components/NoScript/index.js | 14 +- src/components/NoScriptWarning/index.js | 23 - src/components/PageBreak/index.js | 2 +- src/components/QuranNav/index.js | 6 +- src/components/ReciterDropdown/index.js | 2 +- src/components/SearchAutocomplete/index.js | 12 +- src/components/SearchInput/index.js | 3 +- src/components/Share/index.js | 21 +- src/components/Sidebar/index.js | 8 +- src/components/SmartBanner/index.js | 48 +- src/components/SurahInfo/index.js | 11 +- src/components/SurahsDropdown/index.js | 2 +- src/components/TooltipDropdown/index.js | 4 +- src/components/TopOptions/index.js | 8 +- src/config.js | 118 +- src/containers/About/index.js | 12 +- src/containers/App/connect.js | 2 +- src/containers/App/index.js | 30 +- src/containers/Contact/index.js | 32 +- src/containers/Donations/index.js | 3 +- src/containers/Home/index.js | 7 +- src/containers/MobileLanding/index.js | 6 +- src/containers/Search/Header/index.js | 2 +- src/containers/Search/index.js | 14 +- src/containers/Surah/Header/index.js | 11 +- src/containers/Surah/Title/index.js | 18 +- src/containers/Surah/connect.js | 2 +- src/containers/Surah/index.js | 35 +- src/helpers/ApiClient.js | 2 +- src/helpers/Html.js | 12 +- src/helpers/buildAudio.js | 7 +- src/helpers/buildFontFaces.js | 6 +- src/helpers/buildSegments.js | 2 +- src/helpers/makeHeadTags.js | 20 +- src/helpers/metrics.js | 3 +- src/redux/actions/auth.js | 4 +- src/redux/actions/ayahs.js | 2 +- src/redux/actions/bookmarks.js | 6 +- src/redux/actions/fontFace.js | 10 +- src/redux/actions/media.js | 18 +- src/redux/actions/options.js | 2 +- src/redux/actions/search.js | 4 +- src/redux/actions/surahs.js | 6 +- src/redux/create.js | 3 +- src/redux/middleware/clientMiddleware.js | 10 +- src/redux/modules/audioplayer.js | 40 +- src/redux/modules/ayahs.js | 22 +- src/redux/modules/bookmarks.js | 6 - src/redux/modules/fontFaces.js | 6 +- src/redux/modules/lines.js | 9 +- src/redux/modules/options.js | 6 +- src/redux/modules/surahs.js | 6 +- src/routes.js | 2 +- src/server.js | 94 +- src/server/config/express.js | 19 +- src/server/config/sitemap.js | 7 +- src/server/config/support.js | 2 +- src/styles/components/SmartBanner.scss | 16 - src/utils/bindTooltip.js | 8 +- src/utils/getOffset.js | 2 +- src/utils/scroller.js | 1 + yarn.lock | 1769 +++++++++----------- 78 files changed, 1343 insertions(+), 1495 deletions(-) delete mode 100644 src/components/NoScriptWarning/index.js diff --git a/.eslintrc b/.eslintrc index 2ee45a587..e06ce929b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,39 +1,23 @@ { - "parser": "babel-eslint", "extends": "airbnb", - "env": { - "browser": true, - "node": true, - "mocha": true, - "es6": true - }, + "parser": "babel-eslint", "rules": { - "react/no-multi-comp": 0, - "import/default": 0, - "import/no-duplicates": 0, - "import/named": 0, - "import/namespace": 0, + "comma-dangle": 0, + "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], + "import/no-extraneous-dependencies": 0, + "import/extensions": 0, "import/no-unresolved": 0, - "import/no-named-as-default": 2, - // Temporarirly disabled due to a possible bug in babel-eslint (todomvc example) - "block-scoped-var": 0, - // Temporarily disabled for test/* until babel/babel-eslint#33 is resolved - "padded-blocks": 0, - "comma-dangle": 0, // not sure why airbnb turned this on. gross! - "indent": [2, 2, {"SwitchCase": 1}], - "no-console": 0, - "no-alert": 0, - "object-curly-spacing": 0, - "no-case-declarations": 0 + "strict": 0 + }, + "ecmaFeatures": { + "classes": true, + "jsx": true }, "plugins": [ - "react", "import" + "react" ], "settings": { - "import/parser": "babel-eslint", - "import/resolve": { - moduleDirectory: ["node_modules", "src"] - } + "import/resolver": "webpack" }, "parserOptions":{ "ecmaFeatures": { diff --git a/package.json b/package.json index 6ffb5c67b..f918334f1 100644 --- a/package.json +++ b/package.json @@ -55,81 +55,82 @@ "clean-webpack-plugin": "0.1.10", "compression": "1.6.2", "cookie-parser": "1.4.3", - "copy-to-clipboard": "1.1.1", + "copy-to-clipboard": "3.0.5", "cors": "2.7.1", - "crypto-js": "3.1.6", "css-loader": "0.23.1", "debug": "2.2.0", - "dotenv": "1.2.0", + "dotenv": "2.0.0", "errorhandler": "1.4.3", "express": "4.14.0", "express-state": "1.4.0", - "express-useragent": "0.2.4", + "express-useragent": "1.0.4", "extract-text-webpack-plugin": "2.0.0-beta.3", "file-loader": "0.8.5", "fontfaceobserver": "1.7.3", + "history": "^3.0.0", "html-webpack-plugin": "1.7.0", "http-proxy": "1.14.0", - "humps": "1.1.0", + "humps": "2.0.0", "imports-loader": "0.6.5", - "jquery": "2.2.4", "json-loader": "0.5.4", "morgan": "1.7.0", - "node-sass": "3.8.0", + "node-sass": "4.1.1", "normalizr": "2.2.1", "pretty-error": "2.0.0", "promise": "7.1.1", "proxy-middleware": "0.14.0", "qs": "6.2.1", - "raven": "0.11.0", + "raven": "1.1.1", "raw-loader": "0.5.1", - "react": "0.14.8", + "react": "15.4.1", + "react-a11y": "0.3.3", + "react-addons-create-fragment": "15.4.1", "react-bootstrap": "0.29.5", - "react-cookie": "0.3.4", - "react-dom": "0.14.8", + "react-cookie": "1.0.4", + "react-dom": "15.4.1", "react-helmet": "3.1.0", + "react-inlinesvg": "0.5.4", "react-metrics": "1.2.1", - "react-paginate": "0.4.3", - "react-redux": "4.4.5", - "react-router": "2.6.1", + "react-paginate": "4.0.0", + "react-redux": "5.0.1", + "react-router": "3.0.0", "react-router-bootstrap": "0.20.1", - "react-router-redux": "4.0.5", + "react-router-redux": "4.0.7", "react-router-scroll": "0.2.1", "react-scroll": "1.2.0", "react-share": "1.11.0", "react-sidebar": "2.2.1", "redux": "3.5.2", - "redux-connect": "2.4.0", + "redux-connect": "5.0.0", "reselect": "2.5.3", "resolve-url": "0.2.1", - "sass-loader": "2.0.1", + "sass-loader": "4.1.1", "serialize-javascript": "1.3.0", "serve-favicon": "2.3.0", "sitemap": "1.8.1", "strip-loader": "0.1.2", "style-loader": "0.13.1", - "superagent": "1.8.4", + "superagent": "3.3.1", "url": "0.11.0", "url-loader": "0.5.7", "webpack": "2.1.0-beta.20", "webpack-isomorphic-tools": "2.5.7", - "winston": "1.1.2", - "react-inlinesvg": "0.5.4" + "winston": "1.1.2" }, "devDependencies": { - "babel-eslint": "6.0.4", + "babel-eslint": "7.1.1", "babel-plugin-react-transform": "2.0.2", "babel-preset-react-hmre": "1.1.1", "chai": "3.0.0", "chromedriver": "2.22.2", "del": "2.0.2", "enzyme": "2.2.0", - "eslint": "2.13.0", - "eslint-config-airbnb": "9.0.1", + "eslint": "3.12.2", + "eslint-config-airbnb": "13.0.0", "eslint-loader": "1.3.0", - "eslint-plugin-import": "1.8.1", - "eslint-plugin-jsx-a11y": "1.5.3", - "eslint-plugin-react": "5.2.2", + "eslint-plugin-import": "2.2.0", + "eslint-plugin-jsx-a11y": "2.2.3", + "eslint-plugin-react": "6.8.0", "jscs": "2.1.1", "karma": "1.2.0", "karma-chai": "0.1.0", @@ -149,7 +150,7 @@ "phantomjs-polyfill": "0.0.1", "piping": "0.3.0", "pre-commit": "1.1.3", - "react-addons-test-utils": "0.14.7", + "react-addons-test-utils": "15.4.1", "react-transform-catch-errors": "1.0.0", "react-transform-hmr": "1.0.1", "redbox-react": "1.1.1", diff --git a/src/client.js b/src/client.js index 2be5baf31..6db6414a4 100644 --- a/src/client.js +++ b/src/client.js @@ -27,7 +27,7 @@ const history = syncHistoryWithStore(browserHistory, store); try { Raven.config(config.sentryClient).install(); } catch (error) { - console.log(error); + debug('client', error); } window.quranDebug = debug; @@ -44,11 +44,10 @@ match({ history, routes: routes(store) }, (error, redirectLocation, renderProps) const component = ( ( + render={props => ( !item.deferred} render={applyRouterMiddleware(useScroll())} /> )} diff --git a/src/components/FontStyles/index.js b/src/components/FontStyles/index.js index 79622e38b..18191c22b 100644 --- a/src/components/FontStyles/index.js +++ b/src/components/FontStyles/index.js @@ -1,7 +1,7 @@ import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import { fontFaceStyle, fontFaceStyleLoaded } from 'helpers/buildFontFaces'; -import { load } from 'redux/actions/fontFace.js'; +import load from 'redux/actions/fontFace.js'; import debug from 'helpers/debug'; import selector from './selector'; @@ -29,7 +29,7 @@ export default class FontStyles extends Component { if (__CLIENT__) { const FontFaceObserver = require('fontfaceobserver'); // eslint-disable-line global-require - Object.keys(fontFaces).filter(className => !fontFaces[className]).forEach(className => { + Object.keys(fontFaces).filter(className => !fontFaces[className]).forEach((className) => { const font = new FontFaceObserver(className); font.load().then(() => load(className), () => load(className)); diff --git a/src/components/FontStyles/selector.js b/src/components/FontStyles/selector.js index 77ed63c5b..90be4a1c6 100644 --- a/src/components/FontStyles/selector.js +++ b/src/components/FontStyles/selector.js @@ -2,5 +2,5 @@ import { createSelector } from 'reselect'; export default createSelector( state => state.fontFaces, - (fontFaces) => fontFaces + fontFaces => fontFaces ); diff --git a/src/components/Footer/index.js b/src/components/Footer/index.js index 6b7300302..656b54bb6 100644 --- a/src/components/Footer/index.js +++ b/src/components/Footer/index.js @@ -18,7 +18,12 @@ const Footer = () => (
  • About
  • Contact
  • - + Developers
  • @@ -27,11 +32,43 @@ const Footer = () => (

    Useful sites