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

Commit fbac673

Browse files
committed
Eslint added (#345)
* Eslint added * eslint in travis * ayah require * Fixed * fixed bug that was preventing ayah transition on audioplayer * fix autocomplete thing
1 parent f0893eb commit fbac673

File tree

60 files changed

+1433
-1186
lines changed

Some content is hidden

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

60 files changed

+1433
-1186
lines changed

.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: 8 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,15 @@ 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+
Raven.config(config.sentryClient).install();
2828

2929
window.quranDebug = debug;
3030
window.ReactDOM = ReactDOM; // For chrome dev tool support
3131

32-
window.clearCookies = function() {
32+
window.clearCookies = () => {
3333
reactCookie.remove('quran');
3434
reactCookie.remove('content');
3535
reactCookie.remove('audio');
@@ -38,7 +38,7 @@ window.clearCookies = function() {
3838

3939
// Init tooltip
4040
if (typeof window !== 'undefined') {
41-
$(function () {
41+
$(() => {
4242
$(document.body).tooltip({
4343
selector: '[data-toggle="tooltip"]',
4444
animation: false
@@ -69,6 +69,7 @@ match({ history, routes: routes() }, (error, redirectLocation, renderProps) => {
6969
<Provider store={store} key="provider">
7070
{component}
7171
</Provider>, mountNode, () => {
72-
debug('client', 'React Rendered');
73-
});
72+
debug('client', 'React Rendered');
73+
}
74+
);
7475
});

package.json

Lines changed: 9 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",
@@ -117,9 +117,12 @@
117117
"chromedriver": "^2.19.0",
118118
"del": "^2.0.2",
119119
"enzyme": "^2.2.0",
120-
"eslint": "^1.4.1",
121-
"eslint-loader": "^1.0.0",
122-
"eslint-plugin-react": "^3.3.2",
120+
"eslint": "^2.13.0",
121+
"eslint-config-airbnb": "^9.0.1",
122+
"eslint-loader": "^1.3.0",
123+
"eslint-plugin-import": "^1.8.1",
124+
"eslint-plugin-jsx-a11y": "^1.5.3",
125+
"eslint-plugin-react": "^5.2.2",
123126
"jscs": "^2.1.1",
124127
"karma": "^0.13.9",
125128
"karma-chai": "^0.1.0",

0 commit comments

Comments
 (0)