Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Oct 26, 2024
1 parent c9940e5 commit 306cfe3
Show file tree
Hide file tree
Showing 8 changed files with 641 additions and 687 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

42 changes: 0 additions & 42 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SD Daten findet man unter Stream

## Changelog

### 0.0.45 (2024-09-11)
### 0.0.46 (2024-09-11)

- add SE support and clean up states

Expand Down
52 changes: 52 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const globals = require('globals');
const js = require('@eslint/js');

const {
FlatCompat,
} = require('@eslint/eslintrc');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

module.exports = [{
ignores: ['**/.prettierrc.js', '**/.eslintrc.js', 'admin/words.js'],
}, ...compat.extends('eslint:recommended'), {
plugins: {},

languageOptions: {
globals: {
...globals.node,
...globals.mocha,
},

ecmaVersion: 'latest',
sourceType: 'commonjs',
},

rules: {
indent: ['error', 2, {
SwitchCase: 1,
}],

'no-console': 'off',

'no-unused-vars': ['error', {
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
}],

'no-var': 'error',
'no-trailing-spaces': 'error',
'prefer-const': 'error',

quotes: ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true,
}],

semi: ['error', 'always'],
},
}];
4 changes: 2 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"common": {
"name": "gruenbeck",
"version": "0.0.44",
"version": "0.0.46",
"news": {
"0.0.45": {
"0.0.46": {
"en": "add SE support and cleanup states",
"de": "SE Support hinzugefügt und States aufgeräumt",
"ru": "добавить поддержку SE",
Expand Down
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ class Gruenbeck extends utils.Adapter {
this.setState('info.connection', false, true);
callback();
} catch (e) {
this.log.error(e);
callback();
}
}
Expand Down Expand Up @@ -1078,6 +1079,7 @@ class Gruenbeck extends utils.Adapter {
try {
currentErrorJSON = JSON.parse(errorState.val) || [];
} catch (error) {
this.log.debug(error);
currentErrorJSON = [];
}
}
Expand Down Expand Up @@ -1192,7 +1194,8 @@ class Gruenbeck extends utils.Adapter {
if (currentWaterLogState) {
try {
currentWaterLog = JSON.parse(currentWaterLogState.val);
} catch (erro) {
} catch (error) {
this.log.debug(error);
currentWaterLog = [];
}
}
Expand Down
Loading

0 comments on commit 306cfe3

Please sign in to comment.