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

Missing space after return keyword #13512

Closed
feryardiant opened this issue May 5, 2014 · 19 comments
Closed

Missing space after return keyword #13512

feryardiant opened this issue May 5, 2014 · 19 comments

Comments

@feryardiant
Copy link

Hi! I'm just clone it and installing all dependencies, everythings goes fine until the build process. When I run grunt command, I got this output:

feryardiant in .../localhost/local/twbs-bootstrap on new-branch
→ grunt
Running "less:compileCore" (less) task
File dist/css/bootstrap.css.map created.
File dist/css/bootstrap.css created: 129.12 kB → 129.16 kB

Running "less:compileTheme" (less) task
File dist/css/bootstrap-theme.css.map created.
File dist/css/bootstrap-theme.css created: 16.58 kB → 16.63 kB

Running "autoprefixer:core" (autoprefixer) task
File dist/css/bootstrap.css created.
File dist/css/bootstrap.css.map created (source map).

Running "autoprefixer:theme" (autoprefixer) task
File dist/css/bootstrap-theme.css created.
File dist/css/bootstrap-theme.css.map created (source map).

Running "autoprefixer:docs" (autoprefixer) task
File docs/assets/css/_src/docs.css created.

Running "autoprefixer:examples" (autoprefixer) task
File docs/examples/blog/blog.css created.
File docs/examples/carousel/carousel.css created.
File docs/examples/cover/cover.css created.
File docs/examples/dashboard/dashboard.css created.
File docs/examples/equal-height-columns/equal-height-columns.css created.
File docs/examples/grid/grid.css created.
File docs/examples/jumbotron-narrow/jumbotron-narrow.css created.
File docs/examples/jumbotron/jumbotron.css created.
File docs/examples/justified-nav/justified-nav.css created.
File docs/examples/navbar-fixed-top/navbar-fixed-top.css created.
File docs/examples/navbar-static-top/navbar-static-top.css created.
File docs/examples/navbar/navbar.css created.
File docs/examples/non-responsive/non-responsive.css created.
File docs/examples/offcanvas/offcanvas.css created.
File docs/examples/rtl/rtl.css created.
File docs/examples/signin/signin.css created.
File docs/examples/starter-template/starter-template.css created.
File docs/examples/sticky-footer-navbar/sticky-footer-navbar.css created.
File docs/examples/sticky-footer/sticky-footer.css created.
File docs/examples/theme/theme.css created.
File docs/examples/tooltip-viewport/tooltip-viewport.css created.

Running "cssflip:rtl" (cssflip) task
File "dist/css/bootstrap-rtl.css" created.

Running "usebanner:files" (usebanner) task
✔ grunt-banner completed successfully

Running "csscomb:dist" (csscomb) task
>> Using custom config file "less/.csscomb.json"...
>> Sorting file "dist/css/bootstrap-rtl.css"...
>> Sorting file "dist/css/bootstrap-theme.css"...
>> Sorting file "dist/css/bootstrap.css"...

Running "csscomb:examples" (csscomb) task
>> Using custom config file "less/.csscomb.json"...
>> Sorting file "docs/examples/blog/blog.css"...
>> Sorting file "docs/examples/carousel/carousel.css"...
>> Sorting file "docs/examples/cover/cover.css"...
>> Sorting file "docs/examples/dashboard/dashboard.css"...
>> Sorting file "docs/examples/equal-height-columns/equal-height-columns.css"...
>> Sorting file "docs/examples/grid/grid.css"...
>> Sorting file "docs/examples/jumbotron-narrow/jumbotron-narrow.css"...
>> Sorting file "docs/examples/jumbotron/jumbotron.css"...
>> Sorting file "docs/examples/justified-nav/justified-nav.css"...
>> Sorting file "docs/examples/navbar-fixed-top/navbar-fixed-top.css"...
>> Sorting file "docs/examples/navbar-static-top/navbar-static-top.css"...
>> Sorting file "docs/examples/navbar/navbar.css"...
>> Sorting file "docs/examples/non-responsive/non-responsive.css"...
>> Sorting file "docs/examples/offcanvas/offcanvas.css"...
>> Sorting file "docs/examples/rtl/rtl.css"...
>> Sorting file "docs/examples/signin/signin.css"...
>> Sorting file "docs/examples/starter-template/starter-template.css"...
>> Sorting file "docs/examples/sticky-footer-navbar/sticky-footer-navbar.css"...
>> Sorting file "docs/examples/sticky-footer/sticky-footer.css"...
>> Sorting file "docs/examples/theme/theme.css"...
>> Sorting file "docs/examples/tooltip-viewport/tooltip-viewport.css"...

Running "csscomb:docs" (csscomb) task
>> Using custom config file "less/.csscomb.json"...
>> Sorting file "docs/assets/css/_src/docs.css"...

Running "less:minify" (less) task
File dist/css/bootstrap.min.css created: 129.95 kB → 107.58 kB
File dist/css/bootstrap-rtl.min.css created: 130.08 kB → 107.71 kB
File dist/css/bootstrap-theme.min.css created: 19.7 kB → 17.75 kB

Running "cssmin:docs" (cssmin) task
File docs/assets/css/docs.min.css created: 31.18 kB → 20.1 kB

Running "csslint:src" (csslint) task
>> 2 files lint free.

Running "csslint:examples" (csslint) task
>> 21 files lint free.

Running "csslint:docs" (csslint) task
>> 1 file lint free.

Running "jshint:grunt" (jshint) task
>> 5 files lint free.

Running "jshint:src" (jshint) task
>> 12 files lint free.

Running "jshint:test" (jshint) task
>> 12 files lint free.

Running "jshint:assets" (jshint) task
>> 5 files lint free.

Running "jscs:grunt" (jscs) task
>> 5 files without code style errors.

Running "jscs:src" (jscs) task
Missing space after `return` keyword at js/affix.js :
    49 |    if (!this.$element.is(':visible')) return
    50 |
    51 |    var scrollHeight = $(document).height()
------------^
    52 |    var scrollTop    = this.$window.scrollTop()
    53 |    var position     = this.$element.offset()
Missing space after `return` keyword at js/affix.js :
    65 |
    66 |    if (this.affixed === affix) return
    67 |    if (this.unpin != null) this.$element.css('top', '')
------------^
    68 |
    69 |    var affixType = 'affix' + (affix ? '-' + affix : '')
Missing space after `return` keyword at js/affix.js :
    74 |    if (e.isDefaultPrevented()) return
    75 |
    76 |    this.affixed = affix
------------^
    77 |    this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
    78 |
Missing space after `return` keyword at js/alert.js :
    40 |    if (e.isDefaultPrevented()) return
    41 |
    42 |    $parent.removeClass('in')
------------^
    43 |
    44 |    function removeElement() {
Missing space after `return` keyword at js/carousel.js :
    60 |    if (pos > (this.$items.length - 1) || pos < 0) return
    61 |
    62 |    if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
------------^
    63 |    if (activeIndex == pos) return this.pause().cycle()
    64 |
Missing space after `return` keyword at js/carousel.js :
    81 |  Carousel.prototype.next = function () {
    82 |    if (this.sliding) return
    83 |    return this.slide('next')
------------^
    84 |  }
    85 |
Missing space after `return` keyword at js/carousel.js :
    86 |  Carousel.prototype.prev = function () {
    87 |    if (this.sliding) return
    88 |    return this.slide('prev')
------------^
    89 |  }
    90 |
Missing space after `return` keyword at js/carousel.js :
    99 |    if (!$next.length) {
   100 |      if (!this.options.wrap) return
   101 |      $next = this.$element.find('.item')[fallback]()
--------------^
   102 |    }
   103 |
Missing space after `return` keyword at js/carousel.js :
   109 |    if (slideEvent.isDefaultPrevented()) return
   110 |
   111 |    this.sliding = true
------------^
   112 |
   113 |    isCycling && this.pause()
Missing space after `return` keyword at js/collapse.js :
    35 |    if (this.transitioning || this.$element.hasClass('in')) return
    36 |
    37 |    var startEvent = $.Event('show.bs.collapse')
------------^
    38 |    this.$element.trigger(startEvent)
    39 |    if (startEvent.isDefaultPrevented()) return
Missing space after `return` keyword at js/collapse.js :
    39 |    if (startEvent.isDefaultPrevented()) return
    40 |
    41 |    var actives = this.$parent && this.$parent.find('> .panel > .in')
------------^
    42 |
    43 |    if (actives && actives.length) {
Missing space after `return` keyword at js/collapse.js :
    44 |      var hasData = actives.data('bs.collapse')
    45 |      if (hasData && hasData.transitioning) return
    46 |      Plugin.call(actives, 'hide')
--------------^
    47 |      hasData || actives.data('bs.collapse', null)
    48 |    }
Missing space after `return` keyword at js/collapse.js :
    61 |          .one($.support.transition.end, $.proxy(complete, this))
    62 |        return
    63 |      }
--------------^
    64 |      this.$element
    65 |        .removeClass('collapsing')
Missing space after `return` keyword at js/collapse.js :
    83 |    if (this.transitioning || !this.$element.hasClass('in')) return
    84 |
    85 |    var startEvent = $.Event('hide.bs.collapse')
------------^
    86 |    this.$element.trigger(startEvent)
    87 |    if (startEvent.isDefaultPrevented()) return
Missing space after `return` keyword at js/collapse.js :
    87 |    if (startEvent.isDefaultPrevented()) return
    88 |
    89 |    var dimension = this.dimension()
------------^
    90 |
    91 |    this.$element[dimension](this.$element[dimension]())[0].offsetHeight
Missing space after `return` keyword at js/collapse.js :
   103 |          .one($.support.transition.end, $.proxy(complete, this))
   104 |        return
   105 |      }
--------------^
   106 |      this.transitioning = 0
   107 |      this.$element
Missing space after `return` keyword at js/dropdown.js :
    25 |    if ($this.is('.disabled, :disabled')) return
    26 |
    27 |    var $parent  = getParent($this)
------------^
    28 |    var isActive = $parent.hasClass('open')
    29 |
Missing space after `return` keyword at js/dropdown.js :
    41 |      if (e.isDefaultPrevented()) return
    42 |
    43 |      $this.trigger('focus')
--------------^
    44 |
    45 |      $parent
Missing space after `return` keyword at js/dropdown.js :
    54 |    if (!/(38|40|27)/.test(e.keyCode)) return
    55 |
    56 |    var $this = $(this)
------------^
    57 |
    58 |    e.preventDefault()
Missing space after `return` keyword at js/dropdown.js :
    61 |    if ($this.is('.disabled, :disabled')) return
    62 |
    63 |    var $parent  = getParent($this)
------------^
    64 |    var isActive = $parent.hasClass('open')
    65 |
Missing space after `return` keyword at js/dropdown.js :
    74 |    if (!$items.length) return
    75 |
    76 |    var index = $items.index($items.filter(':focus'))
------------^
    77 |
    78 |    if (e.keyCode == 38 && index > 0)                 index--                        // up
Missing space after `return` keyword at js/dropdown.js :
    85 |  function clearMenus(e) {
    86 |    if (e && e.which === 3) return
    87 |    $(backdrop).remove()
------------^
    88 |    $(toggle).each(function () {
    89 |      var $parent = getParent($(this))
Missing space after `return` keyword at js/dropdown.js :
    90 |      var relatedTarget = { relatedTarget: this }
    91 |      if (!$parent.hasClass('open')) return
    92 |      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
--------------^
    93 |      if (e.isDefaultPrevented()) return
    94 |      $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
Missing space after `return` keyword at js/dropdown.js :
    92 |      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
    93 |      if (e.isDefaultPrevented()) return
    94 |      $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
--------------^
    95 |    })
    96 |  }
Missing space after `return` keyword at js/modal.js :
    49 |    if (this.isShown || e.isDefaultPrevented()) return
    50 |
    51 |    this.isShown = true
------------^
    52 |
    53 |    this.checkScrollbar()
Missing space after `return` keyword at js/modal.js :
   101 |    if (!this.isShown || e.isDefaultPrevented()) return
   102 |
   103 |    this.isShown = false
------------^
   104 |
   105 |    this.$body.removeClass('modal-open')
Missing space after `return` keyword at js/modal.js :
   167 |      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
   168 |        if (e.target !== e.currentTarget) return
   169 |        this.options.backdrop == 'static'
----------------^
   170 |          ? this.$element[0].focus.call(this.$element[0])
   171 |          : this.hide.call(this)
Missing space after `return` keyword at js/modal.js :
   178 |      if (!callback) return
   179 |
   180 |      doAnimate ?
--------------^
   181 |        this.$backdrop
   182 |          .one($.support.transition.end, callback)
Missing space after `return` keyword at js/modal.js :
   204 |  Modal.prototype.checkScrollbar = function () {
   205 |    if (document.body.clientWidth >= window.innerWidth) return
   206 |    this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
------------^
   207 |  }
   208 |
Missing space after `return` keyword at js/popover.js :
    90 |
    91 |      if (!data && option == 'destroy') return
    92 |      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
--------------^
    93 |      if (typeof option == 'string') data[option]()
    94 |    })
Missing space after `return` keyword at js/tab.js :
    30 |    if ($this.parent('li').hasClass('active')) return
    31 |
    32 |    var previous = $ul.find('.active:last a')[0]
------------^
    33 |    var e        = $.Event('show.bs.tab', {
    34 |      relatedTarget: previous
Missing space after `return` keyword at js/tab.js :
    39 |    if (e.isDefaultPrevented()) return
    40 |
    41 |    var $target = $(selector)
------------^
    42 |
    43 |    this.activate($this.parent('li'), $ul)
Missing space after `return` keyword at js/tooltip.js :
   145 |
   146 |      if (e.isDefaultPrevented()) return
   147 |      var that = this;
--------------^
   148 |
   149 |      var $tip = this.tip()
Missing space after `return` keyword at js/tooltip.js :
   281 |    if (e.isDefaultPrevented()) return
   282 |
   283 |    $tip.removeClass('in')
------------^
   284 |
   285 |    $.support.transition && this.$tip.hasClass('fade') ?
Missing space after `return` keyword at js/tooltip.js :
   420 |
   421 |      if (!data && option == 'destroy') return
   422 |      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
--------------^
   423 |      if (typeof option == 'string') data[option]()
   424 |    })
>> 35 code style errors found!
Warning: Task "jscs:src" failed. Use --force to continue.

Aborted due to warnings.


Execution Time (2014-05-05 16:12:13 UTC)
less:compileCore        1.7s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 16%
less:compileTheme      154ms  ▇▇▇ 1%
autoprefixer:core      863ms  ▇▇▇▇▇▇▇▇▇▇▇▇ 8%
autoprefixer:theme     171ms  ▇▇▇ 2%
autoprefixer:docs      126ms  ▇▇ 1%
autoprefixer:examples  289ms  ▇▇▇▇ 3%
csscomb:dist            2.9s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 27%
csscomb:examples       309ms  ▇▇▇▇▇ 3%
csscomb:docs           194ms  ▇▇▇ 2%
less:minify            789ms  ▇▇▇▇▇▇▇▇▇▇▇ 7%
csslint:src            532ms  ▇▇▇▇▇▇▇▇ 5%
jshint:grunt           211ms  ▇▇▇ 2%
jshint:src             764ms  ▇▇▇▇▇▇▇▇▇▇▇ 7%
jshint:test            766ms  ▇▇▇▇▇▇▇▇▇▇▇ 7%
jshint:assets          177ms  ▇▇▇ 2%
jscs:grunt             321ms  ▇▇▇▇▇ 3%
jscs:src               185ms  ▇▇▇ 2%
Total 10.8s

Anyone have solution for this? Or is there something wrong with my clone?

EDIT:
I'm running npm v1.4.9 on Ubuntu 14.04 64bit

Thanks and best regards

@feryardiant
Copy link
Author

I have no errors when running grunt dist. I wondering is that errors come from grunt-jscs-checker? or something?

@hnrch02
Copy link
Collaborator

hnrch02 commented May 5, 2014

grunt dist doesn't report any errors because it doesn't include the test tasks. grunt jscs:src is the origin. I can't reproduce your problem though, do you work with JSCS somewhere else?

@hnrch02
Copy link
Collaborator

hnrch02 commented May 5, 2014

Ah, ignore my previous question. This rule seems to be the cause, which OS are you using?

@feryardiant
Copy link
Author

Ubuntu 14.04 64bit

@feryardiant
Copy link
Author

Yes, you're right. I'd try to remove 'return' from line 19, and it's works. Thanks.

@hnrch02
Copy link
Collaborator

hnrch02 commented May 5, 2014

Could you post the result of npm ls jscs?

@hnrch02
Copy link
Collaborator

hnrch02 commented May 5, 2014

Filed an upstream bug report with JSCS: jscs-dev/node-jscs#357

@feryardiant
Copy link
Author

This my npm ls jscs output:

[email protected] /media/feryardiant/Data/localhost/local/twbs-bootstrap
└─┬ [email protected]
  └── [email protected]

@feryardiant
Copy link
Author

Ah sorry, I was upgrade it manualy by editing package.json file then running npm update. That's because I guess it was about version bugs, or something. Just try out.. hehehe

@feryardiant
Copy link
Author

Btw, now I facing new error and it seem the less:compileCore task is not working after validate-html is executed

screenshot from 2014-05-06 01 04 11

@hnrch02
Copy link
Collaborator

hnrch02 commented May 5, 2014

Please try this with a clean and up-to-date clone of this repo and see if the bug persists. If that's not the case and you need help with your customized code, please refer to platforms like StackOverflow, as we cannot provide support for issues regarding custom implementations.

@mdo mdo added this to the v3.2.0 milestone May 5, 2014
@feryardiant
Copy link
Author

Yes, I'll try to update my clone but I'm not customize anything. I'd just clone and build it.

@cvrebert
Copy link
Collaborator

cvrebert commented May 5, 2014

Confirmed.

@cvrebert
Copy link
Collaborator

cvrebert commented May 5, 2014

Addressed by b100e15 & 5728b57: https://travis-ci.org/twbs/bootstrap/jobs/24478209
We can un-lock the grunt-jscs-checker version once there's a proper upstream fix for jscs-dev/node-jscs#357.

@cvrebert cvrebert closed this as completed May 5, 2014
@hnrch02
Copy link
Collaborator

hnrch02 commented May 5, 2014

The issue appeared with [email protected], 0.4.1 works fine for me.

@cvrebert
Copy link
Collaborator

cvrebert commented May 6, 2014

Fixed upstream in node-jscs v1.4.2

@hnrch02
Copy link
Collaborator

hnrch02 commented May 7, 2014

[email protected] using [email protected] was released, so you can unlock it now.

@cvrebert
Copy link
Collaborator

cvrebert commented May 7, 2014

@hnrch02 Done in #13528.

@Tjoosten
Copy link

done?

@twbs twbs locked and limited conversation to collaborators Jul 24, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants