Skip to content

Commit de3bd87

Browse files
committed
Added fbjs eslint config, fixed lint errors and warnings
1 parent 5a96b1d commit de3bd87

File tree

7 files changed

+20
-9
lines changed

7 files changed

+20
-9
lines changed

.eslintrc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"extends": [
3-
"eslint:recommended",
4-
"plugin:react/recommended"
3+
"fbjs"
54
],
65
"plugins": [
76
"prettier",
87
"react"
98
],
109
"parser": "babel-eslint",
10+
"rules": {
11+
"relay/graphql-naming": 0,
12+
"max-len": 0
13+
},
1114
"env": {
1215
"node": true,
1316
"browser": true

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
"array-from": "^2.1.1",
1717
"babel-eslint": "^8.0.1",
1818
"eslint": "^4.8.0",
19+
"eslint-config-fbjs": "^2.0.0",
1920
"eslint-config-react": "^1.1.7",
20-
"eslint-plugin-flowtype": "^2.37.0",
21+
"eslint-plugin-babel": "^4.1.2",
22+
"eslint-plugin-flowtype": "^2.39.1",
23+
"eslint-plugin-jsx-a11y": "^6.0.2",
2124
"eslint-plugin-prettier": "^2.3.1",
2225
"eslint-plugin-react": "^7.4.0",
26+
"eslint-plugin-relay": "^0.0.19",
2327
"flow-bin": "^0.56.0",
2428
"gatsby": "^1.9.9",
2529
"gatsby-link": "^1.6.9",

src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ class StickyResponsiveSidebar extends Component {
147147
boxShadow: '0 0 20px rgba(0, 0, 0, 0.3)',
148148
[media.lessThan('small')]: smallScreenBottomBarStyles,
149149
}}
150-
onClick={this._openNavMenu}>
150+
onClick={this._openNavMenu}
151+
role="button"
152+
tabIndex="-1">
151153
<Container>
152154
<div
153155
css={{

src/html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if (process.env.NODE_ENV === `production`) {
1616
try {
1717
stylesStr = require(`!raw-loader!../public/styles.css`);
1818
} catch (e) {
19-
console.log(e);
19+
console.error(e);
2020
}
2121
}
2222

src/templates/components/MetaTitle/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const MetaTitle = ({
3030
textTransform: 'uppercase',
3131
letterSpacing: '0.08em',
3232
...cssProps,
33-
}}>
33+
}}
34+
role="link"
35+
tabIndex="-1">
3436
{children}
3537
</div>
3638
);

src/templates/components/Sidebar/Section.js

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
'use strict';
1111

12+
import React from 'react';
1213
import {colors, media} from 'theme';
1314
import isItemActive from 'utils/isItemActive';
1415
import MetaTitle from '../MetaTitle';

src/utils/isItemActive.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ const isItemActive = (location, item) => {
2626
}
2727
} else if (item.id.includes('html')) {
2828
return location.pathname.includes(item.id);
29-
} else {
30-
const slugId = location.pathname.split('/').slice(-1)[0];
31-
return slugId === slugify(item.id);
3229
}
30+
const slugId = location.pathname.split('/').slice(-1)[0];
31+
return slugId === slugify(item.id);
3332
};
3433

3534
export default isItemActive;

0 commit comments

Comments
 (0)