Skip to content

Commit

Permalink
improve eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierZal committed Apr 21, 2024
1 parent a22ea3d commit 506105c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion ariston/lib/APICallErrorData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ interface APICallContextDataWithErrorMessage extends APICallContextData {
readonly errorMessage: string
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const withErrorMessage = <T extends new (...args: any[]) => APICallContextData>(
base: T,
error: AxiosError,
Expand Down
9 changes: 1 addition & 8 deletions decorators/addToLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ const FIRST_CHAR = 0
const PARENTHESES = '()'

const addToLogs =
<
T extends new (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[]
) => SimpleClass,
>(
...logs: string[]
) =>
<T extends new (...args: any[]) => SimpleClass>(...logs: string[]) =>
(target: T, context: ClassDecoratorContext<T>): T => {
class LogsDecorator extends target {
public error(...args: unknown[]): void {
Expand Down
13 changes: 9 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,27 @@ module.exports = tsEslint.config(
},
],
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-explicit-any': ['error', { ignoreRestArgs: true }],
'@typescript-eslint/no-magic-numbers': ['error', { ignoreEnums: true }],
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: 'onHomeyReady' },
],
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
camelcase: [
'error',
{ allow: ['^operation_mode$', '^target_temperature$'] },
],
'no-ternary': 'off',
'no-underscore-dangle': ['error', { allow: ['__'] }],
'one-var': 'off',
'sort-keys': ['error', 'asc', { natural: true }],
},
},
{
rules: {
camelcase: [
'error',
{ allow: ['^operation_mode$', '^target_temperature$'] },
],
},
},
{
files: ['**/*.ts'],
rules: {
Expand Down

0 comments on commit 506105c

Please sign in to comment.