Skip to content

Commit 60f5f67

Browse files
committed
strictly autofix all rare errors
1 parent 4889d17 commit 60f5f67

File tree

16 files changed

+22
-47
lines changed

16 files changed

+22
-47
lines changed

.eslintrc.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,6 @@ module.exports = {
160160
'unicorn/prefer-regexp-test': 'off',
161161
'unicorn/prefer-switch': 'off',
162162
'unicorn/prefer-ternary': 'off',
163-
164-
// TODO rare errors
165-
'arrow-body-style': 'off',
166-
'block-scoped-var': 'off',
167-
'import/no-extraneous-dependencies': 'off',
168-
'import/order': 'off',
169-
'new-cap': 'off',
170-
'newline-per-chained-call': 'off',
171-
'no-extra-boolean-cast': 'off',
172-
'no-redeclare': 'off',
173-
'no-unneeded-ternary': 'off',
174-
'no-useless-return': 'off',
175-
'operator-assignment': 'off',
176-
'unicorn/no-console-spaces': 'off',
177-
yoda: 'off',
178163
},
179164
reportUnusedDisableDirectives: true,
180165
globals: {

src/definitions/behaviors/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@
16821682

16831683
// is not empty or blank string
16841684
empty: function (value) {
1685-
return !(value === undefined || '' === value || Array.isArray(value) && value.length === 0);
1685+
return !(value === undefined || value === '' || Array.isArray(value) && value.length === 0);
16861686
},
16871687

16881688
// checkbox checked

src/definitions/modules/calendar.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@
334334
if (isDay && settings.showWeekNumbers) {
335335
tempMode += ' andweek';
336336
}
337-
var table = $('<table/>').addClass(className.table).addClass(tempMode).addClass(numberText[columns] + ' column').appendTo(container);
337+
var table = $('<table/>').addClass(className.table).addClass(tempMode).addClass(numberText[columns] + ' column')
338+
.appendTo(container);
338339
if (isInverted) {
339340
table.addClass(className.inverted);
340341
}
@@ -1646,7 +1647,8 @@
16461647
if (!text) {
16471648
return null;
16481649
}
1649-
text = String(text).trim().replace(/([.:\/\-])\s+/g, '$1').replace(/\s+([.:\/-])/g, '$1').replace(/\s+/g, ' ');
1650+
text = String(text).trim().replace(/([.:\/\-])\s+/g, '$1').replace(/\s+([.:\/-])/g, '$1')
1651+
.replace(/\s+/g, ' ');
16501652
if (text.length === 0) {
16511653
return null;
16521654
}
@@ -1766,7 +1768,7 @@
17661768
if (isNaN(j)) {
17671769
continue;
17681770
}
1769-
if (1 <= j && j <= 12) {
1771+
if (j >= 1 && j <= 12) {
17701772
month = j;
17711773
numbers.splice(k, 1);
17721774

@@ -1781,7 +1783,7 @@
17811783
if (isNaN(j)) {
17821784
continue;
17831785
}
1784-
if (1 <= j && j <= 31) {
1786+
if (j >= 1 && j <= 31) {
17851787
day = j;
17861788
numbers.splice(i, 1);
17871789

@@ -1815,7 +1817,7 @@
18151817
if (isNaN(j)) {
18161818
continue;
18171819
}
1818-
if (0 <= j && j <= 23) {
1820+
if (j >= 0 && j <= 23) {
18191821
hour = j;
18201822
numbers.splice(i, 1);
18211823

@@ -1831,7 +1833,7 @@
18311833
if (isNaN(j)) {
18321834
continue;
18331835
}
1834-
if (0 <= j && j <= 59) {
1836+
if (j >= 0 && j <= 59) {
18351837
minute = j;
18361838
numbers.splice(i, 1);
18371839

src/definitions/modules/dimmer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@
721721
.addClass(settings.className.loader)
722722
.addClass(settings.loaderVariation)
723723
;
724-
if (!!settings.loaderText) {
724+
if (settings.loaderText) {
725725
l.text(settings.loaderText);
726726
l.addClass('text');
727727
}

src/definitions/modules/dropdown.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,9 +3304,7 @@
33043304
: (values == value)
33053305
;
33063306

3307-
return (hasValue)
3308-
? true
3309-
: false;
3307+
return !!(hasValue);
33103308
},
33113309
valueIgnoringCase: function (value) {
33123310
var

src/definitions/modules/popup.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,7 @@
371371
if (settings.inline || settings.popup) {
372372
return (module.has.popup());
373373
} else {
374-
return ($popup.closest($context).length >= 1)
375-
? true
376-
: false;
374+
return ($popup.closest($context).length >= 1);
377375
}
378376
},
379377

src/definitions/modules/progress.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
var precision = 1;
9696
var ratio = min / total;
9797
while (precisionPower < 10) {
98-
ratio = ratio * precision;
98+
ratio *= precision;
9999
if (ratio > 1) {
100100
break;
101101
}

src/definitions/modules/toast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
}
310310
if (settings.displayTime > 0) {
311311
var progressingClass = className.progressing + ' ' + (settings.pauseOnHover ? className.pausable : '');
312-
if (!!settings.showProgress) {
312+
if (settings.showProgress) {
313313
$progress = $('<div/>', {
314314
class: className.progress + ' ' + (settings.classProgress || settings.class),
315315
'data-percent': '',

tasks/config/project/config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ module.exports = {
2626
if (fs.existsSync(currentPath)) {
2727
// found file
2828
configPath = path.normalize(directory);
29-
30-
return;
3129
} else {
3230
// reached file system root, let's stop
3331
if (nextDirectory == directory) {

tasks/config/tasks.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ let overrideBrowserslist = hasBrowserslistConfig ? undefined : [
1818
];
1919

2020
// Node 12 does not support ??, so a little polyfill
21-
let nullish = (value, fallback) => {
22-
return value !== undefined && value !== null ? value : fallback;
23-
};
21+
let nullish = (value, fallback) => (value !== undefined && value !== null ? value : fallback);
2422

2523
module.exports = {
2624

@@ -120,7 +118,7 @@ module.exports = {
120118
if (error.line == 9) {
121119
element = regExp.variable.exec(error.message)[1];
122120
if (element) {
123-
console.error('Missing theme.config value for ', element);
121+
console.error('Missing theme.config value for', element);
124122
}
125123
console.error('Most likely new UI was added in an update. You will need to add missing elements from theme.config.example');
126124
} else if (error.line == 84) {

0 commit comments

Comments
 (0)