Skip to content

Commit

Permalink
Added fbjs eslint config, fixed lint errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Oct 9, 2017
1 parent 5a96b1d commit de3bd87
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"extends": [
"eslint:recommended",
"plugin:react/recommended"
"fbjs"
],
"plugins": [
"prettier",
"react"
],
"parser": "babel-eslint",
"rules": {
"relay/graphql-naming": 0,
"max-len": 0
},
"env": {
"node": true,
"browser": true
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
"array-from": "^2.1.1",
"babel-eslint": "^8.0.1",
"eslint": "^4.8.0",
"eslint-config-fbjs": "^2.0.0",
"eslint-config-react": "^1.1.7",
"eslint-plugin-flowtype": "^2.37.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-flowtype": "^2.39.1",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-relay": "^0.0.19",
"flow-bin": "^0.56.0",
"gatsby": "^1.9.9",
"gatsby-link": "^1.6.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ class StickyResponsiveSidebar extends Component {
boxShadow: '0 0 20px rgba(0, 0, 0, 0.3)',
[media.lessThan('small')]: smallScreenBottomBarStyles,
}}
onClick={this._openNavMenu}>
onClick={this._openNavMenu}
role="button"
tabIndex="-1">
<Container>
<div
css={{
Expand Down
2 changes: 1 addition & 1 deletion src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (process.env.NODE_ENV === `production`) {
try {
stylesStr = require(`!raw-loader!../public/styles.css`);
} catch (e) {
console.log(e);
console.error(e);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/templates/components/MetaTitle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const MetaTitle = ({
textTransform: 'uppercase',
letterSpacing: '0.08em',
...cssProps,
}}>
}}
role="link"
tabIndex="-1">
{children}
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/templates/components/Sidebar/Section.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

'use strict';

import React from 'react';
import {colors, media} from 'theme';
import isItemActive from 'utils/isItemActive';
import MetaTitle from '../MetaTitle';
Expand Down
5 changes: 2 additions & 3 deletions src/utils/isItemActive.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ const isItemActive = (location, item) => {
}
} else if (item.id.includes('html')) {
return location.pathname.includes(item.id);
} else {
const slugId = location.pathname.split('/').slice(-1)[0];
return slugId === slugify(item.id);
}
const slugId = location.pathname.split('/').slice(-1)[0];
return slugId === slugify(item.id);
};

export default isItemActive;

0 comments on commit de3bd87

Please sign in to comment.