Compare commits

..

1 commit

Author SHA1 Message Date
Kristjan ESPERANTO
49d84755f4
Merge 361f55bec1 into cc3157881a 2024-12-06 08:46:15 +00:00
2 changed files with 30 additions and 18 deletions

View file

@ -26,6 +26,7 @@ Module.register('MMM-pages', {
return ['pages.css'];
},
/**
* Modulo that also works with negative numbers.
*
@ -33,7 +34,7 @@ Module.register('MMM-pages', {
* @param {number} n The divisor
*/
mod (x, n) {
return ((x % n) + n) % n;
return (x % n + n) % n;
},
/**
@ -212,13 +213,13 @@ Module.register('MMM-pages', {
MM.getModules()
.exceptWithClass(modulesToShow)
.enumerate(module => module.hide(animationTime, lockStringObj));
.enumerate((module) => module.hide(animationTime, lockStringObj));
// Shows all modules meant to be on the current page, after a small delay.
setTimeout(() => {
MM.getModules()
.withClass(modulesToShow)
.enumerate(module => module.show(animationTime, lockStringObj));
.enumerate((module) => module.show(animationTime, lockStringObj));
}, animationTime);
},

View file

@ -3,8 +3,6 @@ import eslintPluginStylistic from '@stylistic/eslint-plugin';
import globals from 'globals';
const config = [
eslintPluginJs.configs.recommended,
eslintPluginStylistic.configs['recommended-flat'],
{
files: ['**/*.js', '**/*.mjs'],
},
@ -18,10 +16,23 @@ const config = [
Module: 'readonly',
},
},
plugins: {
...eslintPluginStylistic.configs['all-flat'].plugins,
},
rules: {
...eslintPluginJs.configs.recommended.rules,
...eslintPluginStylistic.configs['all-flat'].rules,
'@stylistic/array-element-newline': 'off',
'@stylistic/brace-style': ['error', '1tbs', {allowSingleLine: true}],
'@stylistic/comma-dangle': ['error', 'only-multiline'],
'@stylistic/semi': ['error', 'always'],
'@stylistic/dot-location': ['error', 'property'],
'@stylistic/function-call-argument-newline': 'off',
'@stylistic/indent': ['error', 2],
'@stylistic/padded-blocks': 'off',
'@stylistic/quote-props': ['error', 'consistent-as-needed'],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/multiline-comment-style': 'off',
'@stylistic/multiline-ternary': 'off',
'object-shorthand': ['error', 'always']
},
}