Skip to content

Commit

Permalink
fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 19, 2023
1 parent 10b8618 commit d6bbd18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
15 changes: 5 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,13 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
],
rules: {
// https://typescript-eslint.io/rules/no-use-before-define#how-to-use
'no-use-before-define': 'off',

// TODO rules with a lot of errors to be fixed manually, fix in a separate PR
'@typescript-eslint/ban-types': 'off', // 16 eslint errors only, help wanted!
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/triple-slash-reference': 'off',

// TODO
'camelcase': 'off',
'no-alert': 'off',
'no-use-before-define': 'off',
'@internal/eqeqeq': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': 'off',
}
},
}],
};
12 changes: 6 additions & 6 deletions types/fomantic-ui-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ $().calendar({
}); // $ExpectType JQuery<HTMLElement>

$.flyout('alert', 'hello'); // $ExpectType JQuery<HTMLElement>
$.flyout('confirm', 'Are you sure?', function () {}); // $ExpectType JQuery<HTMLElement>
$.flyout('prompt', 'Enter Code', function () {}); // $ExpectType JQuery<HTMLElement>
$.flyout('confirm', 'Are you sure?', function () { /* make eslint happy */ }); // $ExpectType JQuery<HTMLElement>
$.flyout('prompt', 'Enter Code', function () { /* make eslint happy */ }); // $ExpectType JQuery<HTMLElement>

$.fn.flyout.settings.templates.greet = function (username) {
return {
Expand Down Expand Up @@ -75,7 +75,7 @@ $().form({
{
type: 'isExactly[cat]',
prompt: function (value) {
if (value == 'dog') {
if (value === 'dog') {
return 'I told you to put cat, not dog!';
}

Expand Down Expand Up @@ -122,8 +122,8 @@ $().form({
},
}); // $ExpectType JQuery<HTMLElement>

$.fn.form.settings.rules.date = function (str_date: string) {
return true;
$.fn.form.settings.rules.date = function (dateStr: string) {
return dateStr !== '';
};

$.modal('alert', {
Expand Down Expand Up @@ -184,5 +184,5 @@ $.toast({
});

$().transition('shake', '200ms');
$().transition('horizontal flip', 500, function () { alert('done!'); });
$().transition('horizontal flip', 500, function () { /* make eslint happy */ });
$().transition('fade up');

0 comments on commit d6bbd18

Please sign in to comment.