mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-22 20:01:57 +00:00
Added fbjs eslint config, fixed lint errors and warnings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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={{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@ const MetaTitle = ({
|
||||
textTransform: 'uppercase',
|
||||
letterSpacing: '0.08em',
|
||||
...cssProps,
|
||||
}}>
|
||||
}}
|
||||
role="link"
|
||||
tabIndex="-1">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import {colors, media} from 'theme';
|
||||
import isItemActive from 'utils/isItemActive';
|
||||
import MetaTitle from '../MetaTitle';
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user