Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Fix eslint errors/warnings #199
Conversation
|
Nice! Just few notes: |
| @@ -55,13 +55,13 @@ class Button extends React.Component { | |||
| 'mdl-button--accent': accent, | |||
| 'mdl-js-ripple-effect': ripple, | |||
| }, | |||
| className | |||
| className // eslint-disable-line comma-dangle | |||
frenzzy
Feb 2, 2017
Member
let's just use trailing comma here instead of comment
className,
let's just use trailing comma here instead of comment
className,| ), | ||
| to, | ||
| href, | ||
| ...other, | ||
| }, | ||
| children | ||
| children // eslint-disable-line comma-dangle |
frenzzy
Feb 2, 2017
Member
and here
children,
and here
children,| @@ -49,7 +49,7 @@ class Link extends React.Component { | |||
|
|
|||
| render() { | |||
| const { to, ...props } = this.props; // eslint-disable-line no-use-before-define | |||
| return <a href={typeof to === 'string' ? to : history.createHref(to)} {...props} onClick={this.handleClick} />; | |||
| return <a href={typeof to === 'string' ? to : history.createHref(to)} {...props} onClick={this.handleClick} />; // eslint-disable-line | |||
frenzzy
Feb 2, 2017
Member
Using of eslint-disable-line is not obvious what exactly rule you want to ignore. It is better to always specify rule name in comment:
let code; // eslint-disable-line rule-name
or
// eslint-disable-next-line rule-name
let loooooongLineOfCode;
if eslint here warns about max-len, let's split the code into two lines:
const href = typeof to === 'string' ? to : history.createHref(to);
return <a href={href} {...props} onClick={this.handleClick} />;
Using of eslint-disable-line is not obvious what exactly rule you want to ignore. It is better to always specify rule name in comment:
let code; // eslint-disable-line rule-nameor
// eslint-disable-next-line rule-name
let loooooongLineOfCode;if eslint here warns about max-len, let's split the code into two lines:
const href = typeof to === 'string' ? to : history.createHref(to);
return <a href={href} {...props} onClick={this.handleClick} />;| "import/no-extraneous-dependencies": "off" | ||
| }, | ||
| "env": { | ||
| "browser": true |
| @@ -16,7 +16,7 @@ import { title, html } from './index.md'; | |||
| class HomePage extends React.Component { | |||
|
|
|||
| static propTypes = { | |||
| articles: PropTypes.array.isRequired, | |||
| articles: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types | |||
frenzzy
Feb 2, 2017
Member
articles: PropTypes.arrayOf(PropTypes.shape({
url: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
author: PropTypes.string.isRequired,
}).isRequired).isRequired,
articles: PropTypes.arrayOf(PropTypes.shape({
url: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
author: PropTypes.string.isRequired,
}).isRequired).isRequired,| <h4>Articles</h4> | ||
| <ul> | ||
| {this.props.articles.map((article, i) => | ||
| <li key={i}><a href={article.url}>{article.title}</a> by {article.author}</li> | ||
| <li key={i}><a href={article.url}>{article.title}</a> by {article.author}</li> // eslint-disable-line |
frenzzy
Feb 2, 2017
Member
<li key={article.url}>
<li key={article.url}>| @@ -49,11 +49,11 @@ function matchURI(route, path) { | |||
| // Find the route matching the specified location (context), fetch the required data, | |||
| // instantiate and return a React component | |||
| function resolve(routes, context) { | |||
| for (const route of routes) { | |||
| for (const route of routes) { // eslint-disable-line | |||
frenzzy
Feb 2, 2017
Member
eslint-rule-name?
eslint-rule-name?
| const params = matchURI(route, context.error ? '/error' : context.pathname); | ||
|
|
||
| if (!params) { | ||
| continue; | ||
| continue; // eslint-disable-line |
frenzzy
Feb 2, 2017
Member
and here
and here
| @@ -38,7 +38,7 @@ module.exports = function routesLoader(source) { | |||
| const output = ['[\n']; | |||
| const routes = JSON.parse(source); | |||
|
|
|||
| for (const route of routes) { | |||
| for (const route of routes) { // eslint-disable-line | |||
frenzzy
Feb 2, 2017
Member
and here
and here
| @@ -60,7 +60,7 @@ module.exports = function routesLoader(source) { | |||
| if (route.data) { | |||
| output.push(` data: ${JSON.stringify(route.data)},\n`); | |||
| } | |||
| output.push(` load() {\n return ${require(route.page)};\n },\n`); | |||
| output.push(` load() {\n return ${require(route.page)};\n },\n`); // eslint-disable-line | |||
frenzzy
Feb 2, 2017
Member
what the problem here?
what the problem here?
frenzzy
mentioned this pull request
|
committed feedback points |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Fix all eslint warnings and errors.