Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

New React + eslint #543

Merged
merged 11 commits into from
Jan 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 19 additions & 29 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
{
"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",
"mocha"
],
"settings": {
"import/parser": "babel-eslint",
"import/resolve": {
moduleDirectory: ["node_modules", "src"]
}
"import/resolver": "webpack"
},
"parserOptions":{
"ecmaFeatures": {
Expand All @@ -53,6 +38,11 @@
mixpanel: true,
"expect": true,
"browser": true,
"FB": true
"FB": true,
sinon: true
},
"env": {
"mocha": true,
"amd": true
}
}
68 changes: 36 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"repository": "https://github.com/quran/quran.com-frontend",
"scripts": {
"test": "npm run test:dev:unit",
"test:ci:unit": "karma start --browsers PhantomJS --single-run; npm run test:ci:lint",
"test:ci:unit": "karma start --browsers PhantomJS --single-run",
"posttest:ci:unit": "npm run test:ci:lint",
"test:ci:functional": "BROWSER=phantomjs ./tests/functional/test.sh start-ci",
"posttest:ci:functional": "./tests/functional/test.sh stop",
"test:dev:unit": "karma start",
"test:ci:lint": "eslint ./src/**/*.js",
"test:ci:lint": "./node_modules/eslint/bin/eslint.js ./src/**/*.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be: "test:ci:lint": "eslint ./src/**/*.js", npm will look in the node_modules

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, i don't think that was the case with my local machine... it was not reflecting that since my Eslint installed globally was not the same version as package.json has.

"test:dev:functional": "BROWSER=chrome ./tests/functional/test.sh start",
"posttest:dev:functional": "./tests/functional/test.sh stop",
"test:dev:lint": "eslint ./src/scripts/**/*.js",
Expand Down Expand Up @@ -38,6 +39,7 @@
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-display-name": "6.8.0",
"babel-plugin-transform-react-inline-elements": "6.8.0",
"babel-plugin-transform-react-remove-prop-types": "0.2.11",
"babel-plugin-transform-runtime": "6.12.0",
"babel-plugin-typecheck": "3.9.0",
"babel-polyfill": "6.13.0",
Expand All @@ -55,91 +57,93 @@
"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-bootstrap": "0.29.5",
"react-cookie": "0.3.4",
"react-dom": "0.14.8",
"react": "15.4.1",
"react-a11y": "0.3.3",
"react-addons-create-fragment": "15.4.1",
"react-bootstrap": "0.30.7",
"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.1.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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely for it, although my only fear is it has not had any recent commits. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well its really a wrapper for the github fetch polyfill and node-fetch. I have been using it for API heavy projects and it has been very reliable. For now I guess we can just wrap superagent with a promise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay let's add it then :)

"url": "0.11.0",
"url-loader": "0.5.7",
"webpack": "2.1.0-beta.20",
"webpack-isomorphic-tools": "2.5.7",
"react-intl": "2.1.5",
"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-mocha": "4.8.0",
"eslint-plugin-react": "6.8.0",
"jscs": "2.1.1",
"karma": "1.2.0",
"karma": "1.3.0",
"karma-chai": "0.1.0",
"karma-chai-sinon": "0.1.5",
"karma-chrome-launcher": "0.2.0",
"karma-intl-shim": "1.0.3",
"karma-junit-reporter": "0.3.4",
"karma-mocha": "0.2.0",
"karma-phantomjs-launcher": "~0.2.1",
"karma-phantomjs-launcher": "~1.0.2",
"karma-script-launcher": "~0.1.0",
"karma-sinon": "1.0.4",
"karma-sourcemap-loader": "0.3.7",
Expand All @@ -151,7 +155,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",
Expand Down
13 changes: 6 additions & 7 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import config from './config';
import ApiClient from './helpers/ApiClient';
import createStore from './redux/create';
import routes from './routes';
import {getLocalMessages} from './helpers/setLocal';
import getLocalMessages from './helpers/setLocal';

const client = new ApiClient();
const store = createStore(browserHistory, client, window.reduxData);
Expand All @@ -29,7 +29,7 @@ const history = syncHistoryWithStore(browserHistory, store);
try {
Raven.config(config.sentryClient).install();
} catch (error) {
console.log(error);
debug('client', error);
}

window.quranDebug = debug;
Expand All @@ -49,11 +49,10 @@ match({ history, routes: routes(store) }, (error, redirectLocation, renderProps)
const component = (
<Router
{...renderProps}
render={(props) => (
render={props => (
<ReduxAsyncConnect
{...props}
helpers={{ client }}
filter={item => !item.deferred}
render={applyRouterMiddleware(useScroll())}
/>
)}
Expand All @@ -65,9 +64,9 @@ match({ history, routes: routes(store) }, (error, redirectLocation, renderProps)
debug('client', 'React Rendering');

ReactDOM.render(
<IntlProvider locale='en' messages={getLocalMessages()}>
<Provider store={store} key="provider">
{component}
<IntlProvider locale="en" messages={getLocalMessages()}>
<Provider store={store} key="provider">
{component}
</Provider>
</IntlProvider>, mountNode, () => {
debug('client', 'React Rendered');
Expand Down
Loading