The Wayback Machine - http://web.archive.org/web/20201209062821/https://github.com/kriasoft/react-firebase-starter/pull/199
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eslint errors/warnings #199

Merged
merged 2 commits into from Feb 13, 2017
Merged

Fix eslint errors/warnings #199

merged 2 commits into from Feb 13, 2017

Conversation

@rajpatel507
Copy link
Contributor

@rajpatel507 rajpatel507 commented Feb 2, 2017

Fix all eslint warnings and errors.

@frenzzy
frenzzy approved these changes Feb 2, 2017
Copy link
Member

@frenzzy frenzzy left a comment

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

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

let's just use trailing comma here instead of comment

className,
),
to,
href,
...other,
},
children
children // eslint-disable-line comma-dangle

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

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

This comment has been minimized.

@frenzzy

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} />;
"import/no-extraneous-dependencies": "off"
},
"env": {
"browser": true

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

need to remove two extra spaces here,
ident coding style for this project is 2 spaces

@@ -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

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

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

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

<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

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

eslint-rule-name?

const params = matchURI(route, context.error ? '/error' : context.pathname);

if (!params) {
continue;
continue; // eslint-disable-line

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

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

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

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

This comment has been minimized.

@frenzzy

frenzzy Feb 2, 2017
Member

what the problem here?

@frenzzy frenzzy mentioned this pull request Feb 2, 2017

Rajesh Kathiriya Rajesh Kathiriya
@rajpatel507
Copy link
Contributor Author

@rajpatel507 rajpatel507 commented Feb 6, 2017

committed feedback points

@koistya koistya merged commit 88341b3 into kriasoft:master Feb 13, 2017
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.