1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-18 03:11:19 +02:00

Merge pull request #12853 from twbs/jscs

Switch to JSCS
This commit is contained in:
XhmikosR
2014-03-05 08:42:50 +02:00
6 changed files with 39 additions and 37 deletions

View File

@@ -65,16 +65,19 @@ module.exports = function (grunt) {
config: 'js/.jscsrc' config: 'js/.jscsrc'
}, },
grunt: { grunt: {
src: ['Gruntfile.js', 'grunt/*.js'] options: {
'requireParenthesesAroundIIFE': true
},
src: '<%= jshint.grunt.src %>'
}, },
src: { src: {
src: 'js/*.js' src: '<%= jshint.src.src %>'
}, },
test: { test: {
src: 'js/tests/unit/*.js' src: '<%= jshint.test.src %>'
}, },
assets: { assets: {
src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js'] src: '<%= jshint.assets.src %>'
} }
}, },

View File

@@ -1,15 +1,10 @@
{ {
"camelcase": true, "curly" : true,
"curly": true,
"eqeqeq": true, "eqeqeq": true,
"immed": true,
"indent": 2,
"newcap": true, "newcap": true,
"noarg": true, "noarg" : true,
"node": true, "node" : true,
"nonbsp": true, "nonbsp": true,
"quotmark": "single",
"strict": true, "strict": true,
"trailing": true, "undef" : true
"undef": true
} }

View File

@@ -1,15 +1,22 @@
{ {
"disallowEmptyBlocks": true,
"disallowKeywords": ["with"], "disallowKeywords": ["with"],
"requireLeftStickedOperators": [","],
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"], "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLeftStickedOperators": [","],
"requireLineFeedAtFileEnd": true, "requireLineFeedAtFileEnd": true,
"requireRightStickedOperators": ["!"], "requireRightStickedOperators": ["!"],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"validateLineBreaks": "LF" "validateIndentation": 2,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'"
} }

View File

@@ -7,8 +7,6 @@
"eqeqeq" : false, "eqeqeq" : false,
"eqnull" : true, "eqnull" : true,
"expr" : true, "expr" : true,
"indent" : 2,
"laxbreak" : true, "laxbreak" : true,
"quotmark" : "single",
"validthis": true "validthis": true
} }

View File

@@ -273,8 +273,7 @@ $(function () {
test('should show tooltip with delegate selector on click', function () { test('should show tooltip with delegate selector on click', function () {
var div = $('<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>') var div = $('<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>')
var tooltip = div.appendTo('#qunit-fixture') var tooltip = div.appendTo('#qunit-fixture')
.tooltip({ selector: 'a[rel=tooltip]', .tooltip({ selector: 'a[rel=tooltip]', trigger: 'click' })
trigger: 'click' })
div.find('a').trigger('click') div.find('a').trigger('click')
ok($('.tooltip').is('.fade.in'), 'tooltip is faded in') ok($('.tooltip').is('.fade.in'), 'tooltip is faded in')
}) })