Skip to content

Commit 24b5132

Browse files
committed
Fix ESLint error "Useless constructor"
1 parent e8e7d53 commit 24b5132

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ const config = {
9595
'no-shadow': 'off',
9696
'@typescript-eslint/no-shadow': 'error',
9797

98+
// https://github.com/typescript-eslint/typescript-eslint/blob/v4.5.0/packages/eslint-plugin/docs/rules/no-empty-function.md
99+
'no-empty-function': 'off',
100+
'@typescript-eslint/no-empty-function': 'error',
101+
102+
// https://github.com/typescript-eslint/typescript-eslint/blob/v4.5.0/packages/eslint-plugin/docs/rules/no-useless-constructor.md
103+
'no-useless-constructor': 'off',
104+
'@typescript-eslint/no-useless-constructor': 'error',
105+
98106
'@typescript-eslint/explicit-function-return-type': 'off',
99107
'@typescript-eslint/no-non-null-assertion': 'off',
100108
'@typescript-eslint/camelcase': 'off',

packages/react-form-with-constraints/src/Field.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export class Field {
1515
// Cannot be set as readonly :/
1616
public element?: HTMLInput | TextInput;
1717

18-
// FIXME https://github.com/typescript-eslint/typescript-eslint/issues/426
19-
// eslint-disable-next-line no-useless-constructor, no-empty-function
2018
constructor(public readonly name: string) {}
2119

2220
addOrReplaceValidation(validation: FieldFeedbackValidation) {

0 commit comments

Comments
 (0)