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

Commit 4d0a9be

Browse files
authored
Ramadan Todo list (#343)
* Change * Eslint added (#345) * Eslint added * eslint in travis * ayah require * Fixed * fixed bug that was preventing ayah transition on audioplayer * fix autocomplete thing * Extract connect from the surah container (#347) * Fout fonts (#346) * Fout fonts * wip * wip2 * do not update * pass tests
1 parent e6d2a8e commit 4d0a9be

File tree

67 files changed

+1672
-1341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1672
-1341
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ root = true
33

44
[*]
55
indent_style = space
6-
indent_size = 4
6+
indent_size = 2
77
charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NODE_ENV=development
22
PORT=8000
3-
API_URL=http://api.quran.com:3000
3+
API_URL=http://quran.com:3000
44
SEGMENTS_KEY=
55
SENTRY_KEY_CLIENT=
66
SENTRY_KEY_SERVER=

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/components/SurahInfo/htmls/*

.eslintrc

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,54 @@
11
{
22
"parser": "babel-eslint",
3+
"extends": "airbnb",
34
"env": {
4-
"es6": true,
5-
"node": true,
65
"browser": true,
7-
"jquery": true
8-
},
9-
"ecmaFeatures": {
10-
"arrowFunctions": true,
11-
"binaryLiterals": true,
12-
"blockBindings": true,
13-
"classes": true,
14-
"defaultParams": true,
15-
"destructuring": true,
16-
"forOf": true,
17-
"generators": true,
18-
"modules": true,
19-
"objectLiteralComputedProperties": true,
20-
"objectLiteralDuplicateProperties": true,
21-
"objectLiteralShorthandMethods": true,
22-
"objectLiteralShorthandProperties": true,
23-
"octalLiterals": true,
24-
"regexUFlag": true,
25-
"regexYFlag": true,
26-
"spread": true,
27-
"superInFunctions": true,
28-
"templateStrings": true,
29-
"unicodeCodePointEscapes": true,
30-
"globalReturn": true,
31-
"jsx": false
6+
"node": true,
7+
"mocha": true,
8+
"es6": true
329
},
3310
"rules": {
34-
"strict": 0,
35-
"indent": [2, 2],
36-
"quotes": [2, "single"],
37-
"no-unused-vars": 0
11+
"react/no-multi-comp": 0,
12+
"import/default": 0,
13+
"import/no-duplicates": 0,
14+
"import/named": 0,
15+
"import/namespace": 0,
16+
"import/no-unresolved": 0,
17+
"import/no-named-as-default": 2,
18+
// Temporarirly disabled due to a possible bug in babel-eslint (todomvc example)
19+
"block-scoped-var": 0,
20+
// Temporarily disabled for test/* until babel/babel-eslint#33 is resolved
21+
"padded-blocks": 0,
22+
"comma-dangle": 0, // not sure why airbnb turned this on. gross!
23+
"indent": [2, 2, {"SwitchCase": 1}],
24+
"no-console": 0,
25+
"no-alert": 0,
26+
"object-curly-spacing": 0,
27+
"no-case-declarations": 0
28+
},
29+
"plugins": [
30+
"react", "import"
31+
],
32+
"settings": {
33+
"import/parser": "babel-eslint",
34+
"import/resolve": {
35+
moduleDirectory: ["node_modules", "src"]
36+
}
37+
},
38+
"parserOptions":{
39+
"ecmaFeatures": {
40+
"experimentalObjectRestSpread": true
41+
}
3842
},
39-
"plugins": ["react"]
43+
"globals": {
44+
"__DEVELOPMENT__": true,
45+
"__CLIENT__": true,
46+
"__SERVER__": true,
47+
"__DISABLE_SSR__": true,
48+
"__DEVTOOLS__": true,
49+
"socket": true,
50+
"webpackIsomorphicTools": true,
51+
ga: true,
52+
Raven: true
53+
}
4054
}

client.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*global document, window, $ */
1+
/* global document, window, $ */
22
import 'babel-polyfill';
33

44
import React from 'react';
@@ -21,15 +21,19 @@ import createStore from './src/redux/create';
2121
import routes from './src/routes';
2222

2323
const client = new ApiClient();
24-
const store = createStore(browserHistory, client, window.__data);
24+
const store = createStore(browserHistory, client, window.reduxData);
2525
const history = syncHistoryWithStore(browserHistory, store);
2626

27-
Raven.config(config.sentryClient).install()
27+
try {
28+
Raven.config(config.sentryClient).install();
29+
} catch (error) {
30+
console.log(error);
31+
}
2832

2933
window.quranDebug = debug;
3034
window.ReactDOM = ReactDOM; // For chrome dev tool support
3135

32-
window.clearCookies = function() {
36+
window.clearCookies = () => {
3337
reactCookie.remove('quran');
3438
reactCookie.remove('content');
3539
reactCookie.remove('audio');
@@ -38,7 +42,7 @@ window.clearCookies = function() {
3842

3943
// Init tooltip
4044
if (typeof window !== 'undefined') {
41-
$(function () {
45+
$(() => {
4246
$(document.body).tooltip({
4347
selector: '[data-toggle="tooltip"]',
4448
animation: false
@@ -69,6 +73,7 @@ match({ history, routes: routes() }, (error, redirectLocation, renderProps) => {
6973
<Provider store={store} key="provider">
7074
{component}
7175
</Provider>, mountNode, () => {
72-
debug('client', 'React Rendered');
73-
});
76+
debug('client', 'React Rendered');
77+
}
78+
);
7479
});

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "quran",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"private": true,
55
"scripts": {
66
"test": "./node_modules/karma/bin/karma start",
7-
"test:ci:unit": "./node_modules/karma/bin/karma start --browsers PhantomJS --single-run",
7+
"test:ci:unit": "./node_modules/karma/bin/karma start --browsers PhantomJS --single-run; npm run test:ci:lint",
88
"test:ci:functional": "node ./nightwatch.js -c ./nightwatch.json -e production",
9-
"test:ci:lint": "eslint ./src/scripts/**/*.js",
9+
"test:ci:lint": "eslint ./src/**/*.js",
1010
"test:dev:unit": "./node_modules/karma/bin/karma start",
1111
"test:dev:functional": "node ./nightwatch.js -c ./nightwatch.json",
1212
"test:dev:lint": "eslint ./src/scripts/**/*.js",
@@ -59,6 +59,7 @@
5959
"express-useragent": "^0.2.0",
6060
"extract-text-webpack-plugin": "^1.0.1",
6161
"file-loader": "^0.8.4",
62+
"fontfaceobserver": "^1.7.1",
6263
"html-webpack-plugin": "^1.4.0",
6364
"http-proxy": "^1.13.2",
6465
"humps": "^1.0.0",
@@ -92,6 +93,7 @@
9293
"react-scroll": "^1.0.4",
9394
"redux": "^3.3.1",
9495
"redux-connect": "^2.4.0",
96+
"reselect": "^2.5.1",
9597
"resolve-url": "^0.2.1",
9698
"sass-loader": "2.0.1",
9799
"scroll-behavior": "^0.3.3",
@@ -117,9 +119,12 @@
117119
"chromedriver": "^2.19.0",
118120
"del": "^2.0.2",
119121
"enzyme": "^2.2.0",
120-
"eslint": "^1.4.1",
121-
"eslint-loader": "^1.0.0",
122-
"eslint-plugin-react": "^3.3.2",
122+
"eslint": "^2.13.0",
123+
"eslint-config-airbnb": "^9.0.1",
124+
"eslint-loader": "^1.3.0",
125+
"eslint-plugin-import": "^1.8.1",
126+
"eslint-plugin-jsx-a11y": "^1.5.3",
127+
"eslint-plugin-react": "^5.2.2",
123128
"jscs": "^2.1.1",
124129
"karma": "^0.13.9",
125130
"karma-chai": "^0.1.0",

server.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,9 @@ const port = process.env.PORT || 8000;
101101

102102
export default function serve(cb) {
103103
return server.listen(port, function() {
104-
console.info(`
105-
==> 🌎 ENV=${process.env.NODE_ENV}
106-
==> ✅ Server is listening at http://localhost:${port}
107-
==> 🎯 API at ${process.env.API_URL}
108-
`);
104+
console.info(`==> 🌎 ENV=${process.env.NODE_ENV}`);
105+
console.info(`==> ✅ Server is listening at http://localhost:${port}`);
106+
console.info(`==> 🎯 API at ${process.env.API_URL}`);
109107
Object.keys(config).forEach(key => config[key].constructor.name !== 'Object' && console.info(`==> ${key}`, config[key]));
110108

111109
cb && cb(this);

0 commit comments

Comments
 (0)