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

Commit bbdca57

Browse files
committed
stylelint
1 parent e205ae0 commit bbdca57

File tree

78 files changed

+1343
-1495
lines changed

Some content is hidden

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

78 files changed

+1343
-1495
lines changed

.eslintrc

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
{
2-
"parser": "babel-eslint",
32
"extends": "airbnb",
4-
"env": {
5-
"browser": true,
6-
"node": true,
7-
"mocha": true,
8-
"es6": true
9-
},
3+
"parser": "babel-eslint",
104
"rules": {
11-
"react/no-multi-comp": 0,
12-
"import/default": 0,
13-
"import/no-duplicates": 0,
14-
"import/named": 0,
15-
"import/namespace": 0,
5+
"comma-dangle": 0,
6+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
7+
"import/no-extraneous-dependencies": 0,
8+
"import/extensions": 0,
169
"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
10+
"strict": 0
11+
},
12+
"ecmaFeatures": {
13+
"classes": true,
14+
"jsx": true
2815
},
2916
"plugins": [
30-
"react", "import"
17+
"react"
3118
],
3219
"settings": {
33-
"import/parser": "babel-eslint",
34-
"import/resolve": {
35-
moduleDirectory: ["node_modules", "src"]
36-
}
20+
"import/resolver": "webpack"
3721
},
3822
"parserOptions":{
3923
"ecmaFeatures": {

package.json

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,81 +55,82 @@
5555
"clean-webpack-plugin": "0.1.10",
5656
"compression": "1.6.2",
5757
"cookie-parser": "1.4.3",
58-
"copy-to-clipboard": "1.1.1",
58+
"copy-to-clipboard": "3.0.5",
5959
"cors": "2.7.1",
60-
"crypto-js": "3.1.6",
6160
"css-loader": "0.23.1",
6261
"debug": "2.2.0",
63-
"dotenv": "1.2.0",
62+
"dotenv": "2.0.0",
6463
"errorhandler": "1.4.3",
6564
"express": "4.14.0",
6665
"express-state": "1.4.0",
67-
"express-useragent": "0.2.4",
66+
"express-useragent": "1.0.4",
6867
"extract-text-webpack-plugin": "2.0.0-beta.3",
6968
"file-loader": "0.8.5",
7069
"fontfaceobserver": "1.7.3",
70+
"history": "^3.0.0",
7171
"html-webpack-plugin": "1.7.0",
7272
"http-proxy": "1.14.0",
73-
"humps": "1.1.0",
73+
"humps": "2.0.0",
7474
"imports-loader": "0.6.5",
75-
"jquery": "2.2.4",
7675
"json-loader": "0.5.4",
7776
"morgan": "1.7.0",
78-
"node-sass": "3.8.0",
77+
"node-sass": "4.1.1",
7978
"normalizr": "2.2.1",
8079
"pretty-error": "2.0.0",
8180
"promise": "7.1.1",
8281
"proxy-middleware": "0.14.0",
8382
"qs": "6.2.1",
84-
"raven": "0.11.0",
83+
"raven": "1.1.1",
8584
"raw-loader": "0.5.1",
86-
"react": "0.14.8",
85+
"react": "15.4.1",
86+
"react-a11y": "0.3.3",
87+
"react-addons-create-fragment": "15.4.1",
8788
"react-bootstrap": "0.29.5",
88-
"react-cookie": "0.3.4",
89-
"react-dom": "0.14.8",
89+
"react-cookie": "1.0.4",
90+
"react-dom": "15.4.1",
9091
"react-helmet": "3.1.0",
92+
"react-inlinesvg": "0.5.4",
9193
"react-metrics": "1.2.1",
92-
"react-paginate": "0.4.3",
93-
"react-redux": "4.4.5",
94-
"react-router": "2.6.1",
94+
"react-paginate": "4.0.0",
95+
"react-redux": "5.0.1",
96+
"react-router": "3.0.0",
9597
"react-router-bootstrap": "0.20.1",
96-
"react-router-redux": "4.0.5",
98+
"react-router-redux": "4.0.7",
9799
"react-router-scroll": "0.2.1",
98100
"react-scroll": "1.2.0",
99101
"react-share": "1.11.0",
100102
"react-sidebar": "2.2.1",
101103
"redux": "3.5.2",
102-
"redux-connect": "2.4.0",
104+
"redux-connect": "5.0.0",
103105
"reselect": "2.5.3",
104106
"resolve-url": "0.2.1",
105-
"sass-loader": "2.0.1",
107+
"sass-loader": "4.1.1",
106108
"serialize-javascript": "1.3.0",
107109
"serve-favicon": "2.3.0",
108110
"sitemap": "1.8.1",
109111
"strip-loader": "0.1.2",
110112
"style-loader": "0.13.1",
111-
"superagent": "1.8.4",
113+
"superagent": "3.3.1",
112114
"url": "0.11.0",
113115
"url-loader": "0.5.7",
114116
"webpack": "2.1.0-beta.20",
115117
"webpack-isomorphic-tools": "2.5.7",
116-
"winston": "1.1.2",
117-
"react-inlinesvg": "0.5.4"
118+
"winston": "1.1.2"
118119
},
119120
"devDependencies": {
120-
"babel-eslint": "6.0.4",
121+
"babel-eslint": "7.1.1",
121122
"babel-plugin-react-transform": "2.0.2",
122123
"babel-preset-react-hmre": "1.1.1",
123124
"chai": "3.0.0",
124125
"chromedriver": "2.22.2",
125126
"del": "2.0.2",
126127
"enzyme": "2.2.0",
127-
"eslint": "2.13.0",
128-
"eslint-config-airbnb": "9.0.1",
128+
"eslint": "3.12.2",
129+
"eslint-config-airbnb": "13.0.0",
129130
"eslint-loader": "1.3.0",
130-
"eslint-plugin-import": "1.8.1",
131-
"eslint-plugin-jsx-a11y": "1.5.3",
132-
"eslint-plugin-react": "5.2.2",
131+
"eslint-plugin-import": "2.2.0",
132+
"eslint-plugin-jsx-a11y": "2.2.3",
133+
"eslint-plugin-react": "6.8.0",
133134
"jscs": "2.1.1",
134135
"karma": "1.2.0",
135136
"karma-chai": "0.1.0",
@@ -149,7 +150,7 @@
149150
"phantomjs-polyfill": "0.0.1",
150151
"piping": "0.3.0",
151152
"pre-commit": "1.1.3",
152-
"react-addons-test-utils": "0.14.7",
153+
"react-addons-test-utils": "15.4.1",
153154
"react-transform-catch-errors": "1.0.0",
154155
"react-transform-hmr": "1.0.1",
155156
"redbox-react": "1.1.1",

src/client.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const history = syncHistoryWithStore(browserHistory, store);
2727
try {
2828
Raven.config(config.sentryClient).install();
2929
} catch (error) {
30-
console.log(error);
30+
debug('client', error);
3131
}
3232

3333
window.quranDebug = debug;
@@ -44,11 +44,10 @@ match({ history, routes: routes(store) }, (error, redirectLocation, renderProps)
4444
const component = (
4545
<Router
4646
{...renderProps}
47-
render={(props) => (
47+
render={props => (
4848
<ReduxAsyncConnect
4949
{...props}
5050
helpers={{ client }}
51-
filter={item => !item.deferred}
5251
render={applyRouterMiddleware(useScroll())}
5352
/>
5453
)}

src/components/FontStyles/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component, PropTypes } from 'react';
22
import { connect } from 'react-redux';
33
import { fontFaceStyle, fontFaceStyleLoaded } from 'helpers/buildFontFaces';
4-
import { load } from 'redux/actions/fontFace.js';
4+
import load from 'redux/actions/fontFace.js';
55

66
import debug from 'helpers/debug';
77
import selector from './selector';
@@ -29,7 +29,7 @@ export default class FontStyles extends Component {
2929
if (__CLIENT__) {
3030
const FontFaceObserver = require('fontfaceobserver'); // eslint-disable-line global-require
3131

32-
Object.keys(fontFaces).filter(className => !fontFaces[className]).forEach(className => {
32+
Object.keys(fontFaces).filter(className => !fontFaces[className]).forEach((className) => {
3333
const font = new FontFaceObserver(className);
3434

3535
font.load().then(() => load(className), () => load(className));

src/components/FontStyles/selector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { createSelector } from 'reselect';
22

33
export default createSelector(
44
state => state.fontFaces,
5-
(fontFaces) => fontFaces
5+
fontFaces => fontFaces
66
);

src/components/Footer/index.js

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ const Footer = () => (
1818
<li><Link to="/about">About</Link></li>
1919
<li><Link to="/contact">Contact</Link></li>
2020
<li>
21-
<a href="https://quran.zendesk.com/hc/en-us/articles/210090626-Development-help" target="_blank" data-metrics-event-name="Footer:Link:Developer">
21+
<a
22+
href="https://quran.zendesk.com/hc/en-us/articles/210090626-Development-help"
23+
target="_blank"
24+
rel="noopener noreferrer"
25+
data-metrics-event-name="Footer:Link:Developer"
26+
>
2227
Developers
2328
</a>
2429
</li>
@@ -27,11 +32,43 @@ const Footer = () => (
2732
<Col md={3} sm={4} xs={12} className={styles.links}>
2833
<p>Useful sites</p>
2934
<ul className={`source-sans ${styles.list}`}>
30-
<li><a target="_blank" href="http://sunnah.com/" data-metrics-event-name="Footer:Link:Sunnah">Sunnah.com</a></li>
31-
<li><a target="_blank" href="http://salah.com/" data-metrics-event-name="Footer:Link:Salah">Salah.com</a></li>
32-
<li><a target="_blank" href="http://quranicaudio.com/" data-metrics-event-name="Footer:Link:QuranicAudio">QuranicAudio.com</a></li>
3335
<li>
34-
<a target="_blank" href="http://corpus.quran.com/wordbyword.jsp" data-metrics-event-name="Footer:Link:Corpus">
36+
<a
37+
target="_blank"
38+
rel="noopener noreferrer"
39+
href="http://sunnah.com/"
40+
data-metrics-event-name="Footer:Link:Sunnah"
41+
>
42+
Sunnah.com
43+
</a>
44+
</li>
45+
<li>
46+
<a
47+
target="_blank"
48+
rel="noopener noreferrer"
49+
href="http://salah.com/"
50+
data-metrics-event-name="Footer:Link:Salah"
51+
>
52+
Salah.com
53+
</a>
54+
</li>
55+
<li>
56+
<a
57+
target="_blank"
58+
rel="noopener noreferrer"
59+
href="http://quranicaudio.com/"
60+
data-metrics-event-name="Footer:Link:QuranicAudio"
61+
>
62+
QuranicAudio.com
63+
</a>
64+
</li>
65+
<li>
66+
<a
67+
target="_blank"
68+
rel="noopener noreferrer"
69+
href="http://corpus.quran.com/wordbyword.jsp"
70+
data-metrics-event-name="Footer:Link:Corpus"
71+
>
3572
Corpus: Word by Word
3673
</a>
3774
</li>

src/components/Home/LastVisit/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import React, { PropTypes } from 'react';
22
import debug from 'helpers/debug';
3+
import Link from 'react-router/lib/Link';
4+
35
const styles = require('./style.scss');
46

57
const LastVisit = (props) => {
6-
78
debug('component:Index', 'LastVisit');
89

9-
const {lastVisit, surahs} = props;
10+
const { lastVisit, surahs } = props;
1011

1112
if (lastVisit) {
12-
1313
const surah = surahs[lastVisit.surah - 1];
1414

1515
if (surah) {
16-
1716
const lastVisitedAyah = parseInt(lastVisit.ayah, 10);
1817

1918
return (
@@ -48,6 +47,8 @@ const LastVisit = (props) => {
4847
);
4948
}
5049
}
50+
51+
return false;
5152
};
5253

5354
LastVisit.propTypes = {
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import React from 'react';
22
import { mount } from 'enzyme';
3-
import Link from 'react-router/lib/Link';
43
import QuickSurahs from './index.js';
54

6-
describe("<QuickSurahs />", () => {
5+
describe('<QuickSurahs />', () => {
76
const count = new Date().getDay() === 5 ? 5 : 4;
87

9-
it("Should render QuickSurahs component", () => {
10-
let component = mount(<QuickSurahs />);
8+
it('Should render QuickSurahs component', () => {
9+
const component = mount(<QuickSurahs />);
1110
expect(component).to.be.ok;
1211
expect(component.find('a').length).to.equal(count);
1312
});
1413

15-
it("Should render QuickSurahs component with Surah Al-Kahf", () => {
16-
let component = mount(<QuickSurahs />);
14+
it('Should render QuickSurahs component with Surah Al-Kahf', () => {
15+
const component = mount(<QuickSurahs />);
1716
expect(component).to.be.ok;
1817
expect(component.find('a').length).to.equal(count);
19-
})
20-
18+
});
2119
});

src/components/Home/SurahsList/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React, { PropTypes } from 'react';
22
import debug from 'helpers/debug';
33
import Link from 'react-router/lib/Link';
4+
45
const styles = require('./style.scss');
56

67
const SurahsList = (props) => {
78
debug('component:Index', 'SurahsList');
89

910
return (
1011
<ul className="col-md-4 list-unstyled">
11-
{props.surahs.map((surah) => (
12+
{props.surahs.map(surah => (
1213
<li className={`${styles.item}`} key={surah.id}>
1314
<Link to={`/${surah.id}`} className={`${styles.link} row`}>
1415
<div className="col-xs-2 text-muted">

src/components/Home/SurahsList/spec.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ import getSurahs from '../../../../tests/fixtures/getSurahs.js';
55
import SurahsList from './index.js';
66

77
describe('<SurahsList />', () => {
8-
9-
it("Should render SurahList component", () => {
10-
let component = mount(<SurahsList surahs={getSurahs.default.slice(0, 4)}/>);
8+
it('Should render SurahList component', () => {
9+
const component = mount(<SurahsList surahs={getSurahs.default.slice(0, 4)} />);
1110
expect(component).to.be.ok;
1211
expect(component.find('li').length).to.equal(4);
1312
});
14-
1513
});

0 commit comments

Comments
 (0)