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

Update dependencies #47

Merged
merged 1 commit into from Sep 27, 2016
Merged

Update dependencies #47

merged 1 commit into from Sep 27, 2016

Conversation

@frenzzy
Copy link
Member

frenzzy commented Sep 27, 2016

node v6+

Note: If you're using the router with Node v5 and below, import it as follows:

import { resolve } from 'universal-router/legacy';
@coveralls

This comment has been minimized.

Copy link

coveralls commented Sep 27, 2016

Coverage Status

Coverage remained the same at 88.406% when pulling ea1577e on frenzzy:update-dependencies into 7a58b09 on kriasoft:master.

@koistya koistya merged commit e3c51de into kriasoft:master Sep 27, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 88.406%
Details
@frenzzy frenzzy deleted the frenzzy:update-dependencies branch Sep 27, 2016
@@ -47,7 +47,7 @@ function matchPathBase(end, routePath, urlPath) {
const params = Object.create(null);
const path = m[0];

for (let i = 1; i < m.length; i++) {
for (let i = 1; i < m.length; i += 1) {

This comment has been minimized.

Copy link
@everdimension

everdimension Oct 22, 2016

oO but what for? )

This comment has been minimized.

Copy link
@frenzzy

frenzzy Oct 22, 2016

Author Member

From Airbnb JavaScript Style Guide:

  • 13.6 Avoid using unary increments and decrements (++, --). eslint no-plusplus

    Why? Per the eslint documentation, unary increment and decrement statements are subject to automatic semicolon insertion and can cause silent errors with incrementing or decrementing values within an application. It is also more expressive to mutate your values with statements like num += 1 instead of num ++. Disallowing unary increment and decrement statements also prevents you from pre-incrementing/pre-decrementing values unintentionally which can also cause unexpected behavior in your programs.

This comment has been minimized.

Copy link
@everdimension

everdimension Oct 22, 2016

Well, Airbnb styleguide prescribes avoiding for-loops altogether:
https://github.com/airbnb/javascript#iterators--nope

Using addition assignment here looks strange to say the least.

This comment has been minimized.

Copy link
@frenzzy

frenzzy Oct 23, 2016

Author Member

What do you suggest?

This comment has been minimized.

Copy link
@everdimension

everdimension Oct 24, 2016

Actually I would suggest using canonical for-loop syntax with i++. Eslint even has a special case for allowing unary operators in the for-loops.

But if you want to conform to airbnb styleguide, then a simple .forEach method will look even cleaner: #65

This comment has been minimized.

Copy link
@frenzzy

frenzzy Oct 24, 2016

Author Member

I think allowForLoopAfterthoughts: true is a good suggestion, maybe create a PR to AirBnb style guide then?

And just curious, do you know how to rewire such code with .forEach?

function* matchRoute(/* ... */) {
  for (let i = 0; i < length; i++) {
    yield* matchRoute(/* ... */);
  }
}

This comment has been minimized.

Copy link
@frenzzy

This comment has been minimized.

Copy link
@everdimension

everdimension Oct 31, 2016

Yea, since they don't allow generators in their style guide either, I wouldn't expect them to include a rule for a for-loop.
I guess this just might be the appropriate place for adapting the lint config to your specific project, since you're already relying on features that the airbnb's styleguide doesn't cover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.