Skip to content

Commit 5ccffd2

Browse files
committed
eslint settings fixed
1 parent c35b483 commit 5ccffd2

6 files changed

+254
-98
lines changed

.eslintrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true
5+
},
6+
extends: 'eslint:recommended',
7+
globals: {
8+
Atomics: 'readonly',
9+
SharedArrayBuffer: 'readonly'
10+
},
11+
parserOptions: {
12+
ecmaVersion: 2018,
13+
sourceType: 'module'
14+
},
15+
rules: {
16+
indent: ['error', 'tab'],
17+
quotes: ['error', 'single'],
18+
semi: ['error', 'always']
19+
}
20+
};

.eslintrc.json

-7
This file was deleted.

.prettierrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
printWidth : 80,
33
useTabs : true,
44
semi : true,
5-
tabWidth : 2,
5+
tabWidth : 4,
66
singleQuote : true,
77
trailingComma : 'none',
88
bracketSpacing : true,

js/bootstrap-fullscreen-select.js

+19-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
if (typeof jQuery === 'undefined') {
13-
throw new Error("Mobileselect' requires jQuery");
13+
throw new Error('Mobileselect requires jQuery');
1414
}
1515

1616
(function($) {
@@ -70,7 +70,9 @@ if (typeof jQuery === 'undefined') {
7070
//reject non SELECT elements
7171
if ($elm[0].tagName !== 'SELECT') {
7272
console.warn(
73-
'Sorry, cannot initialized a ' + $elm[0].tagName + ' element'
73+
'Sorry, cannot initialized a ' +
74+
$elm[0].tagName +
75+
' element'
7476
);
7577
return true;
7678
// continue;
@@ -143,7 +145,8 @@ if (typeof jQuery === 'undefined') {
143145
this.$c
144146
.children('div')
145147
.css({
146-
'-webkit-transition': 'all ' + this.animationSpeed / 1000 + 's',
148+
'-webkit-transition':
149+
'all ' + this.animationSpeed / 1000 + 's',
147150
transition: 'all ' + this.animationSpeed / 1000 + 's'
148151
})
149152
.css(this.padding)
@@ -180,19 +183,24 @@ if (typeof jQuery === 'undefined') {
180183
this.$listcontainer.html('');
181184
var that = this;
182185
var prevGroup = '';
186+
var b = '';
183187
console.log(this.options);
184188
$.each(this.options, function(i, a) {
185189
if (a.group && a.group !== prevGroup) {
186190
if (a.groupDisabled) {
187-
var b = 'disabled';
191+
b = 'disabled';
188192
}
189193
that.$listcontainer.append(
190-
'<span class="mobileSelect-group" ' + b + '>' + a.group + '</span>'
194+
'<span class="mobileSelect-group" ' +
195+
b +
196+
'>' +
197+
a.group +
198+
'</span>'
191199
);
192200
prevGroup = a.group;
193201
}
194202
if (a.groupDisabled || a.disabled) {
195-
var b = 'disabled';
203+
b = 'disabled';
196204
}
197205
that.$listcontainer.append(
198206
'<a href="#" class="mobileSelect-control" ' +
@@ -416,12 +424,11 @@ if (typeof jQuery === 'undefined') {
416424
if ($t.text()) {
417425
// var label = $t.parent().is('optgroup') ? $t.parent().attr('label') : false;
418426

427+
var label = false;
428+
var labelDisabled = false;
419429
if ($t.parent().is('optgroup')) {
420-
var label = $t.parent().attr('label');
421-
var labelDisabled = $t.parent().prop('disabled');
422-
} else {
423-
var label = false;
424-
var labelDisabled = false;
430+
label = $t.parent().attr('label');
431+
labelDisabled = $t.parent().prop('disabled');
425432
}
426433
console.log($t.val());
427434
options.push({
@@ -509,5 +516,6 @@ if (typeof jQuery === 'undefined') {
509516
onClose: function() {},
510517
style: 'btn-default'
511518
};
519+
// eslint-disable-next-line no-undef
512520
})(jQuery);
513521
//<form class="form-inline"><input class="form-control" type="search" placeholder="Search" aria-label="Search"></form>

0 commit comments

Comments
 (0)