-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Refactor ESLint configuration. #21005
Conversation
Hound uses the config found in the Bootstrap repo, not the new config you want to give it |
I read a bit on HoundCi and I didn't found any options to lint differently JavaScript from But I don't understand why you said @bardiharborow ?
If we remove the PhantomJS Bridge nothing will change because of units tests will stay in ES5 and HoundJS will continue to warn us |
@Johann-S oh, that was just because I'm going to follow up with Hound and see if we can get Hound to use the recursive |
Have some conflicts here now. I'm unsure where this and #21003 lie, so @bardiharborow and @Johann-S, I defer to you two on what get's merged when :). Happy to chat more over Slack if it'd help btw. |
assert.expect(41) | ||
var $el = $('<button>Trigger</button>') | ||
.appendTo('#qunit-fixture') | ||
.bootstrapTooltip({ trigger: 'click hover focus', animation: false }) | ||
var tooltip = $el.data('bs.tooltip') | ||
var $tooltip = $(tooltip.getTipElement()) | ||
|
||
function showingTooltip() { return $tooltip.hasClass('active') || tooltip._hoverState == 'active' } | ||
function showingTooltip() { return $tooltip.hasClass('active') || tooltip._hoverState === 'active' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statement inside of curly braces should be on next line brace-style
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
@@ -608,7 +608,7 @@ $(function () { | |||
|
|||
var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') | |||
.appendTo('#qunit-fixture') | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 }}) | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
@@ -587,7 +587,7 @@ $(function () { | |||
|
|||
var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') | |||
.appendTo('#qunit-fixture') | |||
.bootstrapTooltip({ delay: { show: 150, hide: 0 }}) | |||
.bootstrapTooltip({ delay: { show: 150, hide: 0 } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
@@ -540,7 +540,7 @@ $(function () { | |||
|
|||
var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') | |||
.appendTo('#qunit-fixture') | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 }}) | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
@@ -382,7 +382,7 @@ $(function () { | |||
var $tooltip = $($target.data('bs.tooltip').tip) | |||
|
|||
// this is some dumb hack stuff because sub pixels in firefox | |||
var top = Math.round($target.offset().top + ($target[0].offsetHeight / 2) - ($tooltip[0].offsetHeight / 2)) | |||
var top = Math.round($target.offset().top + $target[0].offsetHeight / 2 - $tooltip[0].offsetHeight / 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All 'var' declarations must be at the top of the function scope vars-on-top
Unexpected var, use let or const instead no-var
No magic number: 2 no-magic-numbers
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) | ||
else if (type === 'data') $(window).trigger('load') | ||
if (type === 'js') { $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) } | ||
else if (type === 'data') { $(window).trigger('load') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing curly brace does not appear on the same line as the subsequent block brace-style
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Statement inside of curly braces should be on next line brace-style
@@ -399,8 +402,8 @@ $(function () { | |||
$navbar.appendTo('#qunit-fixture') | |||
$content.appendTo('#qunit-fixture') | |||
|
|||
if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) | |||
else if (type === 'data') $(window).trigger('load') | |||
if (type === 'js') { $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Statement inside of curly braces should be on next line brace-style
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
!function testActiveElements() { | ||
if (++times > 3) return done() | ||
function testActiveElements() { | ||
if (++times > 3) { return done() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No magic number: 3 no-magic-numbers
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Statement inside of curly braces should be on next line brace-style
@@ -231,8 +231,8 @@ $(function () { | |||
.appendTo('#qunit-fixture') | |||
.bootstrapScrollspy({ offset: 0, target: '#navigation' }) | |||
|
|||
!function testActiveElements() { | |||
if (++times > 3) return done() | |||
function testActiveElements() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of this function consistent-return
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -7,7 +7,7 @@ | |||
*/ | |||
|
|||
(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
EDIT : |
@mdo, we're good to go here. Travis is green. :) |
@@ -608,7 +608,7 @@ $(function () { | |||
|
|||
var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') | |||
.appendTo('#qunit-fixture') | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 }}) | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
@@ -540,7 +540,7 @@ $(function () { | |||
|
|||
var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') | |||
.appendTo('#qunit-fixture') | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 }}) | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
@@ -540,7 +540,7 @@ $(function () { | |||
|
|||
var $tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"/>') | |||
.appendTo('#qunit-fixture') | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 }}) | |||
.bootstrapTooltip({ delay: { show: 0, hide: 150 } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
@@ -382,7 +382,7 @@ $(function () { | |||
var $tooltip = $($target.data('bs.tooltip').tip) | |||
|
|||
// this is some dumb hack stuff because sub pixels in firefox | |||
var top = Math.round($target.offset().top + ($target[0].offsetHeight / 2) - ($tooltip[0].offsetHeight / 2)) | |||
var top = Math.round($target.offset().top + $target[0].offsetHeight / 2 - $tooltip[0].offsetHeight / 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All 'var' declarations must be at the top of the function scope vars-on-top
Unexpected var, use let or const instead no-var
No magic number: 2 no-magic-numbers
@@ -382,7 +382,7 @@ $(function () { | |||
var $tooltip = $($target.data('bs.tooltip').tip) | |||
|
|||
// this is some dumb hack stuff because sub pixels in firefox | |||
var top = Math.round($target.offset().top + ($target[0].offsetHeight / 2) - ($tooltip[0].offsetHeight / 2)) | |||
var top = Math.round($target.offset().top + $target[0].offsetHeight / 2 - $tooltip[0].offsetHeight / 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All 'var' declarations must be at the top of the function scope vars-on-top
Unexpected var, use let or const instead no-var
No magic number: 2 no-magic-numbers
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) | ||
else if (type === 'data') $(window).trigger('load') | ||
if (type === 'js') { $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) } | ||
else if (type === 'data') { $(window).trigger('load') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing curly brace does not appear on the same line as the subsequent block brace-style
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Statement inside of curly braces should be on next line brace-style
if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) | ||
else if (type === 'data') $(window).trigger('load') | ||
if (type === 'js') { $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) } | ||
else if (type === 'data') { $(window).trigger('load') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing curly brace does not appear on the same line as the subsequent block brace-style
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Statement inside of curly braces should be on next line brace-style
@@ -399,8 +401,8 @@ $(function () { | |||
$navbar.appendTo('#qunit-fixture') | |||
$content.appendTo('#qunit-fixture') | |||
|
|||
if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) | |||
else if (type === 'data') $(window).trigger('load') | |||
if (type === 'js') { $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Statement inside of curly braces should be on next line brace-style
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
@@ -399,8 +401,8 @@ $(function () { | |||
$navbar.appendTo('#qunit-fixture') | |||
$content.appendTo('#qunit-fixture') | |||
|
|||
if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) | |||
else if (type === 'data') $(window).trigger('load') | |||
if (type === 'js') { $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Statement inside of curly braces should be on next line brace-style
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Expected a line break after this opening brace object-curly-newline
Object properties must go on a new line object-property-newline
Expected a line break before this closing brace object-curly-newline
!function testActiveElements() { | ||
if (++times > 3) return done() | ||
function testActiveElements() { | ||
if (++times > 3) { return done() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No magic number: 3 no-magic-numbers
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Statement inside of curly braces should be on next line brace-style
!function testActiveElements() { | ||
if (++times > 3) return done() | ||
function testActiveElements() { | ||
if (++times > 3) { return done() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No magic number: 3 no-magic-numbers
This line has 2 statements. Maximum allowed is 1 max-statements-per-line
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
Statement inside of curly braces should be on next line brace-style
@@ -231,8 +231,8 @@ $(function () { | |||
.appendTo('#qunit-fixture') | |||
.bootstrapScrollspy({ offset: 0, target: '#navigation' }) | |||
|
|||
!function testActiveElements() { | |||
if (++times > 3) return done() | |||
function testActiveElements() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of this function consistent-return
@@ -231,8 +231,8 @@ $(function () { | |||
.appendTo('#qunit-fixture') | |||
.bootstrapScrollspy({ offset: 0, target: '#navigation' }) | |||
|
|||
!function testActiveElements() { | |||
if (++times > 3) return done() | |||
function testActiveElements() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of this function consistent-return
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -7,7 +7,7 @@ | |||
*/ | |||
|
|||
(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -7,7 +7,7 @@ | |||
*/ | |||
|
|||
(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
@@ -1,5 +1,5 @@ | |||
$(function () { | |||
'use strict'; | |||
'use strict' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'use strict' is unnecessary inside of modules strict
Had a small conflict from merging #17642, but I think I fixed it right up. Merged! Thanks so much <3. |
In lieu of an official style guide, this takes the
eslint:recommended
preset, and then enables every ESLint rule that does not cause significant disruption to the codebase. It then disables the rules needed forjs/tests
to pass, as that follows a slightly different style. We may wish to tighten quite a bit of this later, but it's better than what we currently have.This is one half of the fix for #20466, the other half being houndci/hound#889. This works towards #20740, but I suspect there is more to do, noting especially that ESLint does not cover all folders yet, as per #17924.