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

Switch to JSCS #12853

Merged
merged 8 commits into from
Mar 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,19 @@ module.exports = function (grunt) {
config: 'js/.jscsrc'
},
grunt: {
src: ['Gruntfile.js', 'grunt/*.js']
options: {
'requireParenthesesAroundIIFE': true
},
src: '<%= jshint.grunt.src %>'
},
src: {
src: 'js/*.js'
src: '<%= jshint.src.src %>'
},
test: {
src: 'js/tests/unit/*.js'
src: '<%= jshint.test.src %>'
},
assets: {
src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
src: '<%= jshint.assets.src %>'
}
},

Expand Down
12 changes: 6 additions & 6 deletions docs/assets/js/customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ window.onload = function () { // wait for load in a dumb way because B-0
var vars = {}

$('#less-variables-section input')
.each(function () {
$(this).val() && (vars[$(this).prev().text()] = $(this).val())
})
.each(function () {
$(this).val() && (vars[$(this).prev().text()] = $(this).val())
})

var data = {
vars: vars,
Expand Down Expand Up @@ -238,9 +238,9 @@ window.onload = function () { // wait for load in a dumb way because B-0
var vars = {}

$('#less-variables-section input')
.each(function () {
$(this).val() && (vars[$(this).prev().text()] = $(this).val())
})
.each(function () {
$(this).val() && (vars[$(this).prev().text()] = $(this).val())
})

var bsLessSource = generateLESS('bootstrap.less', lessFileIncludes, vars)
var themeLessSource = generateLESS('theme.less', lessFileIncludes, vars)
Expand Down
13 changes: 4 additions & 9 deletions grunt/.jshintrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
"camelcase": true,
"curly": true,
"curly" : true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"newcap": true,
"noarg": true,
"node": true,
"noarg" : true,
"node" : true,
"nonbsp": true,
"quotmark": "single",
"strict": true,
"trailing": true,
"undef": true
"undef" : true
}
11 changes: 9 additions & 2 deletions js/.jscsrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{
"disallowEmptyBlocks": true,
"disallowKeywords": ["with"],
"requireLeftStickedOperators": [","],
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLeftStickedOperators": [","],
"requireLineFeedAtFileEnd": true,
"requireRightStickedOperators": ["!"],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"validateLineBreaks": "LF"
"validateIndentation": 2,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'"
}
4 changes: 1 addition & 3 deletions js/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"eqeqeq" : false,
"eqnull" : true,
"expr" : true,
"indent" : 2,
"laxbreak" : true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going away in JSHint 3: jscs-dev/node-jscs#102

"quotmark" : "single",
"validthis": true
}
}
25 changes: 12 additions & 13 deletions js/tests/unit/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ $(function () {
test('should show tooltip with delegate selector on click', function () {
var div = $('<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>')
var tooltip = div.appendTo('#qunit-fixture')
.tooltip({ selector: 'a[rel=tooltip]',
trigger: 'click' })
.tooltip({ selector: 'a[rel=tooltip]', trigger: 'click' })
div.find('a').trigger('click')
ok($('.tooltip').is('.fade.in'), 'tooltip is faded in')
})
Expand Down Expand Up @@ -392,21 +391,21 @@ $(function () {
test('tooltips should be placed dynamically, with the dynamic placement option', function () {
$.support.transition = false
var ttContainer = $('<div id="dynamic-tt-test"/>').css({
'height' : 400,
'overflow' : 'hidden',
'position' : 'absolute',
'top' : 0,
'left' : 0,
'width' : 600
})
.appendTo('body')
'height' : 400,
'overflow' : 'hidden',
'position' : 'absolute',
'top' : 0,
'left' : 0,
'width' : 600
})
.appendTo('body')

var topTooltip = $('<div style="display: inline-block; position: absolute; left: 0; top: 0;" rel="tooltip" title="Top tooltip">Top Dynamic Tooltip</div>')
.appendTo('#dynamic-tt-test')
.tooltip({placement: 'auto'})
.tooltip('show')

ok($('.tooltip').is('.bottom'), 'top positioned tooltip is dynamically positioned bottom')
ok($('.tooltip').is('.bottom'), 'top positioned tooltip is dynamically positioned bottom')

topTooltip.tooltip('hide')

Expand All @@ -415,15 +414,15 @@ $(function () {
.tooltip({placement: 'right auto'})
.tooltip('show')

ok($('.tooltip').is('.left'), 'right positioned tooltip is dynamically positioned left')
ok($('.tooltip').is('.left'), 'right positioned tooltip is dynamically positioned left')
rightTooltip.tooltip('hide')

var leftTooltip = $('<div style="display: inline-block; position: absolute; left: 0;" rel="tooltip" title="Left tooltip">Left Dynamic Tooltip</div>')
.appendTo('#dynamic-tt-test')
.tooltip({placement: 'auto left'})
.tooltip('show')

ok($('.tooltip').is('.right'), 'left positioned tooltip is dynamically positioned right')
ok($('.tooltip').is('.right'), 'left positioned tooltip is dynamically positioned right')
leftTooltip.tooltip('hide')

ttContainer.remove()
Expand Down