Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Zalmanski committed Apr 11, 2024
1 parent f984462 commit a1ae5c6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
1 change: 1 addition & 0 deletions ariston/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default class AristonAPI {

public constructor(
settingManager: SettingManager,
// eslint-disable-next-line no-console
logger = console.log,
errorLogger = logger,
) {
Expand Down
31 changes: 26 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ const prettier = require('eslint-config-prettier')
const stylistic = require('@stylistic/eslint-plugin')
const tsEslint = require('typescript-eslint')

const eslintConfig = (function filteredEslintConfig() {
'use strict'
return {
...eslint.configs.all,
rules: Object.fromEntries(
Object.entries(eslint.configs.all.rules).filter(
([rule]) => rule !== 'no-useless-assignment',
),
),
}
})()

module.exports = tsEslint.config(
{ ignores: ['.homeybuild/'] },
eslint.configs.recommended,
...tsEslint.configs.strictTypeChecked,
...tsEslint.configs.stylisticTypeChecked,
eslintConfig,
...tsEslint.configs.all,
...markdown.configs.recommended,
{
languageOptions: { parserOptions: { project: true } },
Expand Down Expand Up @@ -141,13 +152,21 @@ module.exports = tsEslint.config(
},
},
],
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-magic-numbers': ['error', { ignoreEnums: true }],
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: 'onHomeyReady' },
],
'func-style': 'error',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
camelcase: [
'error',
{ allow: ['^operation_mode$', '^target_temperature$'] },
],
'max-lines': 'off',
'no-ternary': 'off',
'no-underscore-dangle': ['error', { allow: ['__'] }],
'sort-imports': 'error',
'one-var': 'off',
'sort-keys': ['error', 'asc', { natural: true }],
},
},
Expand All @@ -174,6 +193,8 @@ module.exports = tsEslint.config(
},
rules: {
...tsEslint.configs.disableTypeChecked.rules,
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a1ae5c6

Please sign in to comment.